2
votes

I am using custom search module in joomla 2.5 and I need to add extra text to the title tag on module. But I cant seem to find where the tag is located in Joomla. Does any of you guys know where it is located and how can I override page title ? Thanks

4

4 Answers

3
votes

@George Wilson is close, but the $this will only work depending on what context you are in/

Instead you can do something as simple as the following pretty much anywhere (though this should be something set by either the component or a plugin specifically meant to improve page titles globally in some way).

JFactory::getDocument()->setTitle('Set your title here');

Do note though that if you set this in a module or elsewhere, something else can come along later in the code and override this.

1
votes

The title tag should NOT be set by a module - but by the component on the page. Having said that you can do it through:

<?php
$app = JFactory::getApplication();
$this->setTitle( 'This is the title that you wish to place' );
?>

Link here for more info

0
votes

I guess you want this:

public_html/libraries/joomla/document/html/renderer/head.php

Take a look at that on LINE 102. You will be able to control everything... :-)

-1
votes

Add the following line:

JFactory::getDocument()->setTitle('Set your title here');

after

$app = JFactory::getApplication();

in the following file:

public_html/libraries/joomla/document/html/renderer/head.php