function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JWikkJWikk 

Authenticated Sites (Force.com Sites) Visualforce page approach?

Hi we are used to customer portal and also creating VF pages in regular SF. We are used to querying data in our constructor by first passing in an id which is read of the URL.

 

However with Sites, there are no more standard pages so the id is harder to pass around between VF pages. Is there a resource on how to setup our own header and sidebar as a template while jumping from one custom VF page to another(drill down)? What's the best practice?

 

More specifically when a user clicks on the name field link on one VF page (list), how do we jump to another VF page (detail)? Do we just prepend /apex/pagename to url targets?

 

Also do you have header and sidebar visualforce pages as includes when using the VF page in Force.com Sites?

 

Any documentation that provides a way to think through user navigation?

 

-James

ForcepowerForcepower

James,

 

There is no restriction on passing id's between VF pages within authenticated sites. It would still work unless you do not want to pass id's around for some other reason (may be security).

 

Ram

JWikkJWikk
Yes, but normally when users click on the Name field, the link will want to take them to a SF standard page, but we want to take them to a VF page instead. I know we can use override to take them to a VF page in regular Salesforce, but do we use the same technique for Force.com Sites? or do we have to change the link url in our Controller code?
ForcepowerForcepower

Exactly right. You can (and would want to) control the links through your controller. You can get the id as a parameter and take the appropriate action based on the commandlink or button you're using.

 

JWikkJWikk
Okay so my first visualforce page would hardcode the url to the second visualforce page in the clickable link?
ForcepowerForcepower

Nope - unless it's an external link, you don't want to hardcode links into your VF page. You should tie the link to a controller action which can then figure out how to route it based on the context.

bob_buzzardbob_buzzard

You don't necessarily need a custom/extension controller for a page, in which case it is fine to put the destination page directly in the markup of the source page.

ForcepowerForcepower

Agreed. VF page with standard controller and no extensions would be limited to putting links directly in the VF markup.