Alternativer Text in der Navigation?

Hier bekommst Du deutschsprachigen Support. Keine Fehlermeldungen oder Erweiterungswünsche bitte!
Iller13
Posts: 291
Joined: Tue 23. Dec 2003, 15:18
Location: Stuttgart

Alternativer Text in der Navigation?

Post by Iller13 »

Guten Morgen,
so, heute bin ich sehr aktiv! :D
Gibt es eine Möglichkeit einen alternativen Text (alt"Home") den Menüpunkten in der Navigation zu geben?

Danke & Grüße & Merry X-mas
13
User avatar
Marceau
Posts: 201
Joined: Sun 23. Apr 2006, 01:52
Location: Leipzig, Germany
Contact:

Re: Alternativer Text in der Navigation?

Post by Marceau »

Ja die gibt es.
Musst du in der include/inc_front/front.func.inc.php machen...

So um die Zeile 2050 rum...
There are 10 types of people in the world: Those who understand binary and those who don't
Iller13
Posts: 291
Joined: Tue 23. Dec 2003, 15:18
Location: Stuttgart

Re: Alternativer Text in der Navigation?

Post by Iller13 »

Wow,
da bin ich leider total überfordert! Du hast nicht zufällig ein angepassten Teil?

Danke 13
User avatar
Marceau
Posts: 201
Joined: Sun 23. Apr 2006, 01:52
Location: Leipzig, Germany
Contact:

Re: Alternativer Text in der Navigation?

Post by Marceau »

Hatte mich getäuscht...
Also die Datei include/inc_front/front.func.inc.php stimmt.

Musst ungefähr in Zeile 629 folgendes in den a-tag einsetzen:

Code: Select all

title="'.$GLOBALS['content']['struct'][$act_cat_id]['acat_pagetitle'].'"
Dann gehst du im Backend in deine Menustrukturstruktur unter Home und gibst da deinen gewünschten "Seitentitel" ein...
Sollte dann funktionieren.

Grüße
There are 10 types of people in the world: Those who understand binary and those who don't
Iller13
Posts: 291
Joined: Tue 23. Dec 2003, 15:18
Location: Stuttgart

Re: Alternativer Text in der Navigation?

Post by Iller13 »

Hi,
leider finde ich die Stelle nicht, hier mal das Code-Snippet, da müsste es reinkommen, oder?

Code: Select all

//menu creating
function nav_table_simple_struct(&$struct, $act_cat_id, $link_to="index.php") {
	//returns a simple table based navigation menu of possible
	//structure levels based on current structure level
	$nav_table  = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" summary=\"\">\n<tr>\n";
	$nav_table .= "<td width=\"10\"><img src=\"img/leer.gif\" width=\"10\" height=\"1\" alt=\"\" /></td>\n";
	$nav_table .= '<td width="100%"'.(empty($struct[$act_cat_id]["acat_class"]) ? '' : ' class="'.$struct[$act_cat_id]["acat_class"].'"').'><strong>';
	$nav_table .= html_specialchars($struct[$act_cat_id]["acat_name"]);
	$nav_table .= "</strong></td>\n<tr>";
	foreach($struct as $key => $value) {

		if($key != $act_cat_id && _getStructureLevelDisplayStatus($key, $act_cat_id) ) {
			
			$nav_table .= "<tr>\n";
			$nav_table .= "<td width=\"10\"><img src=\"img/leer.gif\" width=\"10\" height=\"1\" alt=\"\" /></td>\n";
			$nav_table .= '<td width="100%"'.(empty($struct[$key]["acat_class"]) ? '' : ' class="'.$struct[$key]["acat_class"].'"').'>';

			if(!$struct[$key]["acat_redirect"]) {
				$nav_table .= '<a href="index.php?';
				if($struct[$key]["acat_alias"]) {
					$nav_table .= html_specialchars($struct[$key]["acat_alias"]);
				} else {
					$nav_table .= 'id='.$key; //',0,0,1,0,0';
				}
				$nav_table .= '">';
			} else {
				$redirect = get_redirect_link($struct[$key]["acat_redirect"], ' ', '');
				$nav_table .= '<a href="'.$redirect['link'].'"'.$redirect['target'].'>';
			}

			$nav_table .= html_specialchars($struct[$key]["acat_name"])."</a></td>\n<tr>";
		}
	}
	$nav_table .= '</table>';
	return $nav_table;
}
Danke Dir!
13
User avatar
Marceau
Posts: 201
Joined: Sun 23. Apr 2006, 01:52
Location: Leipzig, Germany
Contact:

Re: Alternativer Text in der Navigation?

Post by Marceau »

Okay das sollten wir vielleicht vorher klären, welche Art der Navi setzt du denn ein? :D
There are 10 types of people in the world: Those who understand binary and those who don't
Iller13
Posts: 291
Joined: Tue 23. Dec 2003, 15:18
Location: Stuttgart

Re: Alternativer Text in der Navigation?

Post by Iller13 »

Ah ok,
ich verwende die NAV_ROW gerade! (phpwcms 1.4.7. r411)

:D
User avatar
Marceau
Posts: 201
Joined: Sun 23. Apr 2006, 01:52
Location: Leipzig, Germany
Contact:

Re: Alternativer Text in der Navigation?

Post by Marceau »

Okay suche nach:

