New Replacementtags {NAV_TAB_LEVELS} {BREADCRUMB_LEVELS}

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
jon rain
Posts: 39
Joined: Wed 23. Nov 2005, 17:04
Location: wels, austria

New Replacementtags {NAV_TAB_LEVELS} {BREADCRUMB_LEVELS}

Post by jon rain »

Hallo, Hello

Ich bin ein Neuling (auch bei der Programmierung mit PHP).
I am a newbie (also by programming with php).

Als ich phpwcms testete musste ich feststellen, dass der Replacement NAV_TABLE_COLUMN bzw. der Ersatz von usta NAV_TAB_SETLEVEL nicht meinen Anforderungen entsprechen, da ich ein Table-Menü benötigte, dass die Farbe nach unten (weitere Ebene) hin immer heller macht. Einige Anleitungen dazu fanden sich, aber mit denen konnte ich nicht viel anfangen. Zusätzlich benötigte ich eine BREADCRUMB Version, die nur den Current anzeigen, bzw. erst bei der Menüebene 2 beginnen sollte.

At the tests with phpwcms i realize that the replacementtag NAV_TABLE_COLUMN and the replacementtag from usta NAV_TAB_SETLEVEL don't achieve to my requierments. Because i neded a table-menu in which the colour will be lighter in every level of the menu. Therefore i didn't find anything and what i've found i couldn't use.
In addition i needed a BREADCRUMB to show the current category of the menu or the levels of the menu beginning at the 2nd level.


Da ich nichts passendes fand, habe ich mich hingesetzt und den Code hierfür ein wenig analysiert und meinen Bedürfnissen entsprechend angepasst. Die Ergebnisse habe ich hier dargestellt.

So i began to analyse the code and programmed it myself. the result can you see as follows.




Um diese Replacementtags verwenden zu können musst Du
folgende Einträge in der :
../config/phpwcms/conf.inc.php
vornehmen:
$phpwcms["allow_ext_init"] = 1;
$phpwcms["allow_ext_render"] = 1;

und die Dateien in folgendes Verzeichnis kopieren:
../phpwcms_template/inc_script/frontend_render/

Der unterstrich muss dan gelöscht werden sonst wird das Skript nicht ausgeführt.


- for use of this you must set in ../config/phpwcms/conf.inc.php:
$phpwcms["allow_ext_init"] = 1;
$phpwcms["allow_ext_render"] = 1;
- copy the provided .php-file into
phpwcms_template/inc_script/frontend_render/


delete the underline, then it will work ->Now it's a zip. only to save in the right directory and to extract

http://www.regenfelder.net/downloads/NA ... LEVELS.zip
http://www.regenfelder.net/downloads/BR ... LEVELS.zip
http://www.regenfelder.net/downloads/classes.txt


Because of the lenght of the code you can download it now.
(see above)
Description in other topic.


Da der Code zu lange war, kann man diesen jetzt downloaden. (Adressen siehe oben)


Vergesst bitte nicht die Klassen zu definieren, Anbei einige Beispiele:
Don't forget to define the classes, here some examples.


Ich hoffe, dass neben mir auch noch jemand etwas damit anfangen kann.
I hope that anyone can use it too.

good luck
Jon Rain / Jochen Regenfelder

?Wo kann ich die Dateien zum downloaden hinlegen?
?Where can i save the files for download?
Last edited by jon rain on Mon 2. Jan 2006, 21:54, edited 11 times in total.
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Post by cyrano »

Hallo Jochen,

willkommen im Forum.

Gleich ein starker Einstieg - klasse.

Werde das testen und Feedback geben.

Sehr nützlich. Danke.
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
jon rain
Posts: 39
Joined: Wed 23. Nov 2005, 17:04
Location: wels, austria

Re: NEUE REPLACEMENTTAGS / NEW REPLACEMENTTAGS

Post by jon rain »

War ein Fehler, da ich nicht auf editieren gegangen bin.

was an error, because i didn't choose edit
Last edited by jon rain on Wed 23. Nov 2005, 23:13, edited 1 time in total.
jon rain
Posts: 39
Joined: Wed 23. Nov 2005, 17:04
Location: wels, austria

BREADCRUMB_LEVELS

Post by jon rain »

Hello, Hallo,


Sorry i thought it will be changed. I want to tell you that the description is in code.

