[Written before I read the last message]
nesting
Quote from: kylej at Jul 17, 2006, 06:15 PMIt is a "glaring omission", I will get the code to nest correctly.
Glad my testing was useful.
defaults
Quote from: rthrash at Jul 17, 2006, 07:51 PM
perhaps (and my preference) we should just add a very basic and minimum set of templates hard coded so some output will result.
I absolutely agree with you and Susan - especially if this is the new "core" menu builder.
I’d be tempted to make startId=`0` the default, but I appreciate that there is a great timesaving in having it default to the current page, as it isn’t particularly obvious how else you’d pass that (without recursive parser).
But still, the ideally basic [[Wayfinder? &startID=`0`]] should output a sensible menu.
With that in mind, I must ask you to please please
please change the default &textOfLinks.
Currently it defaults to pagetitle! Really the default text for a MODx menu should be menutitle. Otherwise, what is the point of that field?
The &titleOfLinks is OK to stay as pagetitle - if you have the &titleOf different to the &textOf, the benefit of mouseover text is apparent. Of course, not everyone has different pagetitle/menutitle/longtitle text for their pages but actually it’s one of the things I like most about MODx.
Also, why are some booleans defaulting to 0, and some to false? I’d rather this was consistent. This is probably just a documentation issue, they’re probably the same, but I think that using "false" instead of 0 would make things clearer to people.
Passing code in the snippet
I’d like to be able to pass code in the snippet call itself, ie &innerTplCode=`<ul id="nav">[+wf.wrapper+]</ul>` but I appreciate that some characters would need escaping.
The skin/theme concept
xwisdom’s idea is to load in variables from another file. And moving the chunk html to the variable value is not unlike my suggestion above. If you added to the
core snippet execution functionality the ability to load in variables from another file, and every snippet that allowed chunks also allowed you to pass through HTML code directly, then you have a standard MODx "theme" function for every snippet. All you’d add would be
&loadSettings=`VerticalMenu`
and the snippet would have all the settings from the call and all the settings from the file.
You could also have Settings as another type of MODx database content, like Snippets and Chunks. If they are to be files, I think that all the settings would end up nestling in the same directory, as there may be benefits from using the exact same call on both a WayFinder snippet and a WayFinder2 snippet.
In terms of code re-use, this is greatly beneficial whenever largely the same menu appears on multiple templates, as it is not just about the templates but any setting.
With the recursive parser and some conditional code you could potentially be using variables to decide which Settings file to load - thus different menu output from the same page depending on who is logged in, and their preferred style, etc etc.
So I think that theme settings are better added to MODx rather than to this snippet, but being able to pass code in directly would make the theme setting file more viable.
[reads 3 newly added posts]
Quote from: kylej at Jul 18, 2006, 08:12 AM
Should we make it so that each theme would be in a folder under assets/snippets/wayfinder/themes/
Then each theme would have its own folder that way you could include images with your theme file and reference them.
Whichever way we do themes, I would rather reference
assets/images/snazzy/image2.jpg
than
assets/snippets/wayfinder/themes/snazzy/image2.jpg
not least because many "skin" backgrounds can be reused in different parts of a page and it is better to have them all reference the same image than to have
assets/snippets/wayfinder/themes/snazzy/image2.jpg
and
assets/snippets/ditto/themes/snazzy/image2.jpg
be the same image.
Similarly in terms of themes, I’d rather it went
themes/snazzy/wayfinder
themes/snazzy/ditto
so that people could plug in "MODx" themes which had elements for multiple functions rather than Wayfinder themes.