We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7923
    • 4,213 Posts
    Hmm.. doesn’t wayfinder have placeholder available for the currently processed item ID in rowTpl’s? I know there is the &rowIdPrefix parameter, but I can’t use it. I think it would be good if wf.id placeholder would just return the ID of the document and not like it’s now. If I want to use it like it’s done now, I could allways put <li id="myprefix[+wf.id+]">... to the rowTpl’s my self.

    This is what I’m trying to achieve in rowTpl’s:

    <div id="panel[+wf.id+]">
    ...
    <div id="panel[+wf.id+]-body">
    [+wf.wrapper+]
    </div>
    </div>

    But I cannot do that because wf.id returns something like: id="rowIdPrefix8".. I think that’s a bit too restricting indeed.. so maybe have it just return the ID and remove &rowIdPrefix parameter (as that can be built in the rowTpl’s anyways), or make a new placeholder for just the ID.

    And what I’m trying to do exactly is this "menu" as an example to this thread.


      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
      • 15987
      • 786 Posts
      Sounds like a good idea to me. I am leaving for a conference/vacation tommorow so I will be gone for a week. I will try to take a look at this addition when I get back.
        • 20765
        • 90 Posts
        myfriendscallmebill Reply #93, 20 years, 1 month ago
        Quote from: doze at Aug 25, 2006, 02:12 PM

        doesn’t wayfinder have placeholder available for the currently processed item ID in rowTpl’s?

        I call Wayfinder with the parameter: &titleOfLinks=`id`

        Then in the row template I use [+wf.title+] wherever I need that row’s doc ID to appear.

        Typically, I use this placeholder in a call to the GetField snippet, which lets me get any field I want from the row’s doc.

        --HTH

          • 7923
          • 4,213 Posts
          Quote from: myfriendscallmebill at Aug 26, 2006, 01:10 PM

          Quote from: doze at Aug 25, 2006, 02:12 PM

          doesn’t wayfinder have placeholder available for the currently processed item ID in rowTpl’s?

          I call Wayfinder with the parameter: &titleOfLinks=`id`

          Then in the row template I use [+wf.title+] wherever I need that row’s doc ID to appear.

          Typically, I use this placeholder in a call to the GetField snippet, which lets me get any field I want from the row’s doc.

          --HTH
          Nice workaround for the time being! Thanks alot!


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 7455
            • 2,204 Posts
            I saw that you made some examples from cssplay like the flyoutmenu now Stu has made a new version of that menu that needs less css could you make a template for that menu also?

            I tryed it but I just do’nt get it yet. would be grat to see this menu work in modx

            url:
            http://www.cssplay.co.uk/menus/flyout2.html

            thanks,
            Dimmy
              follow me on twitter: @dimmy01
              • 7923
              • 4,213 Posts
              Hmm.. am I just not getting it, or is there no way to template active items all the way up the tree? I would like to have all active items in just text, not links, but can’t seem to make it happen..


                "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                • 7923
                • 4,213 Posts
                Quote from: Dimmy at Aug 29, 2006, 02:26 AM

                I saw that you made some examples from cssplay like the flyoutmenu now Stu has made a new version of that menu that needs less css could you make a template for that menu also?
                Yes, I made some examples from cssplay menus.. here’s instructions how to setup that menu:

                1. Include the css what is attached to this post to your template (alternatively, you could create it as a chunk and use &cssTpl=`chunkname` parameter in Wayfinder call)

                2. Create wfParentRow chunk with the following content:
                <li><a [+wf.classes+] href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]<!--[if IE 7]><!--></a><!--<![endif]-->
                <table><tr><td>
                
                [+wf.wrapper+]
                
                </td></tr></table>
                <!--[if lte IE 6]></a><![endif]-->
                
                </li>


                3. Call wayfinder in your template using:
                <div class="menu">
                [!Wayfinder? &startId=`0` &level=`4` &parentRowTpl=`wfParentRow`!]
                </div>


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 33114
                  • 518 Posts
                  Dunno if its a bug but:
                  if I set up a &parentRowTpl=’example’ and call Wayfider with it and that ’example’ chunk is like that
                  <li>[+wf.linktext+]</li> 
                  - not a single child doc is processed!

                  [SOLVED] I figured out that [+wf.wrapper+] is actually required to output children - didnt know that smiley
                    http://modx.ru - российская поддержка MODx
                    http://newscup.ru - экспериментальный проект
                    http://yentsun.com - персональный сайт
                    • 7455
                    • 2,204 Posts
                    Thanks Doze for this clear explenation
                      follow me on twitter: @dimmy01
                      • 33114
                      • 518 Posts
                      I got category folders to work!

                      its very simple due to nice code of the snippet (Ryan and Kyle u rock!).
                      the trick is to add another user template for elements which template is 0 (blank), which are actually category folders.

                      in wayfinder.inc.php find:
                      $getFields = 'id,menutitle,pagetitle,menuindex,published,hidemenu,parent,isfolder,description,alias,longtitle';

                      change to
                      $getFields = 'id,menutitle,pagetitle,menuindex,published,hidemenu,parent,isfolder,description,alias,longtitle,template';


                      find
                        if ($resource['id'] == $modx->documentObject['id'] && $resource['isfolder'] && $this->templates['parentRowHereTpl'] && ($resource['level'] < $this->level || $this->level == 0)) {
                                  $usedTemplate = 'parentRowHereTpl';
                      		}

                      change to
                       if ($resource['id'] == $modx->documentObject['id'] && $resource['isfolder'] && $this->templates['parentRowHereTpl'] && ($resource['level'] < $this->level || $this->level == 0)) {
                                  $usedTemplate = 'parentRowHereTpl';
                      		} elseif ($resource['isfolder'] && $resource['template']=="0" && $this->templates['cat_parentRowTpl'] && ($resource['level'] < $this->level || $this->level == 0)) {
                                  $usedTemplate = 'cat_parentRowTpl';
                              }


                      in Wayfinder snippet code find:
                      $wf->templates['parentRowTpl'] = isset($parentRowTpl) ? $parentRowTpl : '';

                      change to
                      $wf->templates['parentRowTpl'] = isset($parentRowTpl) ? $parentRowTpl : '';
                      $wf->templates['cat_parentRowTpl'] = isset($cat_parentRowTpl) ? $cat_parentRowTpl : '';


                      now u just have to create a template and call it within Wayfinder like &cat_parentRowTpl=’...’ and ur categories will be processed according to the template!
                        http://modx.ru - российская поддержка MODx
                        http://newscup.ru - экспериментальный проект
                        http://yentsun.com - персональный сайт

                      This discussion is closed to further replies. Keep calm and carry on.