News:

Support the VirtueMart project and become a member

Main Menu

Title Tag for Product Detail Page

Started by kory27, September 06, 2013, 22:49:22 PM

Previous topic - Next topic

kory27

Hi,

I did read http://forum.virtuemart.net/index.php?topic=117642.0 and it was marked [Solved], the issue is that making the change described on that forum, and below, to the VM core component code is overwritten.  I tested this by doing the change, then upgrading to 2.0.22c, from 22a.

I want to change the title tag for the product details page from Category : Product Name to just product name.  Changing:

$document->setTitle(strip_tags(($category->category_name ? ($category->category_name . ' : ') : '') . $product->product_name));

to

$document->setTitle(strip_tags($product->product_name));

in file mysitename/components/com_virtuemart/views/productdetails/view.html.php

I thought I could use the standard template override method by placing the view.html.php in mysitename/templates/mytemplate/html/com_virtuemart.  It doesn't change the title tag.  You can view it here http://www.sailingbeyondboundaries.com/turkey-mediterranean-blue-voyage-cruise-details .

1.  Is this because the view.html.php file didn't originate from the productdetails/tmpl file?
2.  Am I just flat out missing something here?

I'd like to handle this via an override that won't be overwritten every time VM updates.

Thanks.

Kory

Maxim Pishnyak

Quote from: kory27 on September 06, 2013, 22:49:22 PM
I thought I could use the standard template override method by placing the view.html.php in mysitename/templates/mytemplate/html/com_virtuemart. 
Why did you think so?

Available methods when you changed core files:
1. Program a plugin for your goal.
2. Restore your hack every time you update VM.
3. Use some Joomla extensions that prevent modified by you core file from future changes.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

kory27

I thought so b/c it made a little bit of sense, until I saw the behavior then realized it wasn't actually in the TMPL file.  I'm not new to this, but I'm also no Jedi master, and in a lot of ways, I'm learning on the job.

I've never made a plugin, but would love to learn.  Any recommendations on a resource to learn more about it?

Thanks for your reply.

Maxim Pishnyak

Quote from: kory27 on September 07, 2013, 16:53:54 PM
I've never made a plugin, but would love to learn.  Any recommendations on a resource to learn more about it?
Scroll to the top of the current page and you will find link to the Dev Portal.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart