- Posts: 7
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- Alternate relation / hreflang not working for categories
Alternate relation / hreflang not working for categories
- Beni
- Topic Author
- Offline
- New Member
Less
More
7 years 8 months ago #156755
by Beni
Alternate relation / hreflang not working for categories was created by Beni
Hi,
...i'm trying to optimize hreflang tags for a customers site. And maybe i found a bug.
When using a k2 category as menu type, an alternate relation code is added to the site, but just for the main language not in other languages.
(But it seems to work with k2 single articles as menu type....)
Working.:
<base href="www.mydomain.com/">
<link href="www.mydomain.com/fr/" rel="alternate" hreflang="fr-FR">
Not-Working:
<base href="www.mydomain.com/fr/">
MIssing: <link href="www.mydomain.com/" rel="alternate" hreflang="en-EN">
Can anyone confirm this or am i wrong? Does anyone know a quikfix?!
...i'm trying to optimize hreflang tags for a customers site. And maybe i found a bug.
When using a k2 category as menu type, an alternate relation code is added to the site, but just for the main language not in other languages.
(But it seems to work with k2 single articles as menu type....)
Working.:
<base href="www.mydomain.com/">
<link href="www.mydomain.com/fr/" rel="alternate" hreflang="fr-FR">
Not-Working:
<base href="www.mydomain.com/fr/">
MIssing: <link href="www.mydomain.com/" rel="alternate" hreflang="en-EN">
Can anyone confirm this or am i wrong? Does anyone know a quikfix?!
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 8 months ago #156766
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Alternate relation / hreflang not working for categories
Hello,
These codes are being added by Joomla!
You can add the missing codes using Joomla!'s API
docs.joomla.org/JDocument/setMetaData
Furthermore make sure to use overrides instead of editing core files (the category.php)
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates
These codes are being added by Joomla!
You can add the missing codes using Joomla!'s API
docs.joomla.org/JDocument/setMetaData
Furthermore make sure to use overrides instead of editing core files (the category.php)
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.
- Beni
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
7 years 8 months ago #156769
by Beni
Replied by Beni on topic Alternate relation / hreflang not working for categories
The link to the joomla documentation is great! Thanks! :)
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 8 months ago #156771
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Alternate relation / hreflang not working for categories
You 're welcome Beni :)
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Beni
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
7 years 7 months ago #157802
by Beni
Replied by Beni on topic Alternate relation / hreflang not working for categories
Hi Krikor,
....i'm sorry, but i'm no "coder"... could you give me an example how the code should look like in my case? I can get it working with metatitle oder description...but not for a hreflang...
....i'm sorry, but i'm no "coder"... could you give me an example how the code should look like in my case? I can get it working with metatitle oder description...but not for a hreflang...
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 7 months ago #157813
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Alternate relation / hreflang not working for categories
You can use a similar function.
$doc = JFactory::getDocument();
$doc->addCustomTag('<link href="www.mydomain.com/fr/" rel="alternate" hreflang="fr-FR">');
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- Alternate relation / hreflang not working for categories