We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21112
    • 156 Posts
    Making progress, but come up against a new, confusing roadblock.

    As I mentioned, I have two different templates for the site. A main template, which is used to display a static content page, such as this: http://www.harryjenkins.com/index.php?id=2

    The PHx content source swapping works fine on this when I take out the Admin user filter (does not work when that’s in there).

    I have a second template that has two ditto calls, displaying 5 summaries in the left column, and the selected page’s content in the right column. The PHx line doesn’t display the"draft" content no matter the radio button status. eg: http://www.harryjenkins.com/index.php?id=217

    So it works in one case, but when identically used in another template, it doesn’t. I’m so confused by this. I can provide code if it will help. I didn’t want to spam the thread though untill I knew the code will help.

    Thanks for the ongoing assistance.
      • 34017
      • 898 Posts
      Double check your phx syntax. I was frustrated for half an hour earlier today trying to figure out what was wrong. It’s usually syntax.

      Also start with the simple call. Then add items to see which ones the problem. I know these are really basic, but i havent seen a time where the bug was phx (of course this would be it then).
        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
        • 21112
        • 156 Posts
        I’m fairly sure it’s not the syntax. Two reasons for that, earlier in the thread, a couple of syntax errors were noticed and fixed, so knowledgable people have already looked at it. Second, the code works as it should on the primary template (aside from the admin user checking part), but doesn’t work on the second template. At the least, this part of the PHx code works. Syntax may be a problem with the user account conditional, but it wouldn’t explain why it’s not working in the second template.

        I agree that the problem is almost always with the implementation, and not the source code, but I don’t think it’s with the PHx call this time. Thanks for the suggestion though smiley
          • 34017
          • 898 Posts
          Are there any errors in the manager log or php error log?

          The TV is associated with the second template right? (Im sure it is but just have to ask)
            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
            • 21112
            • 156 Posts
            The system events report no errors relating to the display of the pages. Where do I find the php error log? I’m on a shared server.

            I double checked, and the TVs do apply to all the templates.
              • 25663 MODX Staff
              • 12,272 Posts
              It’d be helpful to see the actual calls being used and PHx syntax. There are times when PHx doesn’t play nice with the normal parser in MODx unfortunately.
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 21112
                • 156 Posts
                Here’s the main template (much of the site is stored in chunks - let me know ifd it would help to see them):

                {{commonheader}}
                
                <div id="headerprint"><a href="#" onclick="setActiveStyleSheet('default'); return false;"><img src="images/header-print.jpg" width="789" height="130" alt="Print header" border="0" /></a></div>
                <div id="logos-right">{{logosright}}</div>
                
                <div id="contentarea">
                <div id="leftcol">
                
                <h1>[*longtitle*]</h1>
                [+phx:if=`[*show_draft*]`:is=`yes`:and:mo=`Admins`:then=`[*test_draft*]`:else=`[*content*]`+]
                </div>
                <br clear="all" />
                </div>
                
                {{commonfooter}}


                Here’s the template for articles:

                {{commonheader}}
                
                <div id="headerprint"><a href="#" onclick="setActiveStyleSheet('default'); return false;"><img src="images/header-print.jpg" width="789" height="130" alt="Print header" border="0" /></a></div>
                
                <style>
                #rightcol p {
                width:98%;
                }
                </style>
                
                <div id="contentarea">
                <div id="docdisplay">
                <div id="leftcol">
                
                <h1>Local News & Issues</h1>
                
                [[Ditto? &tpl=`dittolocal` &parents=`[*parent*]` &dateSource=`pub_date` &dateFormat=`%d %b %g` &sortBy=`pub_date` &display=`999` &extenders=`summary` &truncText=`Read more>` &truncLen=`55` &tplTrunc=`readmore` &truncOffset=`30`]]
                
                {{column}}
                
                <h2 style="width:100%; text-align:center;">[*longtitle*]</h2>
                <div align="center"><img src="images/local-[*id*].jpg" border="0" alt="[*longtitle*]" align="center" /></div><br /><br />
                <div id="localrightcol">
                [+phx:if=`[*show_draft*]`:is=`yes`:and:mo=`Admins`:then=`[*test_draft*]`:else=`[*content*]`+]
                </div>
                
                {{printandpdf }}
                
                </div>
                <br clear="all" />
                </div>
                </div>
                
                {{commonfooter}}


                Is this what you were after rthrash? Is there anything else I can post that will help? I’d really like to sort this one out soon, it’s starting to annoy me. Thanks to everyone for the help.
                  • 25663 MODX Staff
                  • 12,272 Posts
                  Not what I was looking for per se, but what someone will likely need to help troubleshoot this! This sounds like to me a bug in PHx, or one of those lovely time when PHx and other components just don’t play nicely together. You might try removing the other ditto calls and see if it works, since Ditto also includes PHx functionality and a PHx parser; it could be some weird conflict there (queue Twilight Zone music). Good luck regardless!
                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • 21257 MODX Staff
                    • 730 Posts
                    neilcreek,
                    Have you played with caching on the page in question?
                      Mike Schell
                      Lead Developer, MODX Cloud
                      Email: [email protected]
                      GitHub: https://github.com/netProphET/
                      Twitter: @mkschell
                      • 34017
                      • 898 Posts
                      neil,

                      Ditto can’t read TVs in a phx loop. Try adding the following paramater to your ditto call

                      &hiddenFields=`show_draft`
                        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