We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29059
    • 88 Posts
    ARGH - i don’t understand why this isn’t working.
    surely i can’t be the only person that wants/needs something like this in modx(?).

    thanks for the input "prowebscape". i put in the first code mod you gave me, but that made no change.
    as far as the second piece goes - the phx thing - i don’t know what that is.
    i’ll look it up in the downloads/repository and see if i can figure that out. i’ll post back my findings.

    but i’m just astonished that this "seemingly" simple thing is so hard to figure out. seems to me there should be a very simple way to implement one piece of client controlled content on multiple pages. boggelin’ the mind.
      • 29059
      • 88 Posts
      update...

      welp, i downloaded & installed the PHX "plugin" from http://modxcms.com/PHx-1006.html

      and i inserted your phx code into my "template" and nothing really changed. i still see the "yes" on the resulting page, but this time instead of code there’s just nothing where the content should be.

      has nobody done this before?

      if there’s "so many different ways to do things" then why are none of the ones so far working? i’m very confused. getting to the point of begging for help (lol).

      if we can’t get this to work, then i’ll have no choice but to go back to the original way of not giving the client the option of having it display or not and just force it on certain templates.

      but before i step back to that, please... more input.
      thx.jason.
        • 34017
        • 898 Posts
        Try these couple of things to see where the error is coming from:

        <h1>Test</h1>
        [[getField? &docid=`218` &field=`content`]]
        


        <h1>Test</h1>
        [[getField? &docid=`1` &field=`title`]]
        


        <h1>Test</h1>
        [[getField? &docid=`1` &field=`content`]]
        


        <h1>Test</h1>
        This should be sidebar content: [*sidebarcontent*]
        


        What were the results of these tests?
          Chuck the Trukk
          ProWebscape.com :: Nashville-WebDesign.com
          - - - - - - - -
          What are TV's? Here's some info below.
          http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
          http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
          • 29059
          • 88 Posts
          RESULTS...

          HERE IS A CULMINATION OF ALL THE CODE FOR THIS IN MY "TEMPLATE"...
          [*sidebardocument*]
          <HR>
          [!tvcnd? &tv=`sidebardocument` &cnd=`yes, 2` &rtn=`sidebarchunk`!]
          <HR>
          [+phx:if=`[*sidebardocument*]`:is=`yes`:then=`[[getField? &docid=`218` &field=`content`]]`+]
          <HR>
          <h1>Test</h1>
          [[getField? &docid=`218` &field=`content`]]
          <HR>
          <h1>Test</h1>
          [[getField? &docid=`1` &field=`title`]]
          <HR>
          <h1>Test</h1>
          [[getField? &docid=`1` &field=`content`]]
          <HR>
          <h1>Test</h1>
          This should be sidebar content: [*sidebarcontent*]
          <HR>


          A SCREENSHOT OF THE RESULT IS ATTACHED TO THIS POST.
          as you can see, the "yes" that’s in the "input option value" of the TV shows up, and the rest is the code. the actual content from the desired document is still not showing up.
            • 29059
            • 88 Posts
            and since a picture is worth a thousand words (i may have written that much already ;-)
            attached are a couple more screenshots of the TV & chunk as written about above.
              • 25663 MODX Staff
              • 12,272 Posts
              I think your input option value needs to be:
              yes==yes
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 29059
                • 88 Posts
                SOLUTION...

                welp, thanks to the personal help of "prowebscape" off-forum, we got this figured out and working.
                i’ll post this here in case anybody else in the future finds this thread useful...

                first, i had some upper & lower case characters mismatched. i think if from the beginning i used all lowercase "tvcnd" and "GetField" accordingly, this might not have taken so long.

                and here’s my configuration that we’re using now (thanks to prowebscape) that works!...

                TEMPLATE "General" includes...
                [+phx:if=`[* sidebarcustom*]`:is=``:then=`[*sidebarcustom*]`+]<br />
                [+phx:if=`[*sidebardocument*]`:is=`yes`:then=`{{sidebarchunk}}`+]
                (yes, that's a space after the first asterisk only)

                TEMPLATE VARIABLE "sidebarcustom" is set to...
                Input Type: RichText

                TEMPLATE VARIABLE "sidebardocument" is set to...
                Input Type: CheckBox
                Input Option Values: "yes==yes"

                CHUNK "sidebarchunk" is...
                [[GetField? &docid=`218` &field=`content`]]

                and of course i’m using a document named "SideBar" which has a doc id # of 218 and a template of "blank" for the content.

                and all this wouldn’t be possible without...
                the GetField "snippet" downloaded from http://modxcms.com/getField-667.html
                and the PHx "plugin" downloaded from http://modxcms.com/PHx-1006.html

                welp, thanks again to all who contributed and i hope this helps someone else someday.
                cherio,
                -jason.
                  • 34017
                  • 898 Posts
                  I think this:
                   [+phx:if=`[* sidebarcustom*]`:is=``:then=`[*sidebarcustom*]`+]<br /> 


                  needs to be:
                  [+phx:if=`[*sidebarcustom*]`:ne=``:then=`[*sidebarcustom*]`+]<br /> 


                  The space messed up that call. and ne is the same as !=


                    Chuck the Trukk
                    ProWebscape.com :: Nashville-WebDesign.com
                    - - - - - - - -
                    What are TV's? Here's some info below.
                    http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
                    http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008