Support Forum

Please note that this forum is only available to you in read only mode. In order to contribute to this conversation you will need to renew your subscription.

Need to edit the Dynamic Site Title

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

By default in Joomla the title of the page is set to the title of the item/document. But that is poor form. I want it to be Site Name - Page Title.

With other templates I've been able to edit the index.php file as described here on docs.joomla.org, docs.joomla.org/Customize_the_dynamic_page_title

However this trick causes catastrophic failure with my Joomla Bamboo RASA template.

So, what is the best practice with Joomla Bamboo templates? On each page I want the page title to be Site Name - Document Title.
  • geoffmack's Avatar
  • geoffmack
  • 6 Month Developer
  • 8 posts
  • Karma: 0
The administrator has disabled public write access.
Geoff,

What JB template are you attempting to add this code to? If it is one that uses the 'zengridframework', the code you linked to needs to be applied in this specific index.php file (right after the <head> tag. I added this to the 'zengridframework' index.php file of Newstream, Rase and Insideout without a problem.

Ed
  • Ed's Avatar
  • Ed
  • LIfetime Developer - Big Bamboo
  • 1693 posts
  • 45 Thanks
  • Karma: 60
The administrator has disabled public write access.
I was trying to add it to the index.php file in the RASA template. I'll edit the Zen Grid Framework template instead.

By the way I find this very confusing... having two different templates and never knowing which template I should be editing. It just doesn't make any sense to me. I've run into this several times now and I've been considering giving up on your templates because of it! I just don't get it.

I've been using Rocket Themes for a while now and, despite their ridiculously ugly templates, I've had no trouble figuring out their framework. I really want to stick with Joomla Bamboo because your templates are MUCH more elegant in appearance. However, under the hood their templates and framework make sense. Yours don't.

Is there some conceptual overview somewhere that I could read/watch that would help me know a) how it works and b) how I should know which template (RASA vs. Zengrid for example) to edit?
  • geoffmack's Avatar
  • geoffmack
  • 6 Month Developer
  • 8 posts
  • Karma: 0
The administrator has disabled public write access.
Geoff,

I truly understand your frustration and would like to offer you another way to do what your seeking. Since the Tips & Tricks article you referenced was originally posted back in 2008, much has changed within the Joomla & the Joomla template world since then. Throughout the years I learned to stay out of most 'core' files for a number of reasons. The least being when upgrades are installed, you have to go back and re-customize the new 'core' files. With this being said, I look at template's index.php as 'core' files as well. For this Joomla and the joomla community has now embraced 'over-rides' and 'plug-ins' more and more. Having said this, I still understand your frustrations and want to offer a smarter was to accomplish the task at hand. Check out this Joomla extension link;

extensions.joomla.org/extensions/site-management/seo-a-metadata/3521

This plug-in once enabled will allow you to type in 'leading text' to your page titles without altering any file within your site. There is but one setting... The text you wish to show ahead of the page title. If you choose to use this simple plug-in, please make sure you remove the four lines of code you put into the zengridframework index.php file. There is no need to have this since this plugin will be performing that task for you. Please let us know if this app does what you need... it is very portable and lightweight!

Ed
  • Ed's Avatar
  • Ed
  • LIfetime Developer - Big Bamboo
  • 1693 posts
  • 45 Thanks
  • Karma: 60
Last Edit: 13 years 6 months ago by Ed.
The administrator has disabled public write access.
Hey Geoff,

Sorry for your trouble.

Basically we load two templates as way of keeping a handle on reducing the number of updates you need. So anything in the zengridframework folder shouldn't really be touched. It's really just the core logic and markup that the template that is being displayed on the site is drawing from.

That being said the load extra scripts in the scripts and performance panel is designed to be able to be used in the way that you are suggesting and it's not. Ill go off and investigate and provide the functionality in a upcoming release.

As an aside I my seo reading suggests that the first few words int he page title needs to be different and if you have the site name there then google sees them as all the same page title.Do you have a spin on this?

Anthony
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
Hi Geoff,

After a bit of exploration this is the code that will work if you put it in the includes/templateVariables.php file of the template:
// no direct access
defined( '_JEXEC' ) or die( 'Restricted index access' );
 global $mainframe;
 $document =& JFactory::getDocument();
 $document->setTitle($mainframe->getCfg('sitename') . " - " . $document->getTitle());

If you put that at the top of the file just after the opening the <?php tag it should do what you are after.

Let us know how you get on.

Thanks Anthony
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
Hi Anthony. Thank you for looking into this. A subsequent posting suggests that this change should go into the variables.php file. I'm not sure what to make of that.

