Problems with the page title

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
raymondo
Forum Members
Forum Members
Posts: 18
Joined: Sun Feb 11, 2007 10:23 pm

Problems with the page title

Post 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
Last edited by raymondo on Sun Mar 04, 2007 9:08 pm, edited 1 time in total.
User avatar
kermit
Power Poster
Power Poster
Posts: 693
Joined: Thu Jan 26, 2006 11:46 am

Re: Problems with the page title

Post 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.
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
raymondo
Forum Members
Forum Members
Posts: 18
Joined: Sun Feb 11, 2007 10:23 pm

Re: Problems with the page title

Post 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
User avatar
webform
Power Poster
Power Poster
Posts: 524
Joined: Sat Nov 25, 2006 3:39 pm

Re: Problems with the page title

Post 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.
Post Reply

Return to “CMSMS Core”