Tut mir leid ich dachte ich würde das Original ändern.

Wollte eigentlich nur sagen, dass die Englishce Beschreibung im Code ist und hier die Deutsche kommt.

Werde hier aber doch beide hereinschreiben:

Both descriptions english an dgerman:



Um diese Replacementtags verwenden zu können musst Du
folgende Einträge in der :
../config/phpwcms/conf.inc.php
vornehmen:
$phpwcms["allow_ext_init"] = 1;
$phpwcms["allow_ext_render"] = 1;

und die Dateien in folgendes Verzeichnis kopieren:
../phpwcms_template/inc_script/frontend_render/

Der unterstrich muss dan gelöscht werden sonst wird das Skript nicht ausgeführt.


- for use of this you must set in ../config/phpwcms/conf.inc.php:
$phpwcms["allow_ext_init"] = 1;
$phpwcms["allow_ext_render"] = 1;
- copy the provided .php-file into
phpwcms_template/inc_script/frontend_render/


delete the underline, then it will work -> Now it's a zip!

http://www.regenfelder.net/downloads/NA ... LEVELS.zip
http://www.regenfelder.net/downloads/BR ... LEVELS.zip
http://www.regenfelder.net/downloads/classes.txt




BREADCRUMB_LEVELS
Version: 1.0
Replacementtag for BREADCRUMB_LEVELS

Dieser Replacement tag erlaubt es den Breadcrumb mit einer Startebene des Menüs aber auch mit einer End-Ebene des Menüs aufzurfuen.
Dadurch ist es möglich gezielte Menüebenen anzeigen zu lassen. das bedeutet aber auch, dass ich eine einzelne Ebene anzeigen, bzw. mit einer Menüebene starten kann. Hier ist es nicht notwendig den category-id auszulesen, man muss nur die gewünschte Ebene angeben.

Achtung: die Ebene null ist das Home-Menu, diese wird hier nicht mehr angezeigt.

Die Start-Ebene sollte kleiner sein als die End-Ebene, sonst wird die Starteben auf die erste Menüeben zurückgesetzt.

Wird beim Aufruf eines Menüs keine Kategorie in diese Eben gefunden, wird geprüft, ob eine Eben im gewünschten Bereich liegt und bei dieser begonnen.
Wird keine kategorie gefunden, so wird bei der ersten begonnen. In diesem Fall kann jedoch die Anzeige verhindert werden.


Die Datei (bei mir heißt sie wie der Reptag mit Endung php) muss in das Verzeichnis
phpwcms_template/inc_script/frontend_render/

kopiert werden.

zusätzlich muss in der Datei
../config/phpwcms/conf.inc.php
folgender Eintrag erfolgen (sollte er noch nicht drinnen sein):
$phpwcms["allow_ext_init"] = 1;
$phpwcms["allow_ext_render"] = 1;


{BREADCRUMB_LEVELS:0:0:0:} = {BREADCRUMB} ohne home
Alle Ebenen werden angezeigt.



{BREADCRUMB_LEVELS:1:1:0:>>}
Nur die erste Eben wird angezeigt (direkt unter home)

· :1 start ebene
· :1 end ebene
· :0 mit diesem Wert kann das menü versteckt werden, wenn keine entsprechende Kategorie gefunden wird (1=hide)
· :>> Der Begrenzer zwischen den Ebenen kann hier gesetzt werden (standard = >, einfach nur doppelpunkt setzen)





BREADCRUMB_LEVELS
Version: 1.0
Replacementtag for BREADCRUMB_LEVELS
This Replacementtag allows you to show an breadcrumb with setting the start-level
and the end-level of the category-structure. So it is possible to show only on
level or the sub's beginning with the choosen level. Level is the real level of
the structure not the category-ID.

Home will not be shown!

The Start-level has to be lower than or equal to the End-Level otherwise the
Startlevel will be the first level (main below home)

If there is no such level in the end-level so, the next possible level will be
shown. If there is no level found, so you can decide if the whole breadcrumb
will be shown otherwise it can be hided.

- for use of this you must set in ../config/phpwcms/conf.inc.php:
$phpwcms["allow_ext_init"] = 1;
$phpwcms["allow_ext_render"] = 1;
- copy the provided .php-file into
phpwcms_template/inc_script/frontend_render/

{BREADCRUMB_LEVELS:0:0:0:} = {BREADCRUMB_LEVELS} without home
All levels till the active will be shown


