Keyword

change item browser title & tag description

  • Arantzazu
  • Arantzazu's Avatar Topic Author
  • Offline
  • Junior Member
More
4 months 3 days ago #175094 by Arantzazu
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.

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
3 months 4 weeks ago #175116 by Fotis
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... ;)

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

  • Arantzazu
  • Arantzazu's Avatar Topic Author
  • Offline
  • Junior Member
More
3 months 1 week ago #175258 by Arantzazu
Replied by Arantzazu on topic change item browser title & tag description
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.

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
3 months 1 week ago #175263 by Fotis
You're welcome.

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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


Powered by Kunena Forum