Suggestion

  • Posts: 251
  • Thank you received: 2
13 years 4 months ago #19754

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.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 4 months ago #19763

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.

  • Posts: 251
  • Thank you received: 2
13 years 4 months ago #19764

Fantastic!!! You are my personal God!
eheheh

Last edit: 13 years 4 months ago by Nello.

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

  • Posts: 251
  • Thank you received: 2
13 years 4 months ago #19767

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

  • Posts: 251
  • Thank you received: 2
13 years 4 months ago #19806

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.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 4 months ago #19809

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.

  • Posts: 251
  • Thank you received: 2
13 years 4 months ago #20126

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.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 4 months ago #20142

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.

  • Posts: 251
  • Thank you received: 2
13 years 4 months ago #20293

Tnx!

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

Time to create page: 0.068 seconds
Powered by Kunena Forum