extract the current menu item as a title?

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
User avatar
habi
Posts: 166
Joined: Sun 15. Feb 2004, 13:39
Location: Rutschwil, Switzerland
Contact:

extract the current menu item as a title?

Post by habi »

Is there already a replacement tag to extract the current menu item for using it as a page title?
User avatar
habi
Posts: 166
Joined: Sun 15. Feb 2004, 13:39
Location: Rutschwil, Switzerland
Contact:

Post by habi »

ok.
solved it because I need this feature:

Code: Select all

 // ------------------------------------------------------------- 

 // PAGETITLE replacement 
 if( ! (strpos($content["all"],'{PAGETITLE}')===false)) { 
	$content["all"] = str_replace('{PAGETITLE}', $content["struct"][$content["cat_id"]]["acat_name"], $content["all"]); 
 } 

// -------------------------------------------------------------
place this into content.func.inc.php if you want to use it. It just returns the current menuitem as a string.
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

cool :lol:
http://www.studmed.dk Portal for doctors and medical students in Denmark
Jan212
Posts: 859
Joined: Wed 28. Jan 2004, 21:38
Location: Solingen
Contact:

Post by Jan212 »

nice, haven't seen that before, could i place it at wcmsrockt?
Regards/ Grüsse/ Groetjes - JAN212
------------------------------------------------
null212 - Büro für Kommunikation und Design
------------------------------------------------
Lyrikfetzen des Tages
1. Ist der Quelltext auch valide fragt Herr Müller ganz perfide.
2. Wat is dat een lekker ding.
3. Wer Vision hat soll zum Arzt gehen.
------------------------------------------------
adam
Posts: 28
Joined: Thu 18. Mar 2004, 16:46
Location: Neuried, Germany

Post by adam »

Hello!

How can I edit the CSS of the {PAGETITLE}?


Adam
User avatar
Oliver Georgi
Site Admin
Posts: 9900
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

Bit enhanced - the if clause isn't neccessary because search would have run 1 times too much. And it is importamt to use html_specialchars().

Code: Select all

// ------------------------------------------------------------- 

 // PAGETITLE replacement 
$content["all"] = str_replace('{PAGETITLE}', 
     html_specialchars($content["struct"][$content["cat_id"]]["acat_name"]), 
     $content["all"]); 

// ------------------------------------------------------------- 

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

moved to "hacks & enhancements"
http://www.studmed.dk Portal for doctors and medical students in Denmark
argos
Posts: 135
Joined: Mon 15. Mar 2004, 20:02

Post by argos »

Can somebody please explain a bit more what this does? And where to put the code?
Regards,
Jurgen Nijhuis
http://www.argosmedia.nl
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

argos wrote:Can somebody please explain a bit more what this does? And where to put the code?
you can use this replacement tags {PAGETITLE} for getting the pagetitle :D
http://www.studmed.dk Portal for doctors and medical students in Denmark
adam
Posts: 28
Joined: Thu 18. Mar 2004, 16:46
Location: Neuried, Germany

Post by adam »

Hello!

I integrated this in my page but the "old" pagetitle is shown at its "old" place. So I have the pagetitle twice - the old one and the one who is generated by the {PAGETITLE} tag. How can I remove the old pagetitle?


Adam
adam
Posts: 28
Joined: Thu 18. Mar 2004, 16:46
Location: Neuried, Germany

Post by adam »

Could anybody help me?


Adam
adam
Posts: 28
Joined: Thu 18. Mar 2004, 16:46
Location: Neuried, Germany

Post by adam »

Hello!

If you only change the content.func.inc.php the "old" title still appears. You have to change the content.article.inc.php like that:

Code: Select all

			//Artikelüberschrift, Subheadline, Summary
			//$content["main"] .= ($row["article_title"] && !$row["article_notitle"]) ? 
			//							$template_default["article"]["title_before"].
			//							span_class(html_specialchars($row["article_title"]),$template_default["article"]["title_class"]).
			//							$template_default["article"]["title_after"]
			//							: "";
Set "//" at the beginning of lines 83 - 87



Now I helped myself :wink:

Adam
User avatar
Oliver Georgi
Site Admin
Posts: 9900
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

set the mark for hiding the pagetitle in article summary. Then there is no need to uncomment.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
adam
Posts: 28
Joined: Thu 18. Mar 2004, 16:46
Location: Neuried, Germany

Post by adam »

Where do I find this article summary?
User avatar
Oliver Georgi
Site Admin
Posts: 9900
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

in backend where you can edit article title - there is a mark you can set for hiding the article title.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Post Reply