How to Display Your Page Title in Your Template - Joomla! 1.5

Written by Cory | June 05, 2008 | Add Comment (102)

In October 2006, I wrote a how-to for displaying your page title within your Joomla! 1.0 template. Since the release of Joomla! 1.5, I have gotten many requests for an article explaining how to do this in Joomla! 1.5. Here is how you do it...

Page Titles in Joomla! 1.5

If you've already worked with Joomla! 1.5, you know that page titles are handled differently than in version 1.0. In version 1.0, if you enabled dynamic page titles (see this article for an explanation), each page would have an html title of "Site Name - Page Title". For example, the HTML title of this page is "Cory Webb's How to Joomla! - How to Display Your Page Title in Your Template - Joomla! 1.5", where "Cory Webb's How To Joomla!" is the site name, and "How to Display Your Page Title in Your Template - Joomla! 1.5" is the page title.

In Joomla! 1.5, dynamic page titles are used by default, and the site name is not displayed in the html title. For example, if this site were running in Joomla! 1.5, you could look up in the browser's window header and see that the html title just said "How to Display Your Page Title in Your Template - Joomla! 1.5". That makes things a bit easier in terms of getting access to the page title, but it causes another problem; your site name is not part of the html title. There is an SEF Patch that enables you to modify the HTML title, but I will show you a trick for doing this in your template. Think of this as 2 how-to's in 1.

Accessing Your Page Title from Your Template

There are 2 objects in Joomla! 1.5 that are extremely powerful and extremely useful for doing some advanced tricks in your template. The first object is JFactory, which is basically the gateway for accessing just about anything in the Joomla! API, and the second is JDocument, which gives you access to your document's properties. Your document is usually defined as the HTML output from Joomla!, but it could also be a PDF, XML/RSS, or raw output/text. In this case, we are only concerned with the HTML output.

To access your page title, simply add the following code to the top of your template "index.php" file:

 
<?php
 
$mydoc =& JFactory::getDocument();
$mytitle = $mydoc->getTitle();
 
?>
 

That's it. That's all there is to it. Pretty simple, huh? Now, to display your page title within your template, you simply add the following code anywhere in your template "index.php" file that you wish to display the page title:

 
<?php echo $mytitle; ?>
 

That's all there is to it. Pretty easy.

Modifying Your HTML Title

The next thing we want to do is modify your html title. We will be using the JDocument object that we just accessed. Using this code, you can set the html title of your page:

 
$conf =& JFactory::getConfig();
$sitename = $conf->getValue('config.sitename');
 
$mydoc->setTitle($mytitle.' - '.$sitename);
 

Notice that I used JFactory again to get a copy of the Joomla! configuration, which I then used to get the value of the site name (config.sitename). Then, I used "$mydoc" from the earlier step to set the html title.

Note that this code sets the html title to "Page Title - Site Name". If you want to set it to "Site Name - Page Title", you need to change the setTitle parameter to "$sitename.' - '.$mytitle". In reality, you can set the html title to anything you want, but I personally think "Page Title - Site Name" makes the most sense.

Putting it All Together

Using the following code, you are simultaneously getting dynamic access to your page title and setting the value of your html title:

 
<?php
 
$mydoc =& JFactory::getDocument();
$mytitle = $mydoc->getTitle();
 
$conf =& JFactory::getConfig();
$sitename = $conf->getValue('config.sitename');
 
$mydoc->setTitle($mytitle.' - '.$sitename);
 
?>
 

Questions?

As always, please feel free to post any questions or comments you might have.

Trackback(0)

Comments (102)Add Comment

244
...
written by Jason Boyette, June 06, 2008
Thanks for this tip - I was just searching around on the forums for something like this. I can't wait to try it out.

One reason I will probably change the title to "Site Name - Page Title" is so that my pages sort together when people look at their browser history.
62
...
written by Cory, June 06, 2008
Hi Jason...good point. I hadn't thought of that. Thanks for commenting. smilies/smiley.gif
244
...
written by Jason Boyette, June 06, 2008
Well, it works great. Just added it to my site, and I've got two other sites to update too. Thanks again.
0
...
written by Conlippert, June 09, 2008
Thanks for this fix! I could hardly believe they omitted this in 1.5!
Thank you Thank you!
0
...
written by MeSir, June 09, 2008
i was looking for hours on the internet , until i found this... thank you ... this is great ... tanks for sharing ... respect...
0
...
written by paul, June 11, 2008
i had someone make my website, so i'm not sure what that index.php file is. i should have full access to everything, so it that something i can find?? please help, i really want to have page titles on my site!!
62
...
written by Cory, June 11, 2008
Hi Paul... The index.php file is located in your template's folder. Looking at the site you linked, your template folder is located at "templates/bristweb/" on your server.

