Keyword

How to edit tag.php page title

  • Marco Cevoli
  • Marco Cevoli's Avatar Topic Author
  • Offline
  • New Member
More
6 years 5 months ago #168177 by Marco Cevoli
How to edit tag.php page title was created by Marco Cevoli
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.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 5 months ago #168184 by Krikor Boghossian
Replied by Krikor Boghossian on 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

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

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

  • Marco Cevoli
  • Marco Cevoli's Avatar Topic Author
  • Offline
  • New Member
More
6 years 5 months ago #168185 by Marco Cevoli
Replied by Marco Cevoli on 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.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 5 months ago #168224 by Krikor Boghossian
Replied by Krikor Boghossian on topic How to edit tag.php page title
Hello,
Try this variable:
$app				= JFactory::getApplication();
$sitename			= $app->getCfg('sitename');

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