Keyword

Meta title (continue)

  • Mauri
  • Mauri's Avatar Topic Author
  • Offline
  • Junior Member
More
8 years 1 month ago - 8 years 1 month ago #151527 by Mauri
Meta title (continue) was created by Mauri
This is a follow up of the post "Meta title" Sorry but im unable of replying the topic, I cannot view the buttons... :-(

When I enter in other topic I´m able to reply, not in mine, I don´t understand

Y copy paste the post and after the replies:

Hi all! I have a little problem with K2 and Meta Title tag, I change it in the menu item but im not able to change the <title> tag it only changes

meta property="go:title"

How can I change meta title in categories or any article?

Thanks in advance


Krikor was telling about my website, here you have:

www.eventosbarcelona.cat/danza

If you see, here are two meta titles, I change in menu item - Browser window display it only changes the meta property="go:title" tag, not the main title tag, how can I do it?

Thanks in advance!! :-)

Mauri
Last edit: 8 years 1 month ago by Mauri.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 1 month ago #151534 by Krikor Boghossian
Replied by Krikor Boghossian on topic Meta title (continue)
Ok,

The og:title is automatically generated from K2. It inherits the category's or the item's title.
This is the default behaviour I would urge not to hack core K2 files.

You can add your own custom meta tags using Joomla!'s API docs.joomla.org/JDocument/setMetaData
docs.joomla.org/Customising_the_dynamic_page_title

You can find a crude example which works with K2's extrafields which you can adapt to replace the og:tag and work with Joomla!'s title here -> github.com/kricore/Advanced-templating-with-K2/blob/master/_inc/cheatsheet.php#L112-L115

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

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

  • Ronny Van Der Borght
  • Ronny Van Der Borght's Avatar
  • Offline
  • Senior Member
More
6 years 5 months ago #165352 by Ronny Van Der Borght
Replied by Ronny Van Der Borght on topic Meta title (continue)
If you want to completely control the pagetitle you could use an extra field for this purpose and add this to item.php:
$browserpagetitle= $this->item->extraFields->custompagetitle->value;
$document = JFactory::getDocument();
$document->setTitle($browserpagetitle);

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 #165358 by Krikor Boghossian
Replied by Krikor Boghossian on topic Meta title (continue)

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

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

More
5 years 10 months ago - 5 years 10 months ago #168158 by lalancuras
Replied by lalancuras on topic Meta title (continue)
hello, i need help please

i add :
// Use extrafields as meta data - thank you @heyjoecampbell and @kbrookes
$doc = JFactory::getDocument();
if ( isset( $this->item->extraFields->title_tag->value ) && ($this->item->extraFields->title_tag->value !=='') ) {
	$doc->addCustomTag('<title>'.$this->item->extraFields->title_tag->value.'</title>');
}
if ( isset( $this->item->extraFields->meta_description->value ) && ($this->item->extraFields->meta_description->value !=='') ) {
	$doc->addCustomTag('<meta name="description" content="'.$this->item->extraFields->meta_description->value.'" />');
}
// See also https://gist.github.com/kricore/2c9a5434748c5f5f6cf9
// Cleanup the extrafields content so you can use them as metatags
$safe 		= array("", "");
$nonsafe 	= array("'", "\"");
$custometa  = $this->item->extraFields->NAME->value;
$safemeta 	= str_replace( $nonsafe, $safe, $custometa);
echo $safemeta;

on itemp.php (in my template)

I create extrafield


but don't work. I don't know where is my mistake

maybe be here : $custometa = $this->item->extraFields->NAME->value;
?

link page test : www.comportementaliste-gironde.fr/blog-education-canine/476-comment-bien-dresser-son-chien.html
Attachments:
Last edit: 5 years 10 months ago by lalancuras.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
5 years 10 months ago #168170 by Krikor Boghossian
Replied by Krikor Boghossian on topic Meta title (continue)
Yes you need to replace the NAME part with the actual alias.

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

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

More
5 years 10 months ago - 5 years 10 months ago #168174 by lalancuras
Replied by lalancuras on topic Meta title (continue)
I try with alias newtitle don't work :(, but at the bottom of my page (see link on my last reply) we can see the title :

Informations supplémentaires

Balise title: Apprendre à bien dresser son chien

Last edit: 5 years 10 months ago by lalancuras.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
5 years 10 months ago #168187 by Krikor Boghossian
Replied by Krikor Boghossian on topic Meta title (continue)
Are you using any SEO extensions?

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

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

More
5 years 10 months ago - 5 years 10 months ago #168198 by lalancuras
Replied by lalancuras on topic Meta title (continue)
yes : Canonical Links All in One and Google structured data

i try to disable but don"t work :(
Last edit: 5 years 10 months ago by lalancuras.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
5 years 10 months ago #168206 by Krikor Boghossian
Replied by Krikor Boghossian on topic Meta title (continue)

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