{BREADCRUMB_LEVELS:1:1:0:>>}
Only the first level (main below home) will be shown

· :1 start level for display
· :1 end level for display
· :0 hide breadcrumb if there is no level to show
· :>> the delimiter between breadcrumb-levels

{BREADCRUMB_LEVELS:2:4:0:>>}
All levels between level 2 and level 4 will be shown

ad1) All levels beginning with this level to the 4th level will be shown
ad2) This is the end level for show, if you use 0 then all levels beginning
with the start level will be shown
ad3) if you choose 0, then all levels will be shown, if you use 1 then the
breadcrumb will not be on display
ad4) the delimiter between the breadcrumb-levels can be set if there is nothing
the delimiter will be '>'


*************************************************************************************


Ich hoffe das hilft jenen, die Englisch nicht so gut verstehen.

May be it can be better read here.


have fun jon rain
Last edited by jon rain on Mon 2. Jan 2006, 21:33, edited 6 times in total.
jon rain
Posts: 39
Joined: Wed 23. Nov 2005, 17:04
Location: wels, austria

NAV_TAB_LEVELS

Post by jon rain »

Hallo,


Description of NAV_TAB_LEVELS (follows after the german)
Beschreibung für NAV_TAB_LEVELS



Um diese Replacementtags verwenden zu können musst Du
folgende Einträge in der :
../config/phpwcms/conf.inc.php
vornehmen:
$phpwcms["allow_ext_init"] = 1;
$phpwcms["allow_ext_render"] = 1;

und die Dateien in folgendes Verzeichnis kopieren:
../phpwcms_template/inc_script/frontend_render/

Der unterstrich muss dan gelöscht werden sonst wird das Skript nicht ausgeführt.


- for use of this you must set in ../config/phpwcms/conf.inc.php:
$phpwcms["allow_ext_init"] = 1;
$phpwcms["allow_ext_render"] = 1;
- copy the provided .php-file into
phpwcms_template/inc_script/frontend_render/


delete the underline, then it will work

http://www.regenfelder.net/downloads/NAV_TAB_LEVELS.php_
http://www.regenfelder.net/downloads/BR ... LEVELS.php_
http://www.regenfelder.net/downloads/classes.txt



Dieser Replacementtag erlaubt es eine Startebene für das Table-menü anzugeben, wobe hierbei die Ebene der Kategorie und nicht der Kategorie-ID gemeint ist. Die Ebene 0 ist home. Die Ebene eins stellen alle Untermenüebenen von Home dar.

Home selber wird nicht mehr angezeigt, daher ist die Angabe von Ebene 0 gleich der Angeb von Ebene 1.

Zusätzlich kann hier, wenn keine entsprechende Menü eben gefudnen wird, das gesamte Menü für den ausgeählten punkt angezeigt, oder dieses Menü ausgeblendet werden.

Nun ist es auch möglich für jede Ebene eine eigene Klasse anzugeben, die in der Datei
frontend.css (im Verzeichnis \phpwcms_template\inc_css\)
anzugeben sind.
Diese Klassen heißen Standardmäßig levelClass1 oder levelClass2,.. und für die Aktiven levelClass1_active, levelClass2_active,..

Hierbei wiederum ist es möglich beim Aufruf ein Präfix zu setzen, wodurch es ermöglicht wird unterschiedliche klassen für unterschiedliche Layouts zu benutzen.


{NAV_TAB_LEVELS:1:1:0:}

· :1 Startebene für Anzeige (>= 0, 0=1)
· :1 verstecke das Menü wenn keine entsprechende Kategorie gefudnen wird (1: yes, 0:no)
· :0 verwende unterschiedlcihe klassen für jede Menüebene (1: yes, 0:no)
· : Wenn eingegebn: Präfix für klassen damit für jedes Layout (Aufruf des Reptags) eine eigene Klassengruppe verwendet werden kann.

{NAV_TAB_LEVELS:1:1:0:jr_} = {NAV_TAB_LEVELS}


{NAV_TAB_LEVELS:2:1:1:jr_}

Es wird bei der Menüebene 2 begonnen, wenn kein untermenü gefudnen wurde, dann verstecke das Menü, benutze für jede Ebene eigene Klassen und setze dabei das Präfix.



