clowride VIP
Total posts: 1,022
27 Jan 2015 11:41

hello for a very specific situation, i 'am trying to do that: 1/ i have the title of record (no problem)

2/ i' would like the tile of the page (no of record) has 2 informations (zip and city)

i explain my cobalt record is " management school" but i would like my page ( in navigator and meta title be) management shool 90001 california (from adress and map field in form) BUT USER IN COBALT LIST VIEW DO NOT SEE 90001 CALIFORNIA, HE WOULD ONLY SEE management school it is very important for local seo sorry if not clear thank you very much

Last Modified: 05 Feb 2015

Tags Tutorial


Sergey
Total posts: 13,748
28 Jan 2015 08:38

Which page? Article full view or articles list?


clowride VIP
Total posts: 1,022
28 Jan 2015 09:15

only full view and list view if possible, because i use a seo agence and according their advice, it is good for local seo the problem is only meta title need his information, cobalt users do not see zip and ciy, they only see the title of record thank you very much


clowride VIP
Total posts: 1,022
29 Jan 2015 21:35

maybe like composite title but for meta title any idea would be very great it is very important for my project


Sergey
Total posts: 13,748
30 Jan 2015 04:22

You can change metadata title from template.

$this->document->setTitle($item->title . ' - ' . strip_tags($item->fields_by_id[10]->value['address']['zip']));

Something like this.


clowride VIP
Total posts: 1,022
30 Jan 2015 06:16

ok thank you very much but in this case i do not use composite title ? because currently it is like that [text field] - [adress and map field] thank you


Sergey
Total posts: 13,748
04 Feb 2015 01:21

You do not need any composite tile if you use this tecnique.


clowride VIP
Total posts: 1,022
04 Feb 2015 16:54

please where i can put this code, i tried either i see in title of record ( i would like to see in title of navigator like meta tile but not in title of record) or i have an eror and if i want to add another field, need i put it below ? sorry again :( thank you very much


pepperstreet VIP
Total posts: 3,837
04 Feb 2015 23:33

clowride please where i can put this code

In your record full view template. Either right after the definition of the basic "$variables"...
or after the CSS styles section. Just make sure it is inside of the existing PHP tags:

clowride if i want to add another field, need i put it below ?

Look at the example code... you can add any field to it. You have to follow the same syntax and you have to use the "." to connect the additional parts.

The address field Syntax is a special case, because it is an ARRAY. This allows to access the certain [sub parts].
Regular fields should work with a shorter and simpler syntax.

Example with 3 extra fields (added new lines for better readability!)

$this->document->setTitle( $item->title 
. ' - ' . strip_tags($item->fields_by_id[10]->value['address']['zip'])
. ' - ' . strip_tags($item->fields_by_id[1]->value)
. ' - ' . strip_tags($item->fields_by_id[2]->value)
. ' - ' . strip_tags($item->fields_by_id[3]->value)
);

Sergey
Total posts: 13,748
05 Feb 2015 05:24

I do not know if $this->document contain a document but if not just change to JFactory::getDocument()


clowride VIP
Total posts: 1,022
05 Feb 2015 06:44

thank you very much

Powered by Cobalt