My hope is to have a template that I can exercise complete control over. Joomla has been terrific because I can change just about anything I want and it is fairly straight-forward. A little bit of CSS, some basic html, some minor PHP file editing, and every aspect of the site is at my fingertips. Using JoomlaBamboo presents a different scenario. I get a beautiful template to start, but to change things like the footer, or the site title, I have to do things that don't make sense, at least in the traditional Joomla functionality world. It is like your templates aren't just templates, they conflate presentation and functionality into a single piece. Perhaps this is just what is needed for a newbie because there are a lot of things that can be manipulated in the interface. But for somebody that is a step above a newbie, your framework adds an impenetrable layer functionality on top of the presentation layer. I'm still trying to wrap my head around it.

I have another project that I am starting today and I'd like to use a Joomla Bamboo template to start, because they are so beautiful (really, your designers deserve some kudos for their work.) But if using Joomla Bamboo means that I will have to spend 2 or 3 times as much time trying to manipulate the site then I will have to go elsewhere. I can take somebody else's template and make it beautiful. That's not too hard. What's hard is taking a Joomla Bamboo template and manipulating it.

Regarding the site title, yes, I have heard the same things as you, that Google reads the site title and if it is the same they think it is the same page. But honestly the Google engine is much smarter than that. I did SEO for Amazon and worked for a subsidiary where we built our own search engine. There are a LOT of factors that go into search engine relevance. Putting the site title in front of the page name won't hurt my SEO. Google's relevance engine will read all of the words in my site title. It won't stop at the first few words. It will even parse them into phrases, taking into account the dashes, and it will combine it all with other aspects of my page such as words in the URL, H1 tags, meta tags, words on the page, and about a hundred other things like link text (ie, what is this page called when you link to it.)

If you want to see best practices for SEO, you just need to look at the top sites on the web. They have top SEO people working with them and they are already doing it right. You'll see that they always include the site title, a dash, and the page name. Or sometimes they reverse it with page name, a dash then site title. See Google, Yahoo, Facebook, Youtube, Wikipedia, Amazon. Regardless, the site name should really be in the title tag.

Thank you again for looking into the issue.
  • geoffmack's Avatar
  • geoffmack
  • 6 Month Developer
  • 8 posts
  • Karma: 0
The administrator has disabled public write access.
Hey there,
A subsequent posting suggests that this change should go into the variables.php file. I'm not sure what to make of that.

Not quite sure what you mean there. includes/templateVariables is the file to use.
My hope is to have a template that I can exercise complete control over. Joomla has been terrific because I can change just about anything I want and it is fairly straight-forward. A little bit of CSS, some basic html, some minor PHP file editing, and every aspect of the site is at my fingertips. Using JoomlaBamboo presents a different scenario. I get a beautiful template to start, but to change things like the footer, or the site title, I have to do things that don't make sense, at least in the traditional Joomla functionality world. It is like your templates aren't just templates, they conflate presentation and functionality into a single piece. Perhaps this is just what is needed for a newbie because there are a lot of things that can be manipulated in the interface. But for somebody that is a step above a newbie, your framework adds an impenetrable layer functionality on top of the presentation layer. I'm still trying to wrap my head around it.

I totally hear that. I guess we wanted to aim for a framework that sits between the developer and site builder spectrum. Cory Webb put together an interesting presentation saying that he felt that gantry was good for site builders - lots of admin interaction, while his framework - motif - was good for developers. I havent explored either to back this up but the aim of zen is to make it easy for both to access the features of the framework ... and that's why this post is important at least to me because almost all of the feedback has been positive but Im unsure how much of that was from builders vs developers.

That being said there are a number of hooks like the includes/templateVariables.php file or the js/template.js file or the css/custom.css file, or the layout/ files that can be used to add your own html, php. js or css to the template. Perhaps an issue here is really documentation for advanced users and its certainly on my todo close to the top to flesh that out some more.

re seo - thanks so much for sharing that. Certainly sounds like you have the experience to back it up. Im going to do some more research and investigating. I guess seo changes so much it's hard to keep at the forefront unless you specialise in it.

Thanks again for your feedback. Im really glad o hear it and if you keep working with the templates happy to hear some more.

Anthony
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
I am terribly sorry if I totally misunderstood the topic of this thread. But I believe that installing and activating a plugin like extensions.joomla.org/extensions/site-management/seo-a-metadata/3352 would resolve all these issues?
  • Sascha's Avatar
  • Sascha
  • Free Extensions
  • 56 posts
  • 1 Thanks
  • Karma: 2
The administrator has disabled public write access.
Sascha, ditto!

However, some very interesting and enlightening topics have surfaced here that are worthy of reading to say the least!

Ed
  • Ed's Avatar
  • Ed
  • LIfetime Developer - Big Bamboo
  • 1693 posts
  • 45 Thanks
  • Karma: 60
The administrator has disabled public write access.
I shall most certainly agree. :)
  • Sascha's Avatar
  • Sascha
  • Free Extensions
  • 56 posts
  • 1 Thanks
  • Karma: 2
Last Edit: 13 years 6 months ago by Sascha.
The administrator has disabled public write access.

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Happy Campers