Welcome, Guest
Username: Password: Remember me

TOPIC: [SOLVED] How to change the browser title

[SOLVED] How to change the browser title 10 Jun 2013 13:07 #7410

  • cefnllys
  • cefnllys's Avatar
  • Offline
  • Premium Member
  • Posts: 102
  • Thank you received: 5
  • Karma: 1
I have tried many of the proper methods suggested by joomla for setting the browser page title, but none seem to work in a j-cook component. please could somebody give me an idea how to go about this in j-cook component? currently the page title is displayed as "Web Address - JADMINISTRATION - Component Name" i need to be able to set my own custom versions of these so as to be more in-keeping with the rest of my site. as far as i can tell from the official joomla documentation it is set in the view.html.php file and is the lines which read:

$document = &JFactory::getDocument();

$document->title = $document->titlePrefix . JText::_("ACCOMMODATION_LAYOUT_ACCOMODATION") . $document->titleSuffix;

But alas any changes to these lines results in no change of the title on the page. please can someone help?
The administrator has disabled public write access.

Re: How to change the browser title 11 Jun 2013 18:51 #7430

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
I don't know what to say...
Desactivate plugins, or something else ???

Works for me. There is not issue here.
$document	= JFactory::getDocument();
$document->title = 'My title';
Coding is now a piece of cake
The administrator has disabled public write access.

Re: How to change the browser title 13 Jun 2013 09:45 #7458

  • cefnllys
  • cefnllys's Avatar
  • Offline
  • Premium Member
  • Posts: 102
  • Thank you received: 5
  • Karma: 1
Hi so after a lot of cursing it turns out that it is the line which reads:

JToolBarHelper::title(JText::_('BUSINESSDIRECTORY_LAYOUT_BD_CATEGORIES_ITEM'), 'businessdirectory_bdcategories');

That stops the title from changing. if I comment out this line it is able to propagate to the title I have defined with

$document = &JFactory::getDocument();
$document->title = 'Business Directory';

also adding these lines after:

JToolBarHelper::title(JText::_('BUSINESSDIRECTORY_LAYOUT_BD_CATEGORIES_ITEM'), 'businessdirectory_bdcategories');

also stops the problem. Sorry this was probably really obvious but it took me a fair while to work it out. hope this potentially saves someone else some time. Thanks for the reply though admin.
The administrator has disabled public write access.
The following user(s) said Thank You: twev, molenwal1

Re: How to change the browser title 22 Jun 2013 14:21 #7612

  • molenwal1
  • molenwal1's Avatar
  • Offline
  • Senior Member
  • Posts: 63
  • Thank you received: 17
  • Karma: 3
Thanks for leaving this information on the form. Had same issue, isn't this a bug? The toolbarhelper is changing the title after setting the title at the start of the display function in the view.html.php
Molenwal1 Webdesign
www.molenwal1.nl
The administrator has disabled public write access.
Time to create page: 0.067 seconds

Get Started