Keyword

Wrong breadcrumb on tag-sites

  • burnyourears
  • burnyourears's Avatar Topic Author
  • Offline
  • Senior Member
More
6 years 4 months ago - 6 years 4 months ago #170564 by burnyourears
Wrong breadcrumb on tag-sites was created by burnyourears
Hi,

I noticed something strange concerning the breadcrumbs on my tag-sites. The category / origin of the crumb is sometimes right, often wrong … it seems like random. But the thing ist – I don't want to show the category anyway.

On tag-sites I just want to show a breadcrumb category "Tags" instead. Like this: Home > Tags > ...

How could I do that? (I mean I cannot build a new category site for every tag in a hidden menue ... ;-) )

Or ... a good alternative would be to switch off breadcrumbs on tag-sites completely. But how could I do that? (I cannot address something like a "tag-site" in the modul-settings to switch it off there because there simply isn't any ...)

Thank you for any help :-)
Last edit: 6 years 4 months ago by burnyourears.

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

More
6 years 4 months ago #170567 by JoomlaWorks
Replied by JoomlaWorks on topic Wrong breadcrumb on tag-sites
Create a menu item in K2 pointing to all categories. Give it a generic name, e.g. "Content" and alias (content).

Clean your site's cache and check again.

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

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

  • burnyourears
  • burnyourears's Avatar Topic Author
  • Offline
  • Senior Member
More
6 years 4 months ago #170568 by burnyourears
Replied by burnyourears on topic Wrong breadcrumb on tag-sites
Ok, i did that – now the breadcrumbs are fully shown but the problem stays the same: On the tag-sites there's some kind of random categories in the breadcrumb ... ? Here an example: www.burnyourears.de/tag/metallica.html

Why is it the category "news"? Why can't it be the category "tags"? (Or no breadcrumb at all ...?)
> Adding another point: There is no headline on these sites. And the title tag is not "Tags for Metallica" or something that would make sense here, but "Rock and Metal News" = the (wrong) category from the breadcrumb.

Strange... ;-)

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

More
6 years 4 months ago #170591 by JoomlaWorks
Replied by JoomlaWorks on topic Wrong breadcrumb on tag-sites
Why not try the K2 breadcrumbs feature in the K2 Tools module?

The path you see there is basically the path you followed to get to that page. That's one of the visual/structural bugs that K2 has solved ages ago over standard Joomla content (in Joomla, if you navigate e.g. from the frontpage to an article which has no direct menu item, the menu item ID remains the same - that of the frontpage).

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

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

  • burnyourears
  • burnyourears's Avatar Topic Author
  • Offline
  • Senior Member
More
6 years 4 months ago - 6 years 4 months ago #170592 by burnyourears
Replied by burnyourears on topic Wrong breadcrumb on tag-sites
Well, I actually tried that .. with an even worse result (the tag is not mentioned anymore) :-(
See in the screenshot both modules activated – the first one is the k2 tool, the second is joomla.

Hmmm.

Attachments:
Last edit: 6 years 4 months ago by burnyourears.

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

More
6 years 4 months ago #170602 by JoomlaWorks
Replied by JoomlaWorks on topic Wrong breadcrumb on tag-sites
It seems to show the site name there when it should be showing the tag name.

What K2 version are you using?

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

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

  • burnyourears
  • burnyourears's Avatar Topic Author
  • Offline
  • Senior Member
More
6 years 4 months ago #170627 by burnyourears
Replied by burnyourears on topic Wrong breadcrumb on tag-sites
Last update: September 21st, 2018 - Version 2.9.0

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

More
6 years 4 months ago #170629 by JoomlaWorks
Replied by JoomlaWorks on topic Wrong breadcrumb on tag-sites
There is no change that could affect breadcrumbs in that version. My guess is that it all boils down to your menu setup. Otherwise my suggestion to "Create a menu item in K2 pointing to all categories. Give it a generic name, e.g. "Content" and alias (content)." would show a different path in the breadcrumbs function of the K2 Tools module.

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

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

  • burnyourears
  • burnyourears's Avatar Topic Author
  • Offline
  • Senior Member
More
6 years 4 months ago #170635 by burnyourears
Replied by burnyourears on topic Wrong breadcrumb on tag-sites
Ok, thank you anyway ... I will try some fixing with a little MetaMod-Magic ...

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

More
6 years 4 months ago #170637 by JoomlaWorks
Replied by JoomlaWorks on topic Wrong breadcrumb on tag-sites
That could work too :)

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

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

  • burnyourears
  • burnyourears's Avatar Topic Author
  • Offline
  • Senior Member
