Skip to main content

Suggestion

More
15 years 3 months ago #19754 by Nello
Suggestion was created by Nello
hi nicolas
It is possible to distinguish between the product name and page title?
Let me explain. Currently the product name is also the page title of that product.
It would be possible to add a field to specify a different page title from the title of the product.
It would be great.
Thank you!

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

More
15 years 3 months ago #19763 by nicolas
Replied by nicolas on topic Re: Suggestion
You can create an new custom field of the table "product" via the menu Display->Custom fields (in the commercial editions only) so that you can enter a page title for the product. Then, edit the file show of the view product and add the lines below just after the first <?php tag:

if(!empty($this->element->CUSTOM_FIELD_COLUMN_NAME)){
$document =& JFactory::getDocument();
$document->setTitle( $this->element->CUSTOM_FIELD_COLUMN_NAME );
}

Don't forget to replace the CUSTOM_FIELD_COLUMN_NAME by the actual column name of your custom field and the title of the product pages will be the text entered in that custom field for each products.

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

More
15 years 3 months ago - 15 years 3 months ago #19764 by Nello
Replied by Nello on topic Re: Suggestion
Fantastic!!! You are my personal God!
eheheh
Last edit: 15 years 3 months ago by Nello.

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

More
15 years 3 months ago #19767 by Nello

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

More
15 years 3 months ago #19806 by Nello
Replied by Nello on topic Re: Suggestion
Hi Nicolas,
this modification works well but if I try to translate the product schedule the custom field is not in the translation panel...

Maybe I have to add some lines in the code to make the custom field translatable...?

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

More
15 years 3 months ago #19809 by nicolas
Replied by nicolas on topic Re: Suggestion
If you want it to be translatable via the translation file, you should use:
$document->setTitle( JText::_($this->element->CUSTOM_FIELD_COLUMN_NAME) );
instead of :
$document->setTitle( $this->element->CUSTOM_FIELD_COLUMN_NAME );
in the previous code.
Then, in your product field, you can put for example the text MY_CUSTOM_TITLE and in the translation override, you can add the line:
MY_CUSTOM_TITLE="My custom override"

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

More
15 years 3 months ago #20126 by Nello
Replied by Nello on topic Re: Suggestion
Hi Nicolas,
I don't want it to be translatable via the translation file, but I use JoomFish for translation and I want that the custom title I added for each product it has to be translatable by the JoomFish Translation Panel...

For page title I mean what you see on the title bar, and It is different for each product.

Some examples:

www.hidesign.it/it/in-esposizione/produc.../cid-212/tykho-radio

www.hidesign.it/it/in-esposizione/produc...rologio-spring-large

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

More
15 years 3 months ago #20142 by nicolas
Replied by nicolas on topic Re: Suggestion
Then, you need to edit the hikashop_product.xml file in the administrator/components/com_joomfish/contentelements folder, in order to add a line for your field. Then, it will be translatable via joomfish.

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

More
15 years 2 months ago #20293 by Nello
Replied by Nello on topic Re: Suggestion
Tnx!

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

Time to create page: 0.192 seconds
Powered by Kunena Forum