Code: Select all

if($show_home && $GLOBALS['content']['struct'][$act_cat_id]['acat_hidden'] != 1) {
		
		if($GLOBALS['content']["cat_id"] == $act_cat_id) {
			$before = $GLOBALS['template_default']["nav_row"]["link_before_active"];
			$after  = $GLOBALS['template_default']["nav_row"]["link_after_active"];
			$direct_before	= $GLOBALS['template_default']["nav_row"]["link_direct_before_active"];
			$direct_after	= $GLOBALS['template_default']["nav_row"]["link_direct_after_active"];
		} else {
			$before = $GLOBALS['template_default']["nav_row"]["link_before"];
			$after  = $GLOBALS['template_default']["nav_row"]["link_after"];
			$direct_before	= $GLOBALS['template_default']["nav_row"]["link_direct_before"];
			$direct_after	= $GLOBALS['template_default']["nav_row"]["link_direct_after"];
		}
		$nav .= $before;
In der nächsten Zeile sollte der A-Tag anfangen und fügst du dann folgdendes ein:

Code: Select all

title="'.$GLOBALS['content']['struct'][$act_cat_id]['acat_pagetitle'].'"
There are 10 types of people in the world: Those who understand binary and those who don't
User avatar
swisscheese
Posts: 138
Joined: Mon 19. Feb 2007, 16:37
Location: Solothurn, Schweiz

Re: Alternativer Text in der Navigation?

Post by swisscheese »

Nur mal so nebenbei: Wäre es eventuell nicht gescheiter, die ganze Funktion nav_level_row in ein eigenes Frontend-Render-Script zu kopieren, nach belieben abändern und dann mit einem eigenen RT aufzurufen? Da die Datei front.func.inc.php ja praktisch mit jedem zweiten Update ändert, bliebe das System updatefähig. Ein Core-Hack finde ich einfach unklug.

Gruss, Gerd
Iller13
Posts: 291
Joined: Tue 23. Dec 2003, 15:18
Location: Stuttgart

Re: Alternativer Text in der Navigation?

Post by Iller13 »

Ahoi,
ich kriegs net hin :(

Hier nomal der Code:

Code: Select all

}
		$nav .= $before;
		$nav .= '<a href="index.php?'; 
		$nav .= ($GLOBALS['content']['struct'][$act_cat_id]['acat_alias']) ? html_specialchars($GLOBALS['content']['struct'][$act_cat_id]['acat_alias']) : 'id='.$act_cat_id; //',0,0,1,0,0';
		$nav .= '">'.$direct_before;
		$nav .= html_specialchars($GLOBALS['content']['struct'][$act_cat_id]['acat_name']);
		$nav .= $direct_after.'</a>'.$after;
	}
Wie kommt da jetzt die Zeile rein?

Dankeschön!
13
User avatar
Marceau
Posts: 201
Joined: Sun 23. Apr 2006, 01:52
Location: Leipzig, Germany
Contact:

Re: Alternativer Text in der Navigation?

Post by Marceau »

Aaaaalso klar grundsätzlich hat Swisscheese recht, dennoch post ich mal die "schnelle" Lösung:
}
$nav .= $before;
$nav .= '<a href="index.php?';
$nav .= ($GLOBALS['content']['struct'][$act_cat_id]['acat_alias']) ? html_specialchars($GLOBALS['content']['struct'][$act_cat_id]['acat_alias']) : 'id='.$act_cat_id; //',0,0,1,0,0';
$nav .= 'title=" '.$GLOBALS['content']['struct'][$act_cat_id]['acat_pagetitle'].' " ';
$nav .= '">'.$direct_before;
$nav .= html_specialchars($GLOBALS['content']['struct'][$act_cat_id]['acat_name']);
$nav .= $direct_after.'</a>'.$after;
}
There are 10 types of people in the world: Those who understand binary and those who don't
User avatar
Oliver Georgi
Site Admin
Posts: 9889
Joined: Fri 3. Oct 2003, 22:22
Contact:

Re: Alternativer Text in der Navigation?

Post by Oliver Georgi »

es ist klug, vorher zu prüfen, ob PageTitle tatsächlich etwas enhält, sonst landet man schnell mal bei title=""
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Re: Alternativer Text in der Navigation?

Post by flip-flop »

RT NAV_ROW ausgelager nach ”/frontend_render/*” und erweitert um das “title” Atribut mit dem Inhalt aus “Seitentitel:” zu erzeugen.

-> NAV_ROWX

Knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
Iller13
Posts: 291
Joined: Tue 23. Dec 2003, 15:18
Location: Stuttgart

Re: Alternativer Text in der Navigation?

Post by Iller13 »

Hi Knut,
vielen Dank für deine Arbeit!
Navi läuft soweit, RT angepasst auf {NAV_ROWX:2:0}, im Admin-Menü bei Seitentitel "Test" eingetragen, aber leider wird nichts angezeigt beim drüberfahren mit der Maus?! Im Quelltext ist auch nichts zu finden?!?

Grüße
13
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Re: Alternativer Text in der Navigation?

Post by flip-flop »

Hi,

Update: 11.01.2011

Der Seitentitel wurde nur beim ersten "Current-Link" ausgegeben, jetzt sind alle Links berücksichtigt. (Hoffe ich).

Knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
Post Reply