More
6 years 4 months ago #170641 by burnyourears
Replied by burnyourears on topic Wrong breadcrumb on tag-sites
Ok, I did the simplest thing possible – I took the tag.php to edit the title tag and the h1. All I need is some help to fetch the related tag on the site. Here's the code for the title tag:
<?php
$safe 		= array("'");
$nonsafe 	= array("&#039;");
$safemeta 	= str_replace( $nonsafe, $safe, $this->item->title);
$newtitle   = ($safemeta . 'Artikel&uuml;bersicht');
$document   = JFactory::getDocument();
$document->setTitle($newtitle);
?>

Which code do I need to readout the related tag?

It should look like this:

$newtitle = ($safemeta . 'Artikel&uuml;bersicht zu TAG');

And I want to modify the headline also:

<h1>Artikelübersicht zu TAG</h1>

Thanks for help :-)

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

More
6 years 4 months ago #170644 by JoomlaWorks
Replied by JoomlaWorks on topic Wrong breadcrumb on tag-sites
First, see how K2 MVC overrides are done: getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

The file you want to edit is "tag.php".

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

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

  • burnyourears
  • burnyourears's Avatar Topic Author
  • Offline
  • Senior Member
More
6 years 4 months ago #170646 by burnyourears
Replied by burnyourears on topic Wrong breadcrumb on tag-sites
Yes I know - and I already did that the way it is described :-)

I just want to know how to get the "tag" into the site, for example into the h1. Something like

<?php if($this->params->get('show_tag')): ?>


???

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

  • burnyourears
  • burnyourears's Avatar Topic Author
  • Offline
  • Senior Member
More
6 years 4 months ago - 6 years 4 months ago #170663 by burnyourears
Replied by burnyourears on topic Wrong breadcrumb on tag-sites
Ok, I try to explain it in other words – I'm struggling with the TAG page (the page that shows all the posts with the selected tag):

I want to display the name of the active tag (on this site -> tag.php) but couldn't do that, i was trying to fetch it with:
<?php echo $this->escape($this->params->get('page_title')); ?>

This didn't work, it just shows the name of the site ... and not the name of the tag.

How can I display the active tag as part of my h1?
Last edit: 6 years 4 months ago by burnyourears.

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

More
6 years 4 months ago #170685 by JoomlaWorks
Replied by JoomlaWorks on topic Wrong breadcrumb on tag-sites
Try this:
<?php echo $this->params->get('page_title_clean'); ?>

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

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

More
6 years 4 months ago #170686 by JoomlaWorks
Replied by JoomlaWorks on topic Wrong breadcrumb on tag-sites
Worse case scenario:
<?php echo JRequest::getString('tag'); ?>

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

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

  • burnyourears
  • burnyourears's Avatar Topic Author
  • Offline
  • Senior Member
More
6 years 4 months ago #170693 by burnyourears
Replied by burnyourears on topic Wrong breadcrumb on tag-sites
Thank you so much – that did the job for me! :-)

Can I place it as the title-tag, too? Can you tell me what to do here with it?
$newtitle   = ($safemeta . 'Artikel&uuml;bersicht');

(The complete code I use to set the title tag:)
<?php
$safe 		= array("'");
$nonsafe 	= array("&#039;");
$safemeta 	= str_replace( $nonsafe, $safe, $this->item->title);
$newtitle   = ($safemeta . 'Artikel&uuml;bersicht');
$document   = JFactory::getDocument();
$document->setTitle($newtitle);
?>

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

  • burnyourears
  • burnyourears's Avatar Topic Author
  • Offline
  • Senior Member
More
6 years 4 months ago #170695 by burnyourears
Replied by burnyourears on topic Wrong breadcrumb on tag-sites
Ok, I figured it out by myself – here's the code to set the title tag of the tag.php:
<?php
$safe 		= array("'");
$nonsafe 	= array("&#039;");
$safemeta 	= str_replace( $nonsafe, $safe, $this->item->title);
$newtitle   = ($this->params->get('page_title_clean') .  ' | My Site Name');
$document   = JFactory::getDocument();
$document->setTitle($newtitle);
?>

Please correct me if I am wrong, but it works on my site.
Thank you for your kind help!

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

More
6 years 3 months ago #170766 by JoomlaWorks
Replied by JoomlaWorks on topic Wrong breadcrumb on tag-sites
"$this->params->get('page_title_clean')" will return a filtered title either way, so you probably don't need the first 3 lines of code (unless you use it elsewhere in the code and you didn't include it in your snippet).

Other than that, it looks fine.

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

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

  • burnyourears
  • burnyourears's Avatar Topic Author
  • Offline
  • Senior Member
More
6 years 3 months ago #170784 by burnyourears
Replied by burnyourears on topic Wrong breadcrumb on tag-sites
Perfect – thank you very much!

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


Powered by Kunena Forum