Jump to:

3447 Posts in 1032 Topics by 872 members

Template Questions

SilverStripe Forums » Template Questions » Read $Title Field from RedirectPage

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1042 Views
  • Andre
    Community Member
    126 Posts

    Read $Title Field from RedirectPage Link to this post

    Hi there, I'm trying to read the "Page Name" ($Title, $MetaTitle) from a RedirectPage inside a Navigation, but I always get the result of Navigation label ($MenuTitle). What am I doing wrong, how can I fix it?

    for Example:
    Page Name = thispage
    Navigation Label = blablabla

    <% control Menu(1) %>
    <li id="$Title" class="$LinkingMode"><a href="$Link" id="link-$MetaTitle"><div style="display: none;">$MenuTitle</div></a></li>
    <% end_control %>

    will result to

    <li id="blablabla" class="link"><a href="/target/" id="link-blablabla"><div style="display: none;">blablabla</div></a></li>

    instead of, what I expected

    <li id="thispage" class="link"><a href="/target/" id="link-thispage"><div style="display: none;">blablabla</div></a></li>

  • Andre
    Community Member
    126 Posts

    Re: Read $Title Field from RedirectPage Link to this post

    I did the following and now its working

    <li id="{$Title.XML}" class="$LinkingMode"><a href="$Link" id="{$Title.XML}-link"><div style="display: none;">$MenuTitle</div></a></li>

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.