Werden keine Eigenen Klassen verwendet, dann werden die Standardeingaben aus der Datei
\config\phpwcms\conf.template_default.inc.php
verwendet.

$template_default["nav_table_struct"]["row_norm_bgcolor"]
$template_default["nav_table_struct"]["row_norm_class"]
$template_default["nav_table_struct"]["row_active_bgcolor"]
$template_default["nav_table_struct"]["row_active_class"]
$template_default["nav_table_struct"]["cell_class"]
$template_default["nav_table_struct"]["cell_active_class"]



Achtung: Klassen Defineiren nicht vergessen!




NAV_TAB_LEVELS
Version: 1.0
Replacementtag for NAV_TAB_LEVELS
This Replacementtag allows you to use an css-class for every Level of your menu
the classes have the name 'levelClass' and the number of the level (levelClass1,
levelClass2,..), for the active levels the name wil be 'levelClass##_active' and
the number of the level (levelClass1_active,levelClass2_active,...), You will also
be able to set a prefix to the class by call the 'reptag', so it is possible to
make different classes for different layouts.

Level is the real level of the structure not the category-ID.

It based on the NAV_TAB_SETLEVELS from usta, so you it is possible to start with
an level and hide the menu if there is no menu with such level. Notice there is
a little difference: here the Level beginns at the main-level without home,
level = 1 for the sublevels of Home. The menus with the level you have chosen will
allways be on display regardless if it is active or not.
if there is no submenu the whole menu will be shown. ther is an switch to
hide the menus if ther is no submenu.
Menu home (root-menu) is level 0
Main-Menus (direct submenus of home) have the level 1
First submenus have the level 2

Level 0 and Level 1 have the same display because Home will not be shown


- for use of this you must set in ../config/phpwcms/conf.inc.php:
$phpwcms["allow_ext_init"] = 1;
$phpwcms["allow_ext_render"] = 1;
- copy the provided .php-file into
phpwcms_template/inc_script/frontend_render/


{NAV_TAB_LEVELS:0:0:0:} is equal to {NAV_TABLE_COLUMN}


{NAV_TAB_LEVELS:1:1:0:}
the classes have the name 'levelClass' and the number of the level (levelClass1,
levelClass2,..), for the active levels the name wil be 'levelClass##_active' and
the number of the level (levelClass1_active,levelClass2_active,...)


{NAV_TAB_LEVELS:1:1:0:jr_}={NAV_TAB_LEVELS}

{NAV_TAB_LEVELS:2:1:1:jr_}
the classes have the name 'jr_levelClass' and the number of the level (jr_levelClass1,
jr_levelClass2,..), for the active levels the name wil be 'jr_levelClass##_active' and
the number of the level (jr_levelClass1_active,jr_levelClass2_active,...)

· :1 set wich level to display (>= 0, 0=1)
· :1 hide the Menu if there is no submenu in the choosen level (1: yes, 0:no)
· :1 using different class for levels (1: yes, 0:no)
· :jr_ using different class for NAV_TAB_LEVELS call (any character)

ad1) All levels beginning with this level will be shown
ad2) the selected Level will be hided
ad3) if you choose 0, then the standardclass will be used. This standardclass
is defined in
\config\phpwcms\conf.template_default.inc.php
at the section // navigation table defaults
$template_default["nav_table_struct"]["row_norm_bgcolor"]
$template_default["nav_table_struct"]["row_norm_class"]
$template_default["nav_table_struct"]["row_active_bgcolor"]
$template_default["nav_table_struct"]["row_active_class"]
$template_default["nav_table_struct"]["cell_class"]
$template_default["nav_table_struct"]["cell_active_class"]

!!!!! Notice: You have to set the classes in
\phpwcms_template\inc_css\frontend.css

ad4) standard is jr but you cann use any character. jr will be replaced with
this character. So it is possible to use different classes vor different
layouts.

*************************************************************************************




have fun jon rain
Last edited by jon rain on Fri 25. Nov 2005, 15:18, edited 2 times in total.
jon rain
Posts: 39
Joined: Wed 23. Nov 2005, 17:04
Location: wels, austria

Post by jon rain »

Vielleicht noch was für ander Programmierer.

Something for other developer.


