We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18474
    • 5 Posts
    Hi.

    Im trying to set up Wayfinder so that it outputs the documents published date like this: "26/12, 2010: Pagetitle".
    Ive tried doing so by creating this chunk for &rowTpl:
    <li[[+wf.id]][[+wf.classes]]><a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]>[[+publishedon:strtotime:date=`%e/%M-%Y`]]: [[+wf.linktext]]</a>[[+wf.wrapper]]</li>


    But it this does not output the date, only ": pagetitle".


    I know I could do this easily with getPage, but I need the active menuitem to have an "active"-class applied.

    Any ideas?
    • I think you need to use pub_date instead of publishedon
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 11076
        • 159 Posts
        Susan,
        I think you need to use pub_date instead of publishedon

        • publishedon - The date the Resource was published.
        • pub_date - The scheduled date for a Resource to be published.
        so i guess he was right.

        I reproduced this. I’m getting a blank instead of the placeholder which should have been there, no matter what settings resource fields i’m trying. maybe wayfinder isn’t process them.

        (although in the documentation it’s said that:
        With the current version of WayFinder in Revolution, you can access your own custom TVs by using a placeholder without the ’wf.’ prefix.
        http://rtfm.modx.com/display/ADDON/Wayfinder#Wayfinder-TemplateVariables

        _

        https://github.com/splittingred/Wayfinder/issues (?) (:
          Michael Shraibman( gOmp)  | Freelance Design & Development | wink  impossible is nothing...
        • ah, right. However, if that’s "custom TVs", then maybe it needs to be a TV and not the resource value.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 3749
            • 24,544 Posts
            Did you try [[+wf.publishedon ... ?
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 11076
              • 159 Posts
              Susan, i had doubts about it too,
              But the example given is: [[+my_TV]] which i understand as TV or settings resource fields (which are somewhat like reserved TV`s and we retrive them as same) pulled from each resource wayfinder rolling.
              if we use it with `*` instead of `+` (as placeholder) it will give us the output of the tv for the page the snippet is called from.
              correct me if i don’t getting this right.

              Bob, i’ve tried that and it dosen’t work. I even tried all those options uncached, and still nothing.
                Michael Shraibman( gOmp)  | Freelance Design & Development | wink  impossible is nothing...
                • 3749
                • 24,544 Posts
                I haven’t looked at the Wayfinder code, but maybe it doesn’t set all fields as placeholders.

                I’m sure you already did this, but if not, take a look in the DB and make sure the document you’re testing on *has* a published field setting.

                What do you see if you include &debug=`1` in the parameters?
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 3749
                  • 24,544 Posts
                  OK, I just took a look at the code and it looks like publishedon is *not* an available placeholder.

                  I can think of these options:

                  1. Hack the Wayfinder code
                  2. Create a publishedon TV with an @EVAL binding that gets the publishedon value (not sure this would work) or save the publishedon date in it manually (that would work).
                  3. Use getResources instead of Wayfinder.
                  4. Write a custom snippet to use instead of Wayfinder.
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting
                    • 8109
                    • 128 Posts
                    Worth mentioning that [[+hidemenu]] is also not an available placeholder in Wayfinder. Nor is [[+published]]. But why? These are perfectly useful for menu-based logic.
                      Revo 2.0.8-pl
                      • 3749
                      • 24,544 Posts
                      Wayfinder does use hidemenu to decide what to show but doesn’t set a placeholder for it. Since Wayfinder has to run uncached for every page, only the placeholders that people would want to actually display are set, in order to make it more efficient. It should be pretty easy to copy the Wayfinder code to your own snippet and change it to set any placeholders you want to use.
                        Did I help you? Buy me a beer
                        Get my Book: MODX:The Official Guide
                        MODX info for everyone: http://bobsguides.com/modx.html
                        My MODX Extras
                        Bob's Guides is now hosted at A2 MODX Hosting