Keyword

How to edit tag.php page title

  • Marco Cevoli
  • Marco Cevoli's Avatar Topic Author
  • Offline
  • New Member
More
4 months 2 weeks ago #168177 by Marco Cevoli
Marco Cevoli created the topic: How to edit tag.php page title
Hi,

I am using the option "Site Name in Page Titles" so that my page titles show the site name. However, I don't want that text to appear on the Tag pages, after the text "Articles with tag XYZ:"

i.imgur.com/MEdPqiT.png

I've taken a look at my current tag.php file and indeed the title of this page is rendered by calling the page-title parameter
<?php echo $this->escape($this->params->get('page_title')); ?>

I was wondering if you can call the tag name only, instead of the page title and/or if there is a way of displaying the page title without the "Site name" suffix.

Thanks in advance,

Marco

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

More
4 months 2 weeks ago #168184 by Krikor Boghossian
Krikor Boghossian replied the topic: How to edit tag.php page title
Hello Marco,
You can use str_replace to remove the unwanted part -> php.net/manual/en/function.str-replace.php
PS. Do not forget to use overrides -> getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

---
JoomlaWorks
www.joomlaworks.net/

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

  • Marco Cevoli
  • Marco Cevoli's Avatar Topic Author
  • Offline
  • New Member
More
4 months 2 weeks ago #168185 by Marco Cevoli
Marco Cevoli replied the topic: How to edit tag.php page title
Thanks a lot. Yes, I'm using the overrides. I'm not changing core K2 files, but the copies inside my template folder.

Regarding str_replace, if I set the function with the site name, but later change the unwanted part (that is, the site name), then I need to change this code again, don't I?

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

More
4 months 1 week ago #168224 by Krikor Boghossian
Krikor Boghossian replied the topic: How to edit tag.php page title
Hello,
Try this variable:
$app				= JFactory::getApplication();
$sitename			= $app->getCfg('sitename');

IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

---
JoomlaWorks
www.joomlaworks.net/

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

Moderators: william white