We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32645
    • 377 Posts
    I have a wayfinder call which outputs a menu.

    I want to make sure that it only ever includes a menu item that has been checked as "Show on homepage" (template variable).

    But the problem is, even though I have checked some menu options, it never seems to see the value.

    <p[+wf.classes+]>
    <a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]>[+wf.linktext+]</a> 
    [+phx:if=`[+tv_showHomepage+]`:is=`Yes`:then=`Yes`+]  // this never displays anything, even if the item has been checked.
    [+phx:if=`[*tv_showHomepage*]`:is=`Yes`:then=`Yes`+] // this never displays anything, even if the item has been checked.
    </p>
    


    The checkbox template variable is:

    Template variable: tv_showHomepage
    Input type: Checkbox
    Input options: Yes
    Default: (null)
    


    Why does it not see those the value of `tv_showHomepage`?

    Secondly, how do I make it say:

    "If tv_showHomepage = Yes then display menu item"

    Thanks.
      • 32645
      • 377 Posts
      I couldn’t figure out what the problem was, in the end I custom built a snippet to handle what I needed and have now resolved this problem (whatever it was).

      *Closed*
        • 25201
        • 94 Posts
        I see exactly the same issue, phx not seeing the value of a checkbox, but it also applies to radio buttons, dropmenus..

        Did anyone find out what the problem is?

        UPDATE: when the tv, like the one in the example above [+tv_showHomepage+] is accessed elsewhere in the ditto template, phx does process the checkbox value. For instance one can wrap <!--[+tv_showHomepage+]--> or use it as an $option variable for a snippet call like this: [[void=’[+tv_showHomepage+]’]]. The php for the snippet than just needs a return:

        <?php
        return ;
        ?> 
        


        Clearly a bug of some sort.

        Thanks
          • 18646
          • 106 Posts
          I’m having this exact same issue. So I don’t understand your last post, what is the solution? Where file do I return a value on?

          Regards,
          Matt
            • 29076
            • 615 Posts
            Quote from: worchyld at May 04, 2009, 04:03 PM

            I couldn’t figure out what the problem was, in the end I custom built a snippet to handle what I needed and have now resolved this problem (whatever it was).

            *Closed*
            Could you please post your solution (snippecode). There are many having the same question. smiley

            Thanks.
              I think, thererfor I am! But what I am, and why...?
              • 18266
              • 23 Posts
              Hi everybody!

              In Evo 1.0.2 it works with no trouble!

              Best regards!
              Marcus
                • 21054
                • 78 Posts
                I’m having the same issue, and I’m using 1.0.2 sad

                [+phx:if=`[*showComments*]`:is=``:then=`{{Comments}}`:else=``+]

                doesn’t work.

                If I try this: [+phx:if=`1`:is=``:then=`[*showComments*]`:else=``+] nothing is returned. (i.e. showComments is NULL even though I am checking it)
                  • 11975
                  • 2,542 Posts
                  Hi,

                  I don’t if this apply to WF as I haven’t looked at the code but perhaps the template are parsed to find the placeholders.
                  So the phx syntax could break the finding of tags and the values used for PHx comparison do not exist.

                  :)
                    Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                    • 11975
                    • 2,542 Posts
                    It seems that the issue is related to the findingTags function.
                    Try ti add the tv name to the &tvList param.

                    This should work.

                    Hope that helps smiley
                      Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                      • 21054
                      • 78 Posts
                      I’m not sure how to use your suggestion... but what I did do was add "true, false" to the input option values... which seems to have worked!