Keyword

change item browser title & tag description

  • sizu
  • sizu's Avatar Topic Author
  • Offline
  • Junior Member
More
4 years 8 months ago #175094 by sizu
Hi,
I'd like to change the browser title of the items so they aren't the same as page headings. How can I do that? do I have to override item.php file?
On the other hand, how can I add a description to a tag? It would be a very useful feature, have you planned to add it in the future as Joomla already does?
Thank you so much for your help.

Best regards

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #175116 by JoomlaWorks
Replied by JoomlaWorks on topic change item browser title & tag description
Changing the <title> can only be done when you link K2 content to some menu item. You can't have a different title out-of-the-box for content that is not linked to menu items.

On the other hand, if you want such control, it's pretty easy to make your own field (through K2's extra fields) and have that field replace the default <title> tag with your own.

E.g., at the very top of item.php and after the "defined('_JEXEC') or die;" line add this:
// Get the extra field
$customTitle = $this->item->extraFields->customtitle->value; // Notice "customtitle" here which is the extra field alias

// Replace the title tag with the new custom one
$document = JFactory::getDocument();
$document-> setTitle($customTitle);

Make sure the change is done in an override for item.php inside your template (more info here: getk2.org/documentation/tutorials/templating-with-k2-and-the-concepts-of-sub-templates)

There are no plans to add a description for tags (but I'm sure there's a plugin for that). In K2, we must say no to some features. If we add everything imaginable as an option, K2 will just become an options monster. The fact that Joomla does it, doesn't mean it's right. If things were right in core content management in Joomla, we wouldn't have made K2 in the first place... ;)

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • sizu
  • sizu's Avatar Topic Author
  • Offline
  • Junior Member
More
4 years 7 months ago #175258 by sizu
Hi Fotis,
thank you so much for your explanation and sorry for the delay in my reply.

Best regards

Please Log in or Create an account to join the conversation.

More
4 years 7 months ago #175263 by JoomlaWorks
Replied by JoomlaWorks on topic change item browser title & tag description
You're welcome.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum