Keyword

k2 page titles configure

More
3 years 9 months ago #177939 by Wilfried
Replied by Wilfried on topic k2 page titles configure
Hi and thank you Fotis for your answer.
I have already an override. I am not an expert in programming. Which loop are you talking about?

In the editing options of the extrafield, I have to choose "text" if I want to add content. And the "text" category don't allow me to hide the tag in the frontend. Visitors will see the content of the tag and I only want this tag for changing the tag title.
I hope that you can understand my message.

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

More
3 years 9 months ago #177957 by JoomlaWorks
Replied by JoomlaWorks on topic k2 page titles configure
Either delete this entire block github.com/getk2/k2/blob/master/components/com_k2/templates/default/item.php#L244-L264 or just put code comments around it so it won't render in your site's frontend.

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

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

More
3 years 9 months ago - 3 years 9 months ago #177979 by Wilfried
Replied by Wilfried on topic k2 page titles configure
Ok, it worked, but all the additional extrafileds are hidden now. I only want this extrafield hidden. My purpose it to change the tag title of the page from the backoffice. But in the front it has to be transparent for the visitors.
I'm gonna search again and maybe I will find a solution.
Thak you for your help.
Last edit: 3 years 9 months ago by Wilfried.

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

More
3 years 9 months ago #177991 by JoomlaWorks
Replied by JoomlaWorks on topic k2 page titles configure
Then you need to add an exception in the foreach loop to hide that specific field. See how we check the "header" type field and it should give you a hint.

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

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

More
2 years 1 month ago - 2 years 1 month ago #180421 by Dejan Bojovic
Replied by Dejan Bojovic on topic k2 page titles configure
This works well for displaying the extra field in Page Title

<?php
$newtitle= $this->item->extraFields->Naslov->value;
$document = JFactory::getDocument();
$document->setTitle($newtitle);
?>

but if the extra field is empty, the page link is displayed.

Is it possible to display the default page title if the extra field is empty?

sorry find solution:

<?php
$doc = JFactory::getDocument();
if ( isset( $this->item->extraFields->Naslov->value ) && ($this->item->extraFields->Naslov->value !=='') ) {
    $doc->setTitle('<title>'.$this->item->extraFields->Naslov->value.'</title>');
}

?>

 
Last edit: 2 years 1 month ago by Dejan Bojovic.

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


Powered by Kunena Forum