Adding page titles in your template may not be necessary. This is just a nice trick for those that might need it. However, you might want to modify your site's html title. It really just depends on your own preference.
0
...
written by paul, June 11, 2008
wow, your response time is incredible smilies/smiley.gif

i'm slow though - where would the templates folder be? under one of the menus along the top (ie: site, menu, content, etc.)?

i know, i just think it's a nice subtle touch that's more professional looking.
62
...
written by Cory, June 11, 2008
Hi Paul, actually, I just looked at your site, and it looks like you are using Joomla 1.0. In that case, you should look at this tutorial, which is the same information geared toward Joomla 1.0.

You can edit your template index.php file in Site->Template Manager->Site Templates. Check the box next to your template, and click the "Edit HTML" button in the top right corner. Be careful, though. You could potentially do some major damage to your site.
0
...
written by paul, June 11, 2008
thanks for the advice.

i read that article too - problem is i don't have "template manager" or "global config" under my "site" menu bar. weird.......
62
...
written by Cory, June 11, 2008
It sounds like the person who developed your site did not give you "Super Administrator" access to the site. You may need to ask them to give you that access.
0
...
written by paul, June 11, 2008
haha, bummer. ok, thank you!!
0
...
written by X_Burner, June 20, 2008
Hi Cory !

Thanks for your work and this tutorial.
Ive integrated this:













...to my index.php but nothing happend !?!

It seems the title wont override by the new title.

How can I fix this?

Greetz

X_Burner
0
...
written by X_Burner, June 20, 2008










62
...
written by Cory, June 20, 2008
Hi X_Burner... try taking the php tags off and submitting your comment again.
0
...
written by X_Burner, June 20, 2008
http://screencast.com/t/sytNq5qiPZz

Thanks for your quick response!

X_Burner
62
...
written by Cory, June 20, 2008
Hi X_Burner... I'm not sure if it will make a difference, but try to move the php code above the "!DOCTYPE html" line. Let me know if that works for you.
0
...
written by X_Burner, June 20, 2008
Ive moved the php block up...but nothing changes smilies/sad.gif

BEfore Ive tested this:


And it works but so I got 2 titles smilies/sad.gif

Is there a other method to override the title ?

Greetz

X_Burner
62
...
written by Cory, June 20, 2008
This line:

jdoc:include type="head"


automatically includes the title, so you should not add your own title tags. I have no idea why this is not working for you.
0
...
written by frank, June 21, 2008
Exactly what I was looking for. Thanks!
0
...
written by Zainal Ariffin, June 23, 2008
This guide really works!! Thanks!! Good info.. smilies/grin.gif
0
...
written by Ardi, June 30, 2008
Hi Cory.
thanks for your codes. it works somehow for me. i use it on title in index.php file but it changes my language (right to left) and structure of template. i mean every menus and banners are moves to right . the last combined code works and change the title but there is 2 problems

1. it changes the structure of website
2. title will change like this " welcome to front page - Freedom Fighter"

god damn it i am tired of it. this welcome to front page is on my title and my front page. you can see it. please help me. what shall i do? by the way i add code in index file at the top of all lines but my front page editor move the code in the "body"

i have some chat box in my web site you can leave comment there for me or answer it here . it doesn't matter att all.

thank you too much
62
...
written by Cory, June 30, 2008
Hi Ardi,

I'm not sure why that would change the structure of your website. It should not affect the structure.

The "Welcome to the Front Page" text comes from the "Home" menu item. Go to your menu manager and select the main menu. Then, click on the "Home" menu item. Under the parameters, there should be an option to set the page title. Just set it to be blank.

Good luck!
0
...
written by Ardi, June 30, 2008
Cory thanks .. it was great help.......
at least i could find that damn name "welcome to front page" and change it. so now title changed and i demand you tell me please :

does it has effect in Google and the title also will change in google?
if it is, then shall i use the codes or no?

