Page Title

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
seo-105
Posts: 23
Joined: Sun 18. Apr 2004, 00:07

Page Title

Post by seo-105 »

Is there any way to make the Page Title say something different than the menu listing? {PAGETITLE}

I think I have to create seperate page layouts for every page on my website so that I can customize each of the Page Titles.

Is there an easier way to do this?

Thanks in Advance
Pappnase

Re: Page Title

Post by Pappnase »

seo-105 wrote:Is there any way to make the Page Title say something different than the menu listing? {PAGETITLE}

I think I have to create seperate page layouts for every page on my website so that I can customize each of the Page Titles.

Is there an easier way to do this?

Thanks in Advance
hello

did you try it via css!?
seo-105
Posts: 23
Joined: Sun 18. Apr 2004, 00:07

Post by seo-105 »

That might work! Thanks Pap!
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

Don't mix page title, article title and structure level.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Hi Oliver

Post by jsw_nz »

I am a little confused why page title does not show up when accessing categories directly from menu:

Settings:
Layout: page title - set to blank (with the hope that category will propagate)
add to title: category(checked) article name (checked)

OK when viewing inidvidual articles themselves - category and article name show up in the <title> tags.

However....
when accessing the category directly from menu...showing article listing for that given category....the title is blank. The only way to get an appropriate page title for the category is to insert literal page title in layout for that page...requires 'multiple layouts' to send page title parameters. I must be missing something....no?

What would be ideal would be to minimize layouts, using them across categories.....adding 'acat_name' to page title by default.

jsw
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Post by jsw_nz »

I tested this on Pappnase's test site and the same problem occurs. apart from making separate layout entries, is there any other workaround?
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

use this if you want to get back the category name all the time and anywhere.

Code: Select all

{PHPVAR:$GLOBALS['content']['struct'][$GLOBALS['content']['cat_id']]['acat_name']}
Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Post by jsw_nz »

It is always great to get a reply from the master, but unfortuantely this apprentice is still unable to get the code properly implemented. Since the expression is enclosed in {curly braces}, I assume it is to be placed within wcms..as an expression to be evaluated. Unfortunately no luck in placing it either in (1) pagetitle field in backend layout or (2) as an expression for header in backend templates, as in.....


I am guessing I am not approaching it the right way....obviously you have something more sophisticated in mind. Forgive my being the simpleton. I have to believe there is a way to get page title for a categories displaying multiple articles.....It (TITLE) displays correctly for categories with a single article, but when there are multiple articles in a given category (TITLE) does not show up in title bar. This is what I have narrowed it down to so far.

cheers,
jsw
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

OK, now I have understand...

in "content.func.inc.php" change around line 185 to the following code:

Code: Select all

// generating the complete article
if($aktion[4]==1 && $aktion[1]) {
	include_once(PHPWCMS_ROOT."/include/inc_front/content.article.inc.php");
} else {
	if($pagelayout["layout_title_cat"] && $content['struct'][$content['cat_id']]['acat_name']) {
		if($content["pagetitle"]) $content["pagetitle"] .= " | ";
		$content["pagetitle"] .= $content['struct'][$content['cat_id']]['acat_name'];
	}
}
Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Post by jsw_nz »

Brilliant

thanks very much - jsw
Post Reply