Jump to:

3401 Posts in 979 Topics by 855 members

Template Questions

SilverStripe Forums » Template Questions » Desesperate for <%if param == url %>

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

Page: 1
Go to End
Author Topic: 480 Views
  • santosmateo
    Avatar
    Community Member
    11 Posts

    Desesperate for <%if param == url %> Link to this post

    I have a couple of days trying the following:

    1. I have a menu with a list of items from a table (table1).

    2. I have a few pages with calls to the same elements of the table from $ MANY_MANY relationship

    I access the url through getURLParams () from a function in the parent page:

    public function get_url_action() {
    $full_url = $this->getURLParams();
    $url_action= $Params[Action];
    return new ArrayData(array("url" => $url_action));
    }

    I call it with

    <% control get_url_action%>
    $ url
    <% end_control%>


    can be:

    <% Control Children%>
    <% Control table1%>
    <% If value_table1 == get_url_action%>
    I can see the data from the Children page
    <% end_if%>
    <% end_control%>
    <% end_control%>

    thank you very much, I'm a little lost.

  • Ryan M.
    Avatar
    Community Member
    309 Posts

    Re: Desesperate for <%if param == url %> Link to this post

    This is a pretty good tutorial on how to use the Page Controller and urlParams to serve up customized content.

    http://www.ssbits.com/tutorials/2010/dataobjects-as-pages-part-1-keeping-it-simple/

  • santosmateo
    Avatar
    Community Member
    11 Posts

    Re: Desesperate for <%if param == url %> Link to this post

    Ryan, sorry for the delay to respond, but was a little busy these days.

    Thank you very much for the information, I was studying it and maybe I can integrate it into my web.

    Again thank you very much!

    480 Views
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.