- Posts: 34
- Thank you received: 0
Custom Page Titles?
- davcraiguk
-
Topic Author
- Offline
I thought of:
1. creating a custom field on the products page in the back-end and calling it say... 'custom_title'.
2. Hide it from the front-end
3. Alter the code in the custom view of show.php...but what?
Can I use here...
Can you help with the bit to retrieve it from the Db?
Will it be overwritten by the default code in view.html.php? ' $document->setTitle( $page_title );'
David Craig
Hikashop 1.5.0 Business edition
www.charitycanvasprints.com
Please Log in or Create an account to join the conversation.
$doc =& JFactory::getDocument();
$doc->setTitle($this->element->custom_title);
in the show file of the view product that you can edit via the menu Display->Views. No need to load the data from the database. As a custom product field, the data is already loaded.
Please Log in or Create an account to join the conversation.
- davcraiguk
-
Topic Author
- Offline
- Posts: 34
- Thank you received: 0
Just while I'm on a few tips for SEO that might help others.
- Make your actual image file names descriptive with dashes (not underscores) between words e.g. a-really-good-description-with-keywords.jpg
- Use the field labeled 'Name' ('file-name' in the hikashop_file table in the db) in the product images page to put a good description of the image. This is used to provide the text for ALT image tags in the code. Google loves these descriptive tags.
- Use a sitemap. Xmap works and the guys here have witten a beta hikashop exentsion for it. Search the forum
- Move your keyword rich product description to the top of the product page just under the product name and above the product image. The characteristic/variants should be below this. This means Google sees the important product info first. Do this in the Hikashop Display/views and choose the product view and the 'show' link. Search the forums, there are examples there of moving bits around on the products page.
- Joomla SEF urls works OK. In my experience using thrid party extensions SEF url extensions make little difference to the quality of Google returned actual results and is a pain to maintain.
- If you also have Joomla articles, use good descriptive article titles. Also descriptive alias with dashes between. These are used by Joomla SEF to build the URLs
Hope these tips help someone.
David Craig
Hikashop 1.5.0 Business edition
www.charitycanvasprints.com
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Using similar code, can I make my page titles look something like...
Site name - Category name - Product Name
How would I accomplish that please?
Cheers
Please Log in or Create an account to join the conversation.
$doc =& JFactory::getDocument();
$class = hikashop::get('class.category');
$cat = $class->get($this->element->category_id);
$doc->setTitle('My website name '.$cat->category_name.' '.$this->element->product_name);
Please Log in or Create an account to join the conversation.
- Posts: 4
- Thank you received: 0
I have the custom field created. But I cannot seem to get the custom title to show up in the browser.
Where exactly to I put the code in the show file of the product page? I placed this
Thank you for your time.
Please Log in or Create an account to join the conversation.
If you're editing the file for another template than the one you're using, you won't see the change.
Please Log in or Create an account to join the conversation.
- Posts: 4
- Thank you received: 0
I believe so. I selected Displays > Views > show file (under frontend procuct show).
Is this correct?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I asked this question and you directed me to this post.
Since then I have been trying to do what is explained here but it's nit working.
Either I don't understand it or I don't do it correct.
To get custom page titles and override the default from Hikashop,
What file do I have to edit?
Is it the file "listing" of the view 'product'/'category' or the show file of the view product
And does it matter where i put this code: $doc =& JFactory::getDocument();
$doc->setTitle($this->element->custom_title); ?
Please Log in or Create an account to join the conversation.
If you want to change the title on the product pages, it's in the show file of the view product.
If you want to change the title on the products listing pages, it's in the listing file of the view product.
If you want to change the title on the categories listing pages, it's in the listing file of the view category.
You should add the code at the top, just after the first <?php tag
Finally, for categories and products listing pages, you will have to use a custom category field since the title will have to be entered in the current category of the elements displayed on the page.
Please Log in or Create an account to join the conversation.
When i edited the listing file of the view product and saved it I couldn't
see any of the views.
I end up getting the message that the product could not be found.
How can I change that or what do I have to do now?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
It was the file for the categories
Please Log in or Create an account to join the conversation.
We cannot reproduce it on our end.
Please Log in or Create an account to join the conversation.
Can I give you the login details so you can check it?
Please Log in or Create an account to join the conversation.
www.hikashop.com/en/contact-us.html
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.