Das ARAY LEVEL_ID_JR enthält neben den Ebenen der gesamten Menüstruktur nicht nur die Übergeordnete Struktur, sondern auch die Anzahl der direkten Untermenüs, wodurch man leicht überprüfen kann, ob es ein Untermenü gibt. Und den gesamten Baum vom home zu dieser Kategorie. Die einzelnen KAtegorien sind dabei vorne und hinten mit einem komma getrennt, um sie mittels einer stristr-Funktion auslesen zu können.
Natürlich darf der Name der Kategorie auch nicht fehlen.

ARRAY=LEVEL_ID_JR, KEY=acat_id, Subarray: acat_id, acat_struct, acat_name, acat_level; acat_sublevels; acat_leveltree

der Key stellt den Kategory-Id dar, welcher sicherheitshalber noch einmal gespeichert wird, da es bei Umsortierungen zu fehler beim Key kommen kann.
acat_struct ist die Id des übergordneten Menüpunktes
acat_Level ist die Menüeben dieser Kategory
acat_sublevels ist die Anzahl der direkten Untermenüs
acat_leveltree ist der Baum zur Kategorie



the Array LEVEL_ID_JR includes not only the level of the categorie, it also includes the count of the dirct submenues, so it is able to check if there are submenues. Additional it includes the leveltree. Therefor the categories are delimited with commas, so it can be searched with the stristr-function. the result is the check if this categorie ist in this leveltree.


ARRAY=LEVEL_ID_JR, KEY=acat_id, Subarray: acat_id, acat_struct, acat_name, acat_level; acat_sublevels; acat_leveltree


// acat_level is the menu-level of the category
//acat_sublevels is the count of the sublevels of this category
// acat_leveltree includes the whole levels till home. the first ','' is an help. because by searching a acat_id or an acat_struct you have to search for "','.acat_id.','"


maybe it can help
Vielleichts hilfts jemand

lg jon rain
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

moved to hack and enhancements
http://www.studmed.dk Portal for doctors and medical students in Denmark
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

Will you please stop capital posts?

updated: sorry this was very bad english - it was writen in a hurry :D
Last edited by frold on Sat 26. Nov 2005, 07:14, edited 2 times in total.
http://www.studmed.dk Portal for doctors and medical students in Denmark
jon rain
Posts: 39
Joined: Wed 23. Nov 2005, 17:04
Location: wels, austria

Post by jon rain »

Sorry it was the first time i had posted something.

Next time i will do it better, but without description no one can use it.
frold wrote:Will you please stop capital posts?
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Post by flip-flop »

Hi jon rain, :)

frold meint nicht die Größe Deiner Posts, sondern die Großschrift in der Überschrift. So etwas wird als sehr laut und wichtig interpretiert. (Forentetikette).

frold schrieb:
What the hell are "capital posts" Question

That is when you only use capital letters in subject line - I can see that you have changed it...

There is no reason to speak loud in this forum (=using cap ...
Ist schon ok, Du kannst es ja noch ändern.

Gruß Knut :wink:
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

I have updated my post :D

And fli-flop - thanks for translation my ugly english into something that ppl understand
http://www.studmed.dk Portal for doctors and medical students in Denmark
jon rain
Posts: 39
Joined: Wed 23. Nov 2005, 17:04
Location: wels, austria

Post by jon rain »

Danke für die Erklärung.
Thanks for explanation

Wie gesagt habe leider noch nie irgendwo etwas geschrieben.

I am a newbie and this is the first i wrote to a forum at all.
ptjones
Posts: 29
Joined: Thu 3. Jun 2004, 16:03
Location: vienna

SUPER

Post by ptjones »

wäre für horizontale NAVIGATION auch Weltklasse

Liebe Grüße
jon rain
Posts: 39
Joined: Wed 23. Nov 2005, 17:04
Location: wels, austria

Re: SUPER

Post by jon rain »

Hallo,

Werde das in den nächsten Wochen ansehen.

I will try to program it in the next weeks. (limit horizontal levels by NAV_ROW)
ptjones wrote:wäre für horizontale NAVIGATION auch Weltklasse

Liebe Grüße
Last edited by jon rain on Mon 2. Jan 2006, 22:14, edited 1 time in total.
User avatar
Kosse
Posts: 1066
Joined: Thu 9. Sep 2004, 12:08
Location: Brussels, Belgium
Contact:

Post by Kosse »

nice dynamic menu RT jon rain!

Thx for sharing
Danke ;)

Cheers
Post Reply