Adding Mutiple Skuid Pages into a force.com site

  • 1
  • Question
  • Updated 3 years ago
  • Answered
Hello,

I've been able to create a force.com site and include a Skiud page as my Home page....which is basically an AccountsTab (listing of Accounts)....now what I would like to do....is have to ability to drill down from my AccountsTab home page....into my Skuid Account Details page....how do I go about doing this? Thank you!
Photo of rocketc

rocketc

  • 722 Points 500 badge 2x thumb

Posted 5 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Because you are in a Force.com Site environment, the regular Name field links that Skuid displays won't work (e.g. clicking on "Acme" normally takes you to the Acme account's detail page, but from a Site, this URL syntax doesn't work), you should probably add a Row Action to the Table in the Skuid Page you're using for the Force.com Site Home Page. This Row Action should be of type "Redirect", and should send the user either to another Visualforce Page containing a Skuid Page (e.g. create a VF page called "AccountDetail_PublicSite" that uses the skuid page tag to show a Skuid Page), or directly to a Skuid Page, e.g.

  • Method A: 
    /AccountDetail_PublicSite?id={{Id}}   
  • Method B: /apex/skuid__UI?page=AccountDetailFromPublicSite&id={{Id}}
Assuming that you had a VF page called something like "AccoundDetail_PublicSite" and/or a Skuid Page called "AccountDetailFromPublicSite" or something like that.
Photo of rocketc

rocketc

  • 722 Points 500 badge 2x thumb
Worked!! Thanks Zach
Photo of Craig Rosenbaum

Craig Rosenbaum

  • 4,776 Points 4k badge 2x thumb
Zach,

I have a Sites page that is showing a skuid "detail" page. However, I cannot get it to pass the Id from the URL to the page. The site and skuid page loads with no data when I don't append the parameter: /apex/skuid__UI?page=ContactDetailStaffSites, but when I try /apex/skuid__UI?page=ContactDetailStaffSites?id=003370000033QyTAAU I get a blank page with no skuid page at all. Any ideas?
Photo of Greg Jarrett

Greg Jarrett

  • 3,496 Points 3k badge 2x thumb
Hi Craig,

Zach will probably have a much clearer answer than me, but here's a couple of things to check in the meantime:

- Does the site's 'Guest User' profile have visibility of the object where the id is coming?
- Again in the site's 'Guest User' profile, check the Field Level security for the id field of the object
- Are the sharing settings for the object set to read or read-write, or is there a sharing setting that says something like IF Account.Status__c = 'Open', then make it Read or Read/Write.

I guess the first thing to test is whether the page works when you are logged in, but then fails when you are logged out (or in an incognito browser). If it works when you are logged in, then its most likely a sharing setting or field-level security issue.
Photo of Greg Jarrett

Greg Jarrett

  • 3,496 Points 3k badge 2x thumb
I'm not up to Banzai 7.5 yet, but I'm not sure that's the issue. I think the first step is to get the page working when you are logged in, and then all you need to do is adjust the security settings to get it working in a site.

It looks like the console is saying the page isn't receiving the id parameter - can you check if the model in your page has both the 'Id' and the 'Name' parameter checked?
Photo of Craig Rosenbaum

Craig Rosenbaum

  • 4,776 Points 4k badge 2x thumb
Yes, Id and Name are both checked and included in the model. 

Here's a screen shot of the actual error in the console. 

Photo of Craig Rosenbaum

Craig Rosenbaum

  • 4,776 Points 4k badge 2x thumb
...found the issue. I was using ContactDetailStaffSites?id=003370000033QyTAAU to add the URL parameter...not ContactDetailStaffSites&id=003370000033QyTAAU. Works now. Thank you Greg for your help! Sometimes its those little things that get you.
Photo of Greg Jarrett

Greg Jarrett

  • 3,496 Points 3k badge 2x thumb
I know the feeling! Glad you got there.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Glad you found the issue.  I just saw it myself.  15 hours late... 
Photo of Jack Sanford

Jack Sanford, Champion

  • 8,322 Points 5k badge 2x thumb
I'm making an entire site with Skuid, and we want the address bar to stay clean when we navigate from page to page. We're still working on getting our custom domain to persist, e.g. www.fullskope.com goes to fullskope.secure.force.com, but assuming we can get that working:

what's the best way to make sure that when we navigate to a different page it looks like /products or /services?

The one way I know is to create a new Site in Salesforce for each page, then that site would have the URL /products and have as it's home page the VF page that contains the skuid page I want to use.

Is that the best way? Will that way even work (I'm still testing)? Is there some better way?

To take this further, eventually we want to have a Blog, and we're thinking each blog post will be a Salesforce record of a custom BlogPost__c object, would it be possible to have the URL in the address bar be:
example.com/blog/blog-title-here-from-custom-field
as opposed to
example.com/blogPostDetailSkuidPage?id={{id}}
Thanks!
Photo of JD Bell

JD Bell, Senior Product Engineer

  • 2,996 Points 2k badge 2x thumb
You'll need to take advantage of the Apex URL Rewriter functionality. This give you the ability to intercept Requests and modify them before they are handled by the server.

For example, if the user enters /products, you can intercept that URL and silently load up the /apex/c__site_prods_V1 visualforce page. Or you could intercept /blog/my_blog_title and silently load up the /apex/c__blog?name=my_blog_title page.

See the following Salesforce documentation for more information:

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_site_urlRewriter.htm
Photo of Jack Sanford

Jack Sanford, Champion

  • 8,322 Points 5k badge 2x thumb
Thanks! So it looks like we can go ahead with development and worry about cleaning up the URL towards the end.