Page 1 of 1

Problems with the page title

Posted: Sun Mar 04, 2007 9:02 pm
by raymondo
Hi

I have just started using CMSMS and I am quite impressed.  It seems much easier to set up than others that I have tried.

I have two questions though, both about the page title, ie the text that you enter in the Title: box of the Main tab of the Edit Content screen.

First of all this text does not seem to be printed when I use the {print} tag.  This means that you get a page printed without the main heading at the top.  Is it possible to make this title print?

Second there are some pages that I do not want the page title to be displayed on screen anyway.  Is there a way of achieving this?

I have read the documentation but can't find anything refering to these issues.  If it is there just point me in the right direction and I will go away :-)

Thanks,

Ray

Re: Problems with the page title

Posted: Sun Mar 04, 2007 9:57 pm
by kermit
raymondo wrote: I have two questions though, both about the page title, ie the text that you enter in the Title: box of the Main tab of the Edit Content screen.

First of all this text does not seem to be printed when I use the {print} tag.  This means that you get a page printed without the main heading at the top.  Is it possible to make this title print?

Second there are some pages that I do not want the page title to be displayed on screen anyway.  Is there a way of achieving this?
The "title" is inserted wherever the {title} tag appears in the template or content. I believe the default initial install puts the {title} in the template (right before the {content} tag), not in each individual page's content.

The {print} tag prints ONLY the content (i.e. what you edit when you edit a page, the contents of the {content} tag), and since the {title} tag isn't there (it's in the template).. it's not getting printed.

If you want {print} to include the {title}, you'll have to remove {title} (and surrounding tags, like {title}) from the template and insert it at the top of every page's content instead.

For the pages you don't want the title to appear, leave it out of those pages' content.


Alternatively, you can choose NOT to use the {print} tag and use a print media stylesheet instead (you would then use the browser's print command to print a page instead of a button or link in the page itself).

Assign a class to {title}:

{title}

where you want it printed, but not shown on the screen. then...

main (all media types or none specified) stylesheet would have:

.printonly {display:none;}

print media stylesheet would have:

.printonly {display:block;}

if you'd rather not have {title} in the page's content, you can leave it in the template... duplicate the template and remove {title} from the copy (or assign it the 'printonly' class) -- assigning the template copy you just made and edited to those pages that you do not want {title} to appear in at all.

Re: Problems with the page title

Posted: Tue Mar 06, 2007 3:48 pm
by raymondo
kermit wrote:
The "title" is inserted wherever the {title} tag appears in the template or content. I believe the default initial install puts the {title} in the template (right before the {content} tag), not in each individual page's content.
Yes you are right, I should have checked the templates more carefully.

Thanks for clearing that up, it all makes sense now.

Ray

Re: Problems with the page title

Posted: Thu Mar 15, 2007 1:05 pm
by webform
To print the page title, go to lib/content.functions.php line 402 and line 418 and insert

Code: Select all

<h2>{title}</h2><br />
before the

Code: Select all

{content}
tag.