51 Posts
morhinio
11 years ago
Topic
Hello,

is it possibile to set a custom title (title tag/browser page title) in a seblod template. I don't want to use the core article title.

I have read this post. But it doesn't work for me.
seblod Post
Get a VIP membership
10 years ago
0
Level 1
Hi,

I would say what's in the lined post should work (honestly, I didn't try it) but my first thought would be to add this code in a position override or in a custom variation :

$document =JFactory::getDocument();
$document->setTitle($cck->getValue('my_cck_field_name'));

Olivier
178 Posts
Jeka
10 years ago
1
Level 1
Hi.
Did you find a solution to your problem?
Im using T3 framework, Seb List, Seb Minima, Seblod 3.2, Joomla 3.2 in my project.
$document =JFactory::getDocument();
$document->setTitle($cck->getValue('my_cck_field_name'));

Its work in list template by not in content.
215 Posts
iliil
8 years ago
0
Level 2

Hello 

I found this 2 years old topic 'd like to  reanimate it as it's not solved and I'd just need this feature. Jeka is right. For some reason it's not possible to override the document title in CONTENT/FORM template. It only works in LIST template.

Did anybody fnd a solution for this issue?

Thanks

Michal

4229 Posts
Kadministrator
8 years ago
0
Level 1

215 Posts
iliil
8 years ago
0
Level 1

Oooh. So there's surely no way to control this in the content template? I need to set the page title according to the current language.

( I use my content type for some sort of products app. I don't use the native Joomla multilingual solution (each article per language) as I need one article with one ID for one product in all languages. My form contains fields like Product Title (EN), Product Title (FR) and I display the proper fields in the template according to the cuerrent language. ) I guess without being able to control the page title my solution is useless :(.

Would you please give me some comment on this, so I know what I can count on. 

Thank you 

Michal

4229 Posts
Kadministrator
8 years ago
3
Level 1

You can combine this solution with some small custom code in beforeRender plugin, where you would set this fields value based on your language , something like

$lang = JFactory::getLanguage()->getTag();

if ($lang == 'en-GB')
{
   $title = $fields['my_eng_title']->value;
}

else if ($lang == 'fr-FR')

{
   $title = $fields['my_fr_title']->value;
}

$fields['my_title_field_from_configuration']->value = $title;

215 Posts
iliil
8 years ago
2
Level 2

Hi Klas

I bought the plugin, but it doesn't solve this issue unfortunatelly. It seems the page title is set earlier than the trigger of beforeRender plugin.

Your solution can change the value of 'my_title_field_from_configuration' field according to the current lang. But the page title still uses the original value of

'my_title_field_from_configuration' field ( if there is any ) or Article title (if 'my_title_field_from_configuration' value is empty).

I even tried to let JFactory::getDocument() to set title in beforeRender plugin, also no luck. If you have more ideas, please share. I spent quite a time on this robust content type. Everything works great except of this essential issue..

Thanks

Michal

4229 Posts
Kadministrator
8 years ago
1
Level 3

Sorry, i have miss-leaded you. I spent few hours now searching trough the code now to find a solution:

you can put value like this in override title field:

 {"en-GB":"title_test","de-DE":"title_test_de"}


This will load fields for title depending on the language -  from this example title_test will be used for en-GB and title_test_de field for de-DE.

215 Posts
iliil
8 years ago
0
Level 4

Hi Klas

I'd like to thank you so much for your extraordinary support. It works now!

Mic

6 years ago
0
Level 1

Hi Klas

Never saw this but if you create a special field that stores your custom meta title Joomla will use it as the REAL title of the content!

in the joomla article manager options the "SHOW ARTICLE" is generally left to YES 

Overriding the seo title within the content view will modify the title on top of your content !

Cyril

Get a Book for SEBLOD