Hi,
What I'd really like to have is a sort of "framework" function (using preg_replace or whatever) allowing to develop and use tags with parameters. Then a page could contain different instances of a tag that would produce different outputs based on tag parameters.
Syntax could look like {MYTAG:var1=int:var2=string: ... :n=zzz} - similar to typoscript's.
Say I'd like to have a "scattered" navigation menu:
{MENU:level=0:position=hor:style=1} would output
Horizontal 0 (root) level menu with predefined style #1
{MENU:level=1:position=hor:style=2} would output
Horizontal 1st level menu but different style (#2)
{MENU:level=2:position=vert:style=3} would output
Vertical 2nd level menu, again different style (#3)
I started doing it for my own purposes, wrote menus-producing functions but stopped at content.func.inc.php as I simply dont't have enough technical knowledge of how to parse and replace my tags with function using tags' parameters...
I think it would be a very useful feature.
Marius
Tags with parameters
Tags with parameters
Last edited by marses on Sat 8. Nov 2003, 20:22, edited 1 time in total.
The navigation is generated based on the site structure and the site structure naturally maps into lists. Lists are already widely used to create all sorts of navigations schemes and they can be easily styled and embedded pretty much everywhere.
How difficult would it be to generate alternative navigations schemes in phpwcms, similar to the alternative templates?
I did not look at the code to see how the current navigation is generated, but the end result on the page looks like a nested list (even though it is probably rendered using tables, not lists).
If the navigation code was generated as nested lists, then simply changing the CSS we would achieve different looks and types of navigations (vertical, horizontal, etc.) and we would not have to touch the phpwcms code. This would be a lot easier to style than a navigation scheme based on tables.
Plus, there is already a large collection of list-based schemes in many places, such as:
http://css.maxdesign.com.au/listamatic/index.htm
The navigation list template could be selected in the admin panel, similar to the page template, or it could be specified as a parameter like you are suggesting.
Any comments?
How difficult would it be to generate alternative navigations schemes in phpwcms, similar to the alternative templates?
I did not look at the code to see how the current navigation is generated, but the end result on the page looks like a nested list (even though it is probably rendered using tables, not lists).
If the navigation code was generated as nested lists, then simply changing the CSS we would achieve different looks and types of navigations (vertical, horizontal, etc.) and we would not have to touch the phpwcms code. This would be a lot easier to style than a navigation scheme based on tables.
Plus, there is already a large collection of list-based schemes in many places, such as:
http://css.maxdesign.com.au/listamatic/index.htm
The navigation list template could be selected in the admin panel, similar to the page template, or it could be specified as a parameter like you are suggesting.
Any comments?
I think this is a piece of code that I will use
And the idea of using nested list is good.
Marius
Code: Select all
$search[10] = '/\{SPACER:(\d+)x(\d+)\}/';
$replace[10] = '<img src="img/leer.gif" border="0" width="$1" height="$2">';
Marius
- Oliver Georgi
- Site Admin
- Posts: 9892
- Joined: Fri 3. Oct 2003, 22:22
- Contact:
That's what I want to build next: a replacement tag that return a <ul><li></li></ul> styled list based on site structure. It will include special id-attribute so that you can create #css_name to get CSS styled menues like this here http://www.alistapart.com/articles/taminglists/.
And I also want to develop some addintional menu functions that represents only the given structure level (as you described).
Oliver
And I also want to develop some addintional menu functions that represents only the given structure level (as you described).
Oliver
ALA just published this article on using PHP with list-based
menus; I thought it might be relevant to this discussion,
http://www.alistapart.com/articles/keepingcurrent/
menus; I thought it might be relevant to this discussion,
http://www.alistapart.com/articles/keepingcurrent/
- Oliver Georgi
- Site Admin
- Posts: 9892
- Joined: Fri 3. Oct 2003, 22:22
- Contact:
Not a problem, take your time; you've done a terrific job already and with the documentation.
In terms of the unlimited levels, it seems that, personally at least, I would not want to have a menu that goes beyond two or 3 levels, at most. I would organize the content so that the structure is not deeper than three levels anyway. Few sites, even link directories, seem to nest more than 3 levels deep.
The other thing is that menus with more than 3 levels are not vey appealing.
But you probably need the unlimited nestng for other things.
In terms of the unlimited levels, it seems that, personally at least, I would not want to have a menu that goes beyond two or 3 levels, at most. I would organize the content so that the structure is not deeper than three levels anyway. Few sites, even link directories, seem to nest more than 3 levels deep.
The other thing is that menus with more than 3 levels are not vey appealing.
But you probably need the unlimited nestng for other things.