because my problem was in google that it showed my web title "welcome to front page"
62
...
written by Cory, June 30, 2008
The effect in Google will not be immediate because Google already has a cached version of your page with the title "Welcome to the front page". But, I still think it is worth it to go ahead and change it.
0
...
written by Ardi, June 30, 2008
so it is still changes my web structure. i tried all codes separate and has same effects. so i will wait for few days and if title wouldn't change then we will see what i have to do. just tell me which code is better for me to use?
do you have any codes that i use in my web site to show some media player for music? some good one with nice skins?

thank you too much that help me .. you are very nice... you made me happy and stop my headache smilies/grin.gif
62
...
written by Cory, June 30, 2008
I'm not sure what to tell you about the structure issues. I cannot imagine why this code would change the structure from rtl to ltr.

There are some good media player plugins at www.joomlaworks.gr.
0
...
written by Ardi, June 30, 2008
Holy god...
lol... i forgot something else ..please forgive me for my many questions.
do you know how shall i change the small logo of joomla on my address bar? some people has some personal logo or small photos on left side of web side address on address bar. this is my last question.
thanks for media
smilies/grin.gif
62
...
written by Cory, June 30, 2008
In your template file (/templates/rhuk_milkyway/), there is a file called "favicon.ico". Simply replace that file with your own favicon.ico file. You can create a favicon.ico file at favicon.cc.
0
...
written by Ardi, July 01, 2008
Hello again Cory

i made my favicon.ico and replace it with the old one . also i added a new code in my index file but still it doesn't work.
this is my code and tell me where shall i add it? also tell me if it is incorrect code.



thanks
62
...
written by Cory, July 01, 2008
Hi Ardi...It's working here. I see a new favicon. You might need to clear your browser cache and reload the page to see it.
0
...
written by Ardi, July 01, 2008
well i am trying to clear fire fox cache and i can not find it...!!! so it is still same for me. anyway.

about that website that you told me. i checked it and download something but when i wanna install it on website it shows the message "

* Warning! - Failed to change file permissions
* JFolder::create: Path not in open_basedir paths
* Unable to create destination

what is it ???? this is the first time i see this message.

i wanted to add some comment system ( to leave comment on articles in joomla) but i have no idea what is good. do you know some?
0
...
written by Amy Andrews, July 01, 2008
Thanks so much for this! It worked great!
0
...
written by Ardi, July 03, 2008
hello everybody. cory was busy and didn't answer me. does anybody know why when i wanna install some programs on website it shows the message "

* Warning! - Failed to change file permissions
* JFolder::create: Path not in open_basedir paths
* Unable to create destination

what is it ???? this is the first time i see this message.

and i wanted to add some comment system ( to leave comment on articles in joomla) but i have no idea what is good. do you know some? please someone help me smilies/wink.gif smilies/wink.gif smilies/smiley.gif
62
...
written by Cory, July 03, 2008
Hi Ardi,

I'm not sure what caused the warning you got. What were you trying to install?

I use JomComment on this site. You can get it at http://www.azrul.com. It isn't free, but it only costs around $30 USD.
0
...
written by Nilay, July 06, 2008
Thanks for the fix. Is there a way to remove 'Home' from the title. After the fix it says 'Home - site title'. Thanks.
0
...
written by Tim Sutherland, July 07, 2008
Thanks for this Cory. I'm new to Joomla and was getting annoyed by having to repeat the site name in the title field for each article. It makes sense now that I've done it and with some basic understanding of PHP and the Joomla API I guess the possibilities are endless when it comes to adding dynamic content to pages via the template.
0
...
written by Caleb Crosby, July 09, 2008
This is a great tutorial! Thank you so much!

I have a the Title Manager plugin installed so I am able to concatenate my site name into the page title. Naturally, using the document title in the template will now pull in my entire site name too. Is there a way to pull in just the current article title?

Thanks again! Your site is a tremendous resource!
0
...
written by Caleb Crosby, July 09, 2008
In thinking about it more, I'm wondering if you can show us how to access the menu titles too? This would add a ton of flexibility in how people use this technique to display a title in their template.

Again, thanks so much!!
0
...
written by Ardi, July 17, 2008
hi Cory

my problem didn't solve and still i have this error when install anything as follow :



* Warning! - Failed to change file permissions
* JFolder::create: Path not in open_basedir paths
* Unable to create destination

