Showing posts with label Sites. Show all posts
Showing posts with label Sites. Show all posts

Tuesday, July 19, 2011

Navigation Extension for Salesforce Sites

Thinking about how to best handle navigation within Salesforce Sites, I decided to try my luck with setting up an easily re-usable extension that can be applied to an entire site.

Fortunately, it looks like the apex:commandLink element paired with apex:param is able to produce the customizable navigation code I wanted.

Instead of writing out methods like the following...

public PageReference goToPage1() { ... }
public PageReference goToPage2() { ... }
public PageReference goToPage3() { ... }

all that's needed is...

public PageReference goToDestinationPage() { ... }

Much better, right? See the demo source code for more details.

Monday, July 18, 2011

Preview as Admin Feature for Salesforce Sites

I just discovered (1 year too late) the Preview as Admin feature for developing Salesforce Sites.  This has got to be one of the more useful things that I wish I had picked up earlier.

Basically, when developing a site and testing it as an anonymous user, error messages are sometimes hidden behind the annoying "Authorization Required" message.

Preview as Admin saves the day by delivering the anonymous user experience, enhanced with a useful description of the errors at the bottom of the page whenever errors appear.

Awesome, indeed.  I wonder what other features are out there that I don't know but should know...