Keyword

[SOLVED] Change "displaying items by tag" page title

  • Andrew Lambert
  • Andrew Lambert's Avatar Topic Author
  • Offline
  • New Member
More
9 years 5 months ago #134207 by Andrew Lambert
Change "displaying items by tag" page title was created by Andrew Lambert
I was able to change the "Displaying Items by tag" page title using a language override so that text is called "News Tagged:". However the page title still shows the site name which looks kind of silly: "News Tagged: Neuro - La Follette School of Public Affairs"
www.lafollette.wisc.edu/news/tag/Neuro

Is there a way to keep the site name from displaying in the page title here? Thanks.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 5 months ago #134215 by Krikor Boghossian
Replied by Krikor Boghossian on topic Change "displaying items by tag" page title
A quick way would be by editing your overrides.

In the tag.php file you could use the str_replace() function to strip out the site's title.

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

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

  • Andrew Lambert
  • Andrew Lambert's Avatar Topic Author
  • Offline
  • New Member
More
9 years 5 months ago #134223 by Andrew Lambert
Replied by Andrew Lambert on topic Change "displaying items by tag" page title
Sounds like that might work, but I'm not familiar with that php command how it would have to be written to work properly. In tag.php would it be added somewhere in this chunk of code?:

<!-- Start K2 Tag Layout -->
<div id="k2Container" class="tagView<?php if($this->params->get('pageclass_sfx')) echo ' '.$this->params->get('pageclass_sfx'); ?>">
<h1><?php echo $this->escape($this->params->get('page_title')); ?></h1>
<?php if($this->params->get('show_page_title')): ?>
<!-- Page title -->
<div class="componentheading<?php echo $this->params->get('pageclass_sfx')?>">
<?php echo $this->escape($this->params->get('page_title')); ?>
</div>
<?php endif; ?>

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 5 months ago #134240 by Krikor Boghossian
Replied by Krikor Boghossian on topic Change "displaying items by tag" page title
This the manual for the function.
php.net/manual/en/function.str-replace.php

You need to replace the "- La Follette School of Public Affairs" part from $this->params->get('page_title') with ''.

so you need something like this.
$oldtitle = $this->params->get('page_title');
$newtitle = str_replace("- La Follette School of Public Affairs", " ", "$oldtitle");
 echo $newtitle;

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

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

  • Andrew Lambert
  • Andrew Lambert's Avatar Topic Author
  • Offline
  • New Member
More
9 years 5 months ago #134258 by Andrew Lambert
Replied by Andrew Lambert on topic Change "displaying items by tag" page title
Awesome! Got this to work. Thanks so much.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 4 months ago #134313 by Krikor Boghossian
Replied by Krikor Boghossian on topic Change "displaying items by tag" page title
You 're welcome Andrew.

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