Scenario: You're exposing some VisualForce pages over sites, and in one of those pages you want to link to another.
Solution: My first reaction was to use ApexPages.currentPage() in the controller to grab the current URL which I could then modify, but that's not the correct (or simple) approach! All you need is to utilise one of the VisualForce Global Variables: $Page.
{!$Page.PageName}
<!-- For Example -->
<a href="{!$Page.Page2}">Link to Page 2</a>
Too easy!
0 comments:
Post a Comment