please tell me what i have to do... i am exhausted of joomla..also my admin server was crazy and installed my safe mode = off ...!!! how can i turn it on. i beg you find some solution for it.
0
...
written by Ardi, July 17, 2008
all my permissions are writeable and ok. but i do not know why it happen to me
62
...
written by Cory, July 17, 2008
Hi Ardi,

I'm so sorry to hear that is happening to you. I have no idea why that might be happening. The only thing I can think of is to make sure the directory permissions on your server are set to at least 7-5-7, but you say you've already done that.
0
...
written by Ardi, July 21, 2008
Hi cory

another thing is that how shall i change my FTP setting? because i put my web site url in FTP host and it doesn't work (has error) and when i add the name of my server FTP address ( D:WWWPESmyfatherlandiranc.....) it has eroor when i enabale FTP as follow:

JFTP::connect: Could not connect to host "D:WWWPESmyfatherlandirancwww m" on port 21

do you know how to do it? may be if i change this then i can install my components or plugins...
0
...
written by Jai, August 03, 2008
That was incredibly easy. I thought I'd have to go through a long winded process to solve the issue, until I found this. Thank you so much for your help!
0
...
written by Raven, August 07, 2008
Thanks for the call title tip. However, from a SEO standpoint, it is better NOT to call your site title as part of the page title. Your page will rank much higher without it, sometimes 10-20 slots higher!
0
...
written by cchun39, August 17, 2008
Great tip, thanks. Had a question, is it possible for it to show up:

sitename - category name - article title?
0
...
written by Volker, August 19, 2008
$this->getTitle() should do the trick also...
0
...
written by Paul, August 28, 2008
I found this extremely useful! THANKS!

I’m using this for meta tags and so far I’ve been able to use this technique for the following:

$mydoc =& JFactory::getDocument();
$description = $mydoc->getDescription();
$generator = $mydoc->getGenerator();
$keywords = $mydoc->getMetaData( 'keywords' );
$author = $mydoc->getMetaData( 'author' );
$mytitle = $mydoc->getTitle();
$conf =& JFactory::getConfig();
$sitename = $conf->getValue('config.sitename');

But I can’t get the “Modified Date” to work.

I’ve tried this:

