Keyword

k2 page titles configure

More
3 years 3 months ago - 3 years 2 months ago #165567 by burnyourears
Replied by burnyourears on topic k2 page titles configure
That is the actual setting for the individual Page-Titel-Tag (which I somehow tried to integrate wit the "$safemeta;"-Code above – and failed)
<?php
$newtitle= ($this->item->title . ' | Review');
$document = JFactory::getDocument();
$document->setTitle($newtitle);
?>

When I delete that part of the code, everything is fine and "Spock's Beard" looks fine as it should. So it must have something to do with the posted snippet ...
Last edit: 3 years 2 months ago by burnyourears. Reason: Deleting a link to the page.

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

More
3 years 3 months ago #165575 by Krikor Boghossian
Replied by Krikor Boghossian on topic k2 page titles configure
Try this instead.
$safe 		= array("", "");
$nonsafe 	= array("'", "\"");
$safemeta 	= str_replace( $nonsafe, $safe, $this->item->title);
$newtitle   = (' Review: ' . $safemeta . ' | ' . $this->item->category->name);
$document   = JFactory::getDocument();
$document->setTitle($newtitle);

IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

---
JoomlaWorks
www.joomlaworks.net/

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

More
3 years 3 months ago - 3 years 2 months ago #165579 by burnyourears
Replied by burnyourears on topic k2 page titles configure
Thank you, but it does not help or change anything (just relocated the "review" in the code, but it should not have an impact because your version does not work either ...).

That's the code I use:
<?php
$safe 		= array("", "");
$nonsafe 	= array("'", "\"");
$safemeta 	= str_replace( $nonsafe, $safe, $this->item->title);
$newtitle   = ($safemeta . ' | Review - XXX');
$document   = JFactory::getDocument();
$document->setTitle($newtitle);
?>

Any further idea? :/
Last edit: 3 years 2 months ago by burnyourears.

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

More
3 years 2 months ago #165605 by Krikor Boghossian
Replied by Krikor Boghossian on topic k2 page titles configure
What does this produce in your override?
<?php
$safe 		= array("", "", "", "");
$nonsafe 	= array("'", "\"", "", "#039;", "&amp;");
$safemeta 	= str_replace( $nonsafe, $safe, $this->item->title);
echo $safemeta; 
?>

IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

---
JoomlaWorks
www.joomlaworks.net/

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

More
3 years 2 months ago - 3 years 2 months ago #165610 by burnyourears
Replied by burnyourears on topic k2 page titles configure
Ahhh, thank you! Better ... now it's "Spock&s Beard" instead of "Spock's Beard", bute we're getting to the core ;-)

One last idea?

That's the code right now:
<?php
$safe 		= array("", "", "", "");
$nonsafe 	= array("'", "\"", "", "#039;", "&amp;");
$safemeta 	= str_replace( $nonsafe, $safe, $this->item->title);
$newtitle   = ($safemeta . ' | Review - XXX');
$document   = JFactory::getDocument();
$document->setTitle($newtitle);
?>
Last edit: 3 years 2 months ago by burnyourears.

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

More
3 years 2 months ago - 3 years 2 months ago #165611 by burnyourears
Replied by burnyourears on topic k2 page titles configure
Ok, I experimented a bit with your code and now I have it:
<?php
$safe 		= array("'");
$nonsafe 	= array("&#039;");
$safemeta 	= str_replace( $nonsafe, $safe, $this->item->title);
$newtitle   = ($safemeta . ' | Review - XXX');
$document   = JFactory::getDocument();
$document->setTitle($newtitle);
?>

So your ideas lead to that point I could make it – thank you very much! :D
Last edit: 3 years 2 months ago by burnyourears.

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

More
3 years 3 months ago #165621 by Krikor Boghossian
Replied by Krikor Boghossian on topic k2 page titles configure
You 're welcome, and I'm glad I could assist you :)

IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

---
JoomlaWorks
www.joomlaworks.net/

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

More
1 month 1 week ago - 1 month 1 week ago #177912 by Wilfried
Replied by Wilfried on topic k2 page titles configure
<?php
$newtitle= $this->item->extraFields->EXTRAFIELDALIASHERE->value;
$document = JFactory::getDocument();
$document->setTitle($newtitle);
?>
Hi,
I used this solution to add the tag <title> to each page of my website. The result is ok, but the extrafield is visible in frontend. Is it possible to hide the extrafield in the frontend and only have the option in the backend?

Example: the word "Test" appear in the navigator and the extrafield "Balise title:" is visible before the video.
www.cryptoseries.fr/series/item/445-huff

Sorry for my english, I am french.
Last edit: 1 month 1 week ago by Wilfried.

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

More
1 month 4 days ago #177916 by Wilfried
Replied by Wilfried on topic k2 page titles configure
If anybody have an idea? I can add explanation or maybe provide more examples?
Thanks

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

  • Fotis
  • Fotis's Avatar
  • Online
  • Administrator
  • JoomlaWorks Support Team
More
1 month 3 days ago #177931 by Fotis
Replied by Fotis on topic k2 page titles configure
Create an override (if you haven't done so already) and remove the extra fields loop. If you choose to hide extra fields in the options of the category they may not render at all (if I recall correctly).

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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


Powered by Kunena Forum