Check if custom title uses?

More
6 years 9 months ago - 6 years 9 months ago #67735 by lipatovroman
Hi!
I need to create own rules for Page Title Tag.

I added this code
Code:
$newtitle = "test"; $document = JFactory::getDocument(); $document->setTitle($newtitle);

in item.php template.

It works.

How I can check, if custom title option is not empty?



I also need to check if meta description is empty (to create rules this tag too.)

Last edit: 6 years 9 months ago by lipatovroman.

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

More
6 years 9 months ago #67736 by lipatovroman
I trying this code:
Code:
if ($this->params->get('override_title', 0)) { $newtitle = "test"; $document = JFactory::getDocument(); $document->setTitle($newtitle); }

But it does not work. Always displays "test".

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

More
6 years 9 months ago - 6 years 9 months ago #67741 by ggppdk
Replied by ggppdk on topic Check if custom title uses?
Hello

Code:
if ( !$this->params->get('override_title', 0) || // Custom title OVERRIDE is OFF !$this->params->get('custom_ititle', '')) // OR custom title TEXT is empty ) { // Add you custom code here }


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
Last edit: 6 years 9 months ago by ggppdk.

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

More
6 years 9 months ago - 6 years 9 months ago #67742 by lipatovroman
I use this code :
Code:
if ($this->params->get('override_title', 0)) { $newtitle = "test"; $document = JFactory::getDocument(); $document->setTitle($newtitle); }

All items have Page title = "test" - no matter if Custom <‌title‌> empty or not...

Same with this code:
Code:
if ($this->params->get('override_title', '')) { $newtitle = "test"; $document = JFactory::getDocument(); $document->setTitle($newtitle); }
Last edit: 6 years 9 months ago by lipatovroman.

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

More
6 years 9 months ago #67743 by lipatovroman
Hmmm...
It seems option to Custom <‌title‌> option does not work.
I remove all changes in file.

Configured some Custom title



but it does not displays.

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

More
6 years 9 months ago - 6 years 9 months ago #67747 by ggppdk
Replied by ggppdk on topic Check if custom title uses?
Hello

These parameters work correctly !
- but you may not have enough space to show the custom title

Explanation:
if you have enabled prepending any or both of the following
- category name (in Type form or in Item form)
- site name (in .... Joomla Global configuration )


Thus you may get a custom title like this
Site name - Category name - Custom title

Resulting in a partial display like:
Site name - Categ ...

Now about the custom code that i gave you above,
i wrote a parameter name wrongly
i corrected it above, you may retry


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
Last edit: 6 years 9 months ago by ggppdk.

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.288 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline