I'm new to SS and having a difficult time finding answers to my questions for SS 3.0+, so I decided to giving posting to the forum a shot :-)
The design I'm coding is a one page site with multiple vertical and horizontal "panels". Some of the panels have buttons that link to other panels with a #. I've set it up so the panels are subpages and the panel IDs are the URLSegment for each page. In order to add buttons to each section, I set up a gridfield in the CMS and I am using the Link Field module to allow the user to input either an internal, external, or email link. When the user selects an Internal Page, the module returns the ID for that page. I need to be able to take that ID and grab the URLSegment for the page it's referencing so I can create an anchor link to that section in the page.
Here's the code for the buttons from my template:
<div class="row">
<% if $Link.Type == "Internal" %>
<a href="#{$Page($Link.Internal).URLSegment}" class="fake_button js-hide-cursor">$Text</a>
<% else_if $Link.Type == "External" %>
<a href="{$Link.External}" class="fake_button js-hide-cursor" target="_blank">$Text</a>
<% else_if $Link.Type == "Email" %>
<a href="mailto:{$Link.Email}" class="fake_button js-hide-cursor">$Text</a>
<% else %>
<button class="fake_button js-hide-cursor">$Text</button>
<% end_if %>
</div>
Basically, I need something like {$Page($Link.Internal).URLSegment} where I can pass in the PageID from $Link.Internal and retrieve the URLSegment for that page.
Thanks!