Keyword

k2 page titles configure

More
5 years 5 days ago - 4 years 11 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: 4 years 11 months ago by burnyourears. Reason: Deleting a link to the page.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
5 years 4 days 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);

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 4 days ago - 4 years 11 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: 4 years 11 months ago by burnyourears.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
5 years 3 days 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; 
?>

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 3 days ago - 4 years 11 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: 4 years 11 months ago by burnyourears.

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

More
5 years 3 days ago - 4 years 11 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: 4 years 11 months ago by burnyourears.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
5 years 2 days 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 :)

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

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

More
1 year 10 months ago - 1 year 10 months 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 year 10 months ago by Wilfried.

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

More
1 year 10 months 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.

More
1 year 10 months ago #177931 by JoomlaWorks
Replied by JoomlaWorks 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).

Fotis / 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