$mdate = $mydoc->getModifiedDate();
(

But, it simply shows the current date and time.

I’d also like to be able to use the “Created Date” but have found no documentation on getting this at all.

Thanks

Paul
0
...
written by austin, September 07, 2008
I was wondering if there was a way to use your method but outputting the title minus the site name.

I do not need my site name on each page once more it is redundant.

thanks,

-austin
0
...
written by Daniele, September 07, 2008
Hi Cory......I wonder if I can get rid of the "welcome to the frontpage" from my site......(joomla 1.5 default template), I don't understand from where I can remove it.....the site title that I have set on the global configuration is different from that, however, when I right click on the live site, and check the source of my index.php it still show "welcome to the frontpage" as a site title.....

Thank you in advance
0
...
written by Daniele, September 07, 2008
Wow......I found it

The default page title in Joomla 1.5 is "Welcome to the Frontpage".
CHANGE CAN BE DONE FROM:
Joomla admin area > Menus > Main Menu > Home > Parameters - System > Page Title.

Type in the new page title you wish to use and save the change. Next time you open your website, the new page title will show up in your browser smilies/smiley.gif
0
...
written by Robert Stark, September 11, 2008
This is a great tutorial.

But I would like to modify it so it just shows which section I am in,
not the actual page title.

Eg "News" Not the title: "Taiwan has a new President"

Any ideas?
279
...
written by Tad Osborn, September 19, 2008
Could you please tell me how to get the Category for an article?
62
...
written by Cory, September 19, 2008
You could run an SQL query against jos_categories from your template, but I wouldn't advise that. I don't know if there is a simple way of doing this. Another option would be to just create a "custom HTML" module and type the category name directly.
279
...
written by Tad Osborn, September 19, 2008
Thanks Cory. I want to apply css based on the category of an article. Any suggestions?
62
...
written by Cory, September 19, 2008
The category id is usually passed in through the URL. You could use JRequest::getVar('catid', ''); to get the value of the category id.
0
...
written by Leo Woods, September 25, 2008
Hi Cory - Great resource very useful indeed - Thank you

This is just what I needed to know, now though I would like to display the category name and maybe the section name sometimes... How would I do these please??
Cheers
0
...
written by Dave, October 19, 2008
MAn, this is NUTS! - Why is it so hard to change the name of the title of pages? I would like the title to be the title of the news story.
0
...
written by b, November 03, 2008
Hi cory, thanks for the tips..
however I am having the same issues as X_burner...it's not working for me
neither in between or above the
0
...
written by b, November 03, 2008
sorry for the previous...doens't allow html tags in it.

I was saying that it's not working.
can it be because I'm using legacy mode?
unfortunately I can't turn it off to test it and make it work

thanks again in advance.
297
...
written by yness, December 10, 2008
Hi thanks for this tutorial it was exactly what I was looking for. I do have one question though, it is possible to set it so the home page will show "Site Name - Page Title" and then all the interior pages will show "Page Title - Sitename" ?

Thanks again.
62
...
written by Cory Webb, December 10, 2008
Hi yness.. yes that is possible. It would just take a bit of extra code on to determine which page you are on in the site. You could use JRequest::getVar('Itemid') to get the itemid of the current page, and then compare that against the itemid of the home page to determine if you are on the home page.
0
...
written by Gene, December 12, 2008
Hi Cory, I finally got it to work. Thanks. My question is similar to yness:...
i want the site title to go first and then the individual page title on every page. "Sitename - Page Title". I tried reversing the order of the code but it broke the site.

Thanks
0
...
written by CrispyPapaya, January 02, 2009
hmmm.. its for the template only... its too tiring... hahaha

is there a way to make it global???
62
...
written by Cory Webb, January 02, 2009
Hi CrispyPapaya, You could create a module that does the exact same thing. That would take the code out of the template.
0
...
written by Alex Tesler, January 05, 2009
wow...you don`t even can imagine how much this helped me !! Thx Thx and thx again !!
62
...
written by Cory Webb, January 05, 2009
You're welcome. I'm glad it helped! smilies/smiley.gif
0
...
written by Trav, January 06, 2009
Thanks for this Cory. I'm assuming it works a treat. But my problem is that once I edit the index.php file within the template folder of my website, no FTP programs allow me to ipload the modified PHP file - because I don't have permission...how do I modify the PHP file and then upload it to its location without encountering permissions errors?
0
...
written by Trav, January 06, 2009
disregard my last comment - figured it out in joomla CMS!

cheers!
302
...
written by Michael Price, January 16, 2009
Hi Cory,

You write very good explanations.

I am completely new to this type of work and followed your instructions which partially worked.

I bought a template from Rocket Theme (not sure if this was a good idea?) – Versatility 4

My home page is called PIV.

In the ‘tab’ it knows says ‘Welcome to FrontPage – PIV. I guess this website, homeapage.

I have not put in the line

as it keeps on making the site crash.

Do you have any ideas on how to help me – or even hardcode Panama Investment Vacations into the tab.

Many thanks,

Mike
0
add meta tags just for frontpage index.php
written by mi, January 19, 2009
hi,

I setup blank meta description in global settings and in frontpage now i have empty meta description.

I want to use this solution just to display meta description for frontpage, file index.php.

is it posible ?

marian
62
...
written by Cory, January 19, 2009
Hi mi,

Yes, it sounds like what you are trying to do should work.
0
How would you display the section name
written by Mike C, January 19, 2009
I'd like to second the vote for an example of how to display the section section name.
0
...
written by Manjusha, January 21, 2009
I was wondering how to incorporate dynamic pagetitles and this post gave me the solution. Thank you!

Now, I was able to set the pagetitles for all the pages except the homepage. Since all other pages have been generated thru php, I added the code snippet as suggested by you in every php file. But what do I do about the homepage? Its the default Joomla 1.5 frontpage/homepage and its title is: "Home". I want to change this to my site's name. How do I fix this?

Thanks!
62
...
written by Cory, January 21, 2009
Hi Manjusha,

Here's how you change the page title:

* Log in to yoursite.com/administrator
* Go to Menus->Main Menu (or whatever the menu is that contains your home page menu item)
* Open the home page menu item
* In the right column under "Parameters (System)" set the value of Page Title
* Click save

I hope that helps.
0
...
written by Manjusha, January 21, 2009
Wow! That was quick!

But changing the page title under Parameters (System) has caused the title to be displayed in the body of the home page. The title bar of the browser window still reads "Home" smilies/sad.gif
0
Display the section name
written by Mike C, January 28, 2009
I've finally found how to display the section name. Here's the link

http://forum.joomla.org/viewto...5#p1009495
0
Display section name
written by George, January 30, 2009
Thanks very helpful
0
How to put
written by Daniel, February 07, 2009
Hi,
How can I put my "Front Page Blog Layout" Page Title in "Home Page" title ? I have Menu Item Details Titke = Home, and for that Home page title become: "Sitename" - Home and i don't want this. I use this script:
$mydoc =& JFactory::getDocument();
$mytitle = $mydoc->getTitle();

$conf =& JFactory::getConfig();
$sitename = $conf->getValue('config.sitename');

$mydoc->setTitle($sitename.' - '.$mytitle);

Can you help me with this issue, I am looking for 2 weeks.

Thanks.
I need for my site: http://www.locatar.ro
0
Works Beautifully For My School Site!
written by Vernessa, February 11, 2009
Thanks a million, Cory! Although I'm fairly tech-literate, I don't do programming. Your cut-and-paste instructions were perfect. Just added it into my template after the "require" lines and before the "DOCTYPE" stuff, and it worked the first time out. Thanks for sharing.
0
Title doesnt change to the given title of the page
written by ST Verschoof, February 18, 2009
When I set the pagetitle of the login component, it just takes the title of the component, which is Log-in, in stead of the title I gave for login and logout in the menu item settings! Is there a way to fix this?
0
and for the homepage...
written by Chris M, March 21, 2009
...if your sitename and pagetitle happen to be the same, then you could replace the last line:
$mydoc->setTitle($mytitle.' - '.$sitename);
with:
if (trim($mytitle) == trim($sitename)) $mydoc->setTitle($sitename); else $mydoc->setTitle($mytitle.' - '.$sitename);

Just a thought for thoroughness sake.
0
I wrote above - Never Figured it Out
written by yness2, March 26, 2009
Hi - I wrote to you last Decemember about the possibility to set it so the home page will show "Site Name - Page Title" and then all the interior pages will show "Page Title - Sitename" and you said it could be done with JRequest::getVar('Itemid') . I'm going bonkers trying to figure out how to use that thing. I'm hoping you can direct me towards some information on how I could just exclude the main page from being affected by the change I made to the index.php to obtain the Title -Sitename thing. Then I could easily just set my homepage to be titled the exact way I want in the Sitename-Title format smilies/smiley.gif

Thanks!
0
Works--but I now have double site titles on opening page...
written by moldy, April 08, 2009
How can I get rid of the double site titles on the opening page? When I click Home, it shows SITE TITLE - Home (page title, this is fine), but when I first open the site it says SITE TITLE - SITE TITLE; same thing if I click the logo to go back to the Opening Page. Any ideas?
0
Great
written by Carl, April 09, 2009
We have a huge site we are testing migration to Joomla 1.5 on - and now there is one less thing to worry about.
Many thanks

Carl
www.barcelonayellow.com
0
Or you could just do this
written by Bill, April 19, 2009
Or you could just do this:

How do you remove or change the "Welcome to the Frontpage" title?
From Joomla! Documentation
Jump to: navigation, search

The setting for the Page Title is located in the parameters of each Menu Item under "Parameters (System)".

For Example to change the Page Title for the Home page of the Sample web site, you would navigate to Menus / Main Menu, click on "Home" to open the Menu Item:[Edit] screen. Then click on "Parameters (System)" to show the System Parameters, and either change the "Page Title" parameter or set "Show Page Title" to "No".
0
...
written by دردشة, May 04, 2009
We have a huge site we are testing migration to Joomla 1.5 on - and now there is one less thing to worry about.
Many thanks
0
Jfactory not found
written by ratheesh, May 15, 2009
i cannot connect my code to the database.
below is the code. i cannot find solution to this.the error is in the code i given the first line
$db =& JFactory::getDBO();

$query = 'SELECT * FROM jos_jportfolio_categories';
$db->setQuery( $query );
$rows = $db->loadObjectList();
echo $rows.'welcome';
62
...
written by Cory, May 15, 2009
Hi ratheesh... I don't see anything wrong with that code. Where are you trying to use it? Just a side note, it's not really a good idea to do database queries from your template.
0
this is great
written by fasih, June 04, 2009
This is really great Thanks
0
Amazing
written by Luis Franco, June 06, 2009
This is great. Thank You!
0
...
written by usmarine, June 17, 2009
My back end is 1.5 but I am running a 1.0 template with the legacy patch mostly because I could not find a 'simple' 1.5 template for a site without much content and only 5-9 pages. My question is... which fix do I use? The one for 1.5 of the one for 1.0? Thanks,
0
question
written by Szabi, July 19, 2009
Hi, thanks for this trick, now my question is this. Can I exclude my home page ? because the title in the home page, simply doubles.

Thank you,
Szabi Zs.
0
Thanks and a question
written by Ozzfest, September 16, 2009
Hello! Thank you for the tips! Everything works fine except for one thing. What I wanted to achieve was to set a static page title and that works fine, however the side effect is that the page title is also shown at the very top of my page. Does anyone know how to remove from there ? Thanks in advance.
0
Script will only show site title and not article title.
written by Ty, October 06, 2009
mega pain! I'm not really even interested in the site site, I just went through the entire process to see if it would appear.
im running joomla 1.5.14
I got no errors just the website title appear only..
1338
...
written by Rhonda Bartlett, December 06, 2009
Yea! It appears to be working now!

http://www.welcome2ky.com

Thanks so much!!!smilies/grin.gif
1395
Adding Keywords to title tag
written by Howard Just, December 24, 2009
Adding the sitename to the title worked great! Thank you very much.

How can I access the page keywords using JFactory and add the keywords to the end of the title tag?

Thanks again,
Howard
1395
Adding Keywords to title tag
written by Howard Just, December 24, 2009
I worked it out for myself:

$mydoc =& JFactory::getDocument();
$mytitle = $mydoc->getTitle();
$mykeywords = $mydoc->getMetaData( 'keywords' );
$conf =& JFactory::getConfig();
$sitename = $conf->getValue('config.sitename');
$mydoc->setTitle($mytitle.' - '.$sitename.' - '.$mykeywords);

I understand that many search engines place more importance on the title than the keywords metatag, so placing the keywords in the title may help my SEO.
Thanks again,
Howard
1407
same problem but opposite
written by mobile marketing, December 29, 2009
Hello! I'm getting the page title showing within the body content of every page of my website. How would I remove that?
1455
Can we get the previous page's title?
written by Oren, January 14, 2010
Hi, Great article!
Can you show how to get the previous page title ( refered page)?
when i link a page to a form I'd like to give the user the information of what was the page he's requesting information about.
1533
H1 Keywords H2 Article title
written by Chris Finnegan, February 04, 2010
Hi,
I used this tip as part of a SEO technique. Add a H1 tag at the top of the page for keywords, and a shorter H2 tag for the article title. The Browser title matches the H1 page title (using the title manager plugin), and the URL includes the article title with the joomla core SEF. The effect can be seen here at www.clickwebdesign.com.au.
1545
Tried everything: "Welcome to Frontpage" won't go away! Please assist.
written by joomloo, February 07, 2010
Hi,
I have system params set to "NO" for "show page title" and the "welcome to frontpage is STILL there" I've searched all over the internet - no luck! it just seems to be totally unresponsive. pls. help

Write comment

You must be logged in to post a comment. Please register if you do not have an account yet.

busy

Join the HowToJoomla Community!

  • Create a profile
  • Connect with other members
    of the community
  • All for FREE

Sign up now!

 

Already a member? Login here.

HowToJoomla is proudly hosted by Eleven2

 
 
 

Search the Joomla! Community for Resources

 
 

Latest Community Activity

Yesterday
Mustaq Seems like Spam PM's are spreading here too, like Kunena.com 03:43 PM
Enzo Fiorillo Palacio added My Articles application 02:40 PM
Enzo Fiorillo Palacio added Feeds application 02:40 PM
3 days ago
Marga van der Tol joined a group HowToJoomla! 06:38 PM
1 week ago
Gary Edmonstone and john birch are now friends Jan 28
 

Welcome to Our Newest Community Members

Jenny McWilliam
Harry
Caryl Forrest
Larry Levenson
rosemary
Gavriel Patlis
Jonathan
turgut
joomloo
wjr
Marga van der Tol
greg
 
 

Latest Comments

About HowToJoomla

Why am I getting this. Will admin please check the ...

How to Display Your

Hi, I have system params set to "NO" for "show pag ...

How to Fix Joomla C

Thanks for this posting. The introduction solves w ...

How to Display Your

Hi, I used this tip as part of a SEO technique. Ad ...

How to pick a Joomla

Hi, I just want to mention 3 problems I have with ...