We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32963
    • 1,732 Posts
    @Ryan,

    Pauls suggestion is perfect from a resource sharing stand point. Everyone would know where to go to modify or install a new theme. Let’s say the default wayfinder theme was located in the folder assets/themes/wayfinder/default another snippet could use or install portions of this theme without requiring the user to install the wayfinder snippet.
      xWisdom
      www.xwisdomhtml.com
      The fear of the Lord is the beginning of wisdom:
      MODx Co-Founder - Create and do more with less.
      • 25663 MODX Staff
      • 12,272 Posts
      ok... I’ll buy that... was thinking that it would require splitting the upload... on second read it does not!
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 25663 MODX Staff
        • 12,272 Posts
        Quote from: xwisdom at Jul 18, 2006, 08:53 AM

        Quote from: kylej at Jul 18, 2006, 08:36 AM

        Anyone have any ideas on what the file format might look like? maybe something like this:

        &parameter:’ ’;
        &parameter:’ ’;
        etc...

        I would rather we use the same format when passing parameters to a snippet.

        Why not just have it assign variable values so that there is no extra overhead of parsing parameters?
        $parameter="blah";
        $param2="blahedy blah blah";
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 22815
          • 1,097 Posts
          Quote from: rthrash at Jul 18, 2006, 10:31 AM

          Why not just have it assign variable values so that there is no extra overhead of parsing parameters?
          $parameter="blah";
          $param2="blahedy blah blah";

          OMG, that’s really neat and really clever. That way... it’s basically just an include! Possibly we could allow PHP in the theme, so the theme itself could do wacky things like check to see if it’s nighttime??

          Anyway, themes should NOT use the pass-parameters format, because you need to be passing HTML into the variables. That’s far easier with the $variable = ""; format. A number of snippets already require people to set things in the $ format within the snippet, so it is not another format to worry about - there were always two.

          The only issue with that is *when* this happens. I’d prefer:
            • Load In Variable Values From Theme File
            • Parse Parameters From Snippet Call
            • Execute Snippet
          so that the parameters in the call could over-ride the theme if necessary.

          I’d love to see this as a generic MODx ability available to all snippets.

          Any snippet that uses chunks would need an extra $innerTplCode variable, and a simple test to see if there’s anything in that before trying the chunk variable, along the lines of:
          if ($innerTplCode == "") {
          $innerTplCode = GetCodeFromChunk($innerTpl);
          }

            No, I don't know what OpenGeek's saying half the time either.
            MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
            Forum: Where to post threads about add-ons | Forum Rules
            Like MODx? donate (and/or share your resources)
            Like me? See my Amazon wishlist
            MODx "Most Promising CMS" - so appropriate!
            • 7923
            • 4,213 Posts
            Quote from: doze at Jul 18, 2006, 06:00 AM

            Quote from: rthrash at Jul 17, 2006, 08:06 PM

            And here’s a quick tutorial for the testers. The following is how you would convert the popular Mollio Menu template menus with Wayfinder. I think you’ll see how much easier it will be to create dynamic, nested menus compared to DropMenu. This is totally untested, but it should work...
            Nice, I’ll definitely try this today after I get from work and report the results. Yea, I had to do a bit of hacks to the existing DropMenu to get it work in Mollio.. the side menu needed activeTreeMenuOnly hack and I also did some other changes, what I can’t remember..

            I tried it, and it will work after the nesting issues are fixed in WayFinder, currently it isn’t working.. The secondary mollio menu can be also done easily by using this kind of snippet call:

            [!Wayfinder? &startId=`[[UltimateParent]]` &level=`5` &outerTpl=`wfOuter` &innerTpl=`wfInner` &rowTpl=`wfRow` &hereClass=`active` &firstClass=`first` &lastClass=`last` &hideSubMenus=`1`!]


            Changed &startId to come from UltimateParent snippet, added &hideSubMenus=`1`, increased level parameter value and chaged the wfOuter id to nav-secondary.

            I’ll test if WayFinder will strech even to these menus..


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 15987
              • 786 Posts
              I have fixed the nesting issues and will get an updated version posted later tonight. There are still a few tweaks I need to make before releasing the updated version.
                • 7923
                • 4,213 Posts
                Can I somehow template the items which have sub items? I want for example "submenu" css class for every link-tag that has sub items..


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 25663 MODX Staff
                  • 12,272 Posts
                  Hi doze... I knew there was something we were missing!

                  Starting around line 150 of the wayfinder.inc.php we need to insert that case. We’ll need to add the option to specify a "parent" row template, add a "parent" class to the list of classes. Not really a massive addition.

                  Here’s a .zip of the latest SVN commit from Kyle.
                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • 32241
                    • 1,495 Posts
                    It’s a nice idea to have this as a substitue of DropMenu. Maybe we need to test the speed of this. Having a caching mechanism built in will be great, what do you guys think?

                    PS: What do you guys think on my docAPI library? There is a half-static function that can be use, could you guys double check whether I implement it right or not? If it’s, I would love this library to be used widely by most of our snippets, and all we need is just keep improving this library, and it will affect all the snippets that use the same library. I’m open to any suggestion.

                    Sincerely,
                      Wendy Novianto
                      [font=Verdana]PT DJAMOER Technology Media
                      [font=Verdana]Xituz Media
                      • 25663 MODX Staff
                      • 12,272 Posts
                      With the upcoming changes to the parser and API, I’d hate to see a lot of work go into a new library that might not work so well. As soon as this starts working fully/right, we can make it work faster! Caching is going to be an area indeed, as well as possibly taking advantage of some new functions available in the 0.9.5 API.
                        Ryan Thrash, MODX Co-Founder
                        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me