• Wayfinder (in Revo) - how to filter output using TVs?#

  • gadgetto Reply #1, 3 months, 3 weeks ago

    Reply
    Hello,

    is it possible to filter resources in Wayfinder (Revolution) based on TVs?

    I have 2 TVs (checkboxes) showInMainMenu and showInFooterMenu.
    I'd like to give an editor the possibility to set a checkbox value, to decide in which menu the resource will be displayed.

    Can this be done with output filters or do I have to write a snippet?

    Thanks in advance,
    Martin


  • ottogal Reply #2, 3 months, 2 weeks ago

    Reply
    You could use an explicit &rowTpl wherein you decide by a phx statement by an output modifier in which way to display the item, dependent on the value of the TV. If the TV is unchecked, the &rowTpl could give an empty output.

    The Wayfinder call for the Footer Menu would use a similar &rowTpl, but refering to the second TV.

    Edit:
    Sorry, we're in Revo...


  • ottogal Reply #3, 3 months, 2 weeks ago

    Reply
    Sorry, I don't find the time to get into this. But I think that writing a snippet is the better choice over output filters. The Wayfinder should have the snippet call in its &rowTpl parameter, like
    &rowTpl=`[[!GetRow]]`

    and the snippet GetRow should return the normal row template chunk or an empty string, dependent on the value of the TV.
    (You need two versions of the snippet, one for each of the menus or TVs, respectively.)


  • Nathan Reply #4, 3 months ago

    Reply
    I have been trying work out what I could be doing wrong for a while without much luck.

    I want to dynamically set the startId in the Wayfinder call in Revo.
    I have set up a custom config and by turning on debug I can see that the config is being loaded. I was hoping to use $_GET['ID'] to pull the ID from the querystring I want wayfinder to use as the start ID.

    As this didn't work, I decided hard code the startId into the config to test. Wayfinder seems to be ignoring this as well.

    This is my Wayfinder call:
    [[!Wayfinder?config=`acn` &debug=`yes` &rowTpl=`rowTpl` &outerTpl=`outerTpl`]]


    This is the config:

    <?php
    $startId = 59;

    Wayfinder just ignores the startId altogether and uses the current ID.

    Any ideas?

    Thanks


  • ottogal Reply #5, 3 months ago

    Reply
    I was hoping to use $_GET['ID'] to pull the ID from the querystring
    At least that should be $_GET['id'], since the query string parameter is id (lower case).
    How is your Wayfinder call?


  • Nathan Reply #6, 3 months ago

    Reply
    Sorry, I didn't put the Wayfinder call in a code block. It is visible now.

    I don't think it matters that $_GET['ID'] is uppercase if that is how it is included in the querystring..
    Anyway, as I hard coded the $startId in the config this does not make any differenece at this stage. Wayfinder appears to ignore the config altogether.


  • ottogal Reply #7, 3 months ago

    Reply
    As far as I observed, Wayfinder does not ignore the config as a whole, but the $startId in it ( $level=1 for example is not ignored).
    May be the startId plays a special role. When I tried to use a property set (a copy of the default one) instead of the config file, I found that the parameter startId is not listed in the property set.
    Can someone shed a bit light on this?