MonkeyCMS Forum

Go Back   MonkeyCMS Forum > MonkeyCMS > Content Discussion
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 11-23-2008, 04:43 PM
PhilippeMartin PhilippeMartin is offline
Senior Member
 
Join Date: Nov 2008
Posts: 117
Default Defining the title of index pages

Hi,

For content pages, the title tag in the html head (displayed in the window title, then) is made of the default title defined in the site settings, followed with the title of the story. Fine. However, I would have expected the title of index pages to be similarly made of the default title followed with the definition name, but it's not. Instead, only the default title is used (so all the index pages have the same title). I'm not sure if this is by design, or if it's a bug.

Assuming it's not a bug, is there a way to define or override some of the page's attributes from a page template? Maybe something like [#title:sometext] that would lead MonkeyCMS to set the page's title to "sometext" at rendering time, and therefore to use that when it replaces [page_title] in the Header template?

Cheers,

Philippe
Reply With Quote
  #2  
Old 11-25-2008, 08:07 AM
Colin Colin is offline
Administrator
 
Join Date: Apr 2007
Posts: 1,614
Default

Quote:
Originally Posted by PhilippeMartin View Post
Hi,

For content pages, the title tag in the html head (displayed in the window title, then) is made of the default title defined in the site settings, followed with the title of the story. Fine. However, I would have expected the title of index pages to be similarly made of the default title followed with the definition name, but it's not. Instead, only the default title is used (so all the index pages have the same title). I'm not sure if this is by design, or if it's a bug.

Assuming it's not a bug, is there a way to define or override some of the page's attributes from a page template? Maybe something like [#title:sometext] that would lead MonkeyCMS to set the page's title to "sometext" at rendering time, and therefore to use that when it replaces [page_title] in the Header template?

Cheers,

Philippe
At present it's a 'limitation' - but I'll see if there is a way I can implement your suggestion.
Reply With Quote
  #3  
Old 11-25-2008, 02:46 PM
PhilippeMartin PhilippeMartin is offline
Senior Member
 
Join Date: Nov 2008
Posts: 117
Default

Cool, thank you, Colin!

But before you look into implementing page directives (which would be great for various things), shouldn't the index name be used automatically, in this case?
Reply With Quote
  #4  
Old 11-26-2008, 03:42 PM
Colin Colin is offline
Administrator
 
Join Date: Apr 2007
Posts: 1,614
Default

Quote:
Originally Posted by PhilippeMartin View Post
Cool, thank you, Colin!

But before you look into implementing page directives (which would be great for various things), shouldn't the index name be used automatically, in this case?
This is likely to be a bit complicated. The issue is that pages are just templates and templates could be just building blocks. Likewise pages and templates could have multiple indexes so which would we pick.

My current thinking is we come up with a series of directives that override the default based on the page passed in. That should be workable so I'll see what I can do.
Reply With Quote
  #5  
Old 11-26-2008, 06:31 PM
PhilippeMartin PhilippeMartin is offline
Senior Member
 
Join Date: Nov 2008
Posts: 117
Default

Quote:
Originally Posted by Colin View Post
This is likely to be a bit complicated. The issue is that pages are just templates and templates could be just building blocks. Likewise pages and templates could have multiple indexes so which would we pick.
Ah yes, it didn't occur to me that one could call advancedindex several times from a single page page with a different index each time. Thanks for pointing that out.

Quote:
Originally Posted by Colin
My current thinking is we come up with a series of directives that override the default based on the page passed in. That should be workable so I'll see what I can do.
Excellent, thank you!
Reply With Quote
  #6  
Old 11-28-2008, 08:37 AM
Colin Colin is offline
Administrator
 
Join Date: Apr 2007
Posts: 1,614
Default

Quote:
Originally Posted by PhilippeMartin View Post
Ah yes, it didn't occur to me that one could call advancedindex several times from a single page page with a different index each time. Thanks for pointing that out.


Excellent, thank you!
This is now ready to go in 1.3.6...

There is a new panel in the Skin Manager called 'Page Directives'

You supply the page name, the directive name and the value - and they'll override the site-wide values where appropriate.

For example you could set up the following:

Page Name: Default
Directive Name: page_title
Directive Value: This is a page directive

When the 'Default' page is displayed through the index.php script, the page_title value is overridden with 'This is a page directive'.

This works within correctly within the Skin hierarchy
Reply With Quote
  #7  
Old 02-23-2010, 02:16 PM
harvey harvey is offline
Senior Member
 
Join Date: Jun 2008
Posts: 474
Default

Is there any way to override the page title for content pages?
Reply With Quote
  #8  
Old 02-23-2010, 05:50 PM
Colin Colin is offline
Administrator
 
Join Date: Apr 2007
Posts: 1,614
Default

Only using inline PHP in the header at present. I do it on some pages if you need some pointers.
Reply With Quote
  #9  
Old 02-24-2010, 07:40 AM
harvey harvey is offline
Senior Member
 
Join Date: Jun 2008
Posts: 474
Default

Hi Colin!

I'd be very interested in seeing what you've been doing with that please!
Reply With Quote
  #10  
Old 02-24-2010, 08:50 AM
Colin Colin is offline
Administrator
 
Join Date: Apr 2007
Posts: 1,614
Default

Quote:
Originally Posted by harvey View Post
Hi Colin!

I'd be very interested in seeing what you've been doing with that please!
I basically override the page_title variable based on the definition id coming in.

Code:
<title>
%% if ($content[content_id]) **  if ($content[definition_id] == 2 || $content[definition_id] == 24) ** $content[page_title] = 'The Music Fix - '.$content[title].': '.$content[index_title].' Album Review';** else if ($content[definition_id] == 4) ** $content[page_title] = 'The Music Fix - '.$content[title].' Live Review';** else if ($content[definition_id] == 1) ** $content[page_title] = 'The Music Fix News - '.$content[title];**** addToOutput($content[page_title]);%%
</title>
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 03:53 AM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© Poisonous Monkey