Keyword

k2 page titles configure

  • Roman Lipatov
  • Roman  Lipatov's Avatar Topic Author
  • Offline
  • New Member
More
9 years 5 months ago - 9 years 5 months ago #145737 by Roman Lipatov
k2 page titles configure was created by Roman Lipatov
Hi!
I need to create page title tags not same as item title.
So, if item title = item title, I need page title tag = my specific page title.
I think, I can do it using k2 extra fields.
But I can't find which file to edit — to set my page title tag = extra field with ID 1 (example).
Can you point me in right direction?
Thanks!
Last edit: 9 years 5 months ago by Roman Lipatov.

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 #145756 by Krikor Boghossian
Replied by Krikor Boghossian on topic k2 page titles configure
Hello,
You need to override the item.php file.
This post will help you locate it: 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.

  • Roman Lipatov
  • Roman  Lipatov's Avatar Topic Author
  • Offline
  • New Member
More
9 years 5 months ago #145769 by Roman Lipatov
Replied by Roman Lipatov on topic k2 page titles configure
Ok, thanks.
But where in this file page title tag variable?

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 #145780 by Krikor Boghossian
Replied by Krikor Boghossian on topic k2 page titles configure
You can paste it in the itemHeader div, directly under the item's title.

Extrafields can be directly rendered in your template so you do not have to move the entire extrafields block.

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

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

  • Roman Lipatov
  • Roman  Lipatov's Avatar Topic Author
  • Offline
  • New Member
More
9 years 5 months ago - 9 years 5 months ago #145790 by Roman Lipatov
Replied by Roman Lipatov on topic k2 page titles configure
You probably didn't understand me...
I'm talking about meta tag Page title




I need to replace default meta tag <title> which is equal of k2 item title, on my own (for example k2 extra field)
Last edit: 9 years 5 months ago by Roman Lipatov.

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

  • Kannan Naidu Venugopal
  • Kannan Naidu Venugopal's Avatar
  • Offline
  • Platinum Member
  • Aham Brahmasmi
More
9 years 5 months ago #145796 by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic k2 page titles configure
Like what Krikor said, you just have to override item.php

To add custom page title based on your extra field value, try this
<?php
$newtitle= $this->item->extraFields->EXTRAFIELDALIASHERE->value;
$document = JFactory::getDocument();
$document->setTitle($newtitle);
?>

Simply replace EXTRAFIELDALIASHERE with the actual alias of the extra field you wish to output.

K2 Rocks \m/

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

  • Roman Lipatov
  • Roman  Lipatov's Avatar Topic Author
  • Offline
  • New Member
More
9 years 5 months ago #145797 by Roman Lipatov
Replied by Roman Lipatov on topic k2 page titles configure
Awesome!
Thanks!
It's works perfect :)

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

More
8 years 3 months ago #158075 by Giorgio Basile
Replied by Giorgio Basile on topic k2 page titles configure
Hi,

I would like to do the same but is not working for me.
I did override and pasted the code Kannan published with the correct Extra Fields alias in the item.php but now I have as Browser Page Title the page url and in the page code the meta name title has always the K2 article title.
Check this page : new.verticalife.it/index.php/it/viaggi-trekking-in-nepal/templi-e-vette-dell-himalaya

I've pasted it here :
<div class="itemHeader">
	
     <?php
		$newtitle= $this->item->extraFields->PageTitle->value;
		$document = JFactory::getDocument();
		$document->setTitle($newtitle);
		?>

	<?php if($this->item->params->get('itemDateCreated')): ?>
	<!-- Date created -->

"PageTitle" is my Extra Fileds alias.

Can you please help me?

Many thanks!

Giorgio

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

  • Kannan Naidu Venugopal
  • Kannan Naidu Venugopal's Avatar
  • Offline
  • Platinum Member
  • Aham Brahmasmi
More
8 years 3 months ago #158078 by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic k2 page titles configure
Hi,

Can you check if the extrafields is set to show in the configuration parameters?

K2 Rocks \m/

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

More
7 years 8 months ago #161297 by Martin Richta
Replied by Martin Richta on topic k2 page titles configure
Hi. I have problem with title tag too. K2 adding to title my website name. I cant use it. i need only title (page name) without any items. And my sh404sef add behind itle my custom text.

any idea how i can set up it?

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


Powered by Kunena Forum