detlev Posted October 19, 2013 Share Posted October 19, 2013 Hi guys, I'm trying to figure out how to edit or add the H2 tags to the product pages of my website. I found the product.tpl file in my theme and the H2 tag should be in the short description block (the text that you can read should be the H2) I found this : {if $product->description_short OR $packItems|@count > 0} <div id="short_description_block"> {if $product->description_short} <div id="short_description_content" class="rte align_justify">{$product->description_short}</div> {/if} But i don't know how to add the H2 tags here. I hope someone can help me. Thanks Link to comment Share on other sites More sharing options...
vekia Posted October 19, 2013 Share Posted October 19, 2013 <h2>{$product->description_short}</h2> for what purposes you want to define h2 tags there? Link to comment Share on other sites More sharing options...
detlev Posted October 19, 2013 Author Share Posted October 19, 2013 There is no H2 tag in Prestashop standard. Therefore i would like to make a H2 tag and this should be the correct option? Do you have a better idea? This is meant for SEO purposes. Link to comment Share on other sites More sharing options...
detlev Posted October 19, 2013 Author Share Posted October 19, 2013 <h2>{$product->description_short}</h2> for what purposes you want to define h2 tags there? That doesn't seem to work, when i change it the product page goes blank Link to comment Share on other sites More sharing options...
vekia Posted October 19, 2013 Share Posted October 19, 2013 can you show your code? blank page mean that you use some wrong code. Link to comment Share on other sites More sharing options...
detlev Posted October 19, 2013 Author Share Posted October 19, 2013 <div id="pb-left-column"> {if $product->description_short OR $packItems|@count > 0} <div id="short_description_block"> {if $product->description_short} <div id="short_description_content" class="rte align_justify">{$product->description_short}</div> {/if} {if $product->description} <p class="buttons_bottom_block"><a href="javascript:{ldelim}{rdelim}" class="button">{l s='More details'}</a></p> {/if} {if $packItems|@count > 0} <h3>{l s='Pack content'}</h3> {foreach from=$packItems item=packItem} <div class="pack_content"> {$packItem.pack_quantity} x <a href="{$link->getProductLink($packItem.id_product, $packItem.link_rewrite, $packItem.category)}">{$packItem.name|escape:'htmlall':'UTF-8'}</a> <p>{$packItem.description_short}</p> </div> {/foreach} {/if} </div> {/if} This is the original. <div id="pb-left-column"> {if $product->description_short OR $packItems|@count > 0} <div id="short_description_block"> {if $product->description_short} <div id="short_description_content" class="rte align_justify"><h2>{$product->description_short}</h2></div> {/if} {if $product->description} <p class="buttons_bottom_block"><a href="javascript:{ldelim}{rdelim}" class="button">{l s='More details'}</a></p> {/if} {if $packItems|@count > 0} <h3>{l s='Pack content'}</h3> {foreach from=$packItems item=packItem} <div class="pack_content"> {$packItem.pack_quantity} x <a href="{$link->getProductLink($packItem.id_product, $packItem.link_rewrite, $packItem.category)}">{$packItem.name|escape:'htmlall':'UTF-8'}</a> <p>{$packItem.description_short}</p> </div> {/foreach} {/if} </div> {/if} Link to comment Share on other sites More sharing options...
detlev Posted October 19, 2013 Author Share Posted October 19, 2013 Please check link : http://www.slaapzakken-discounter.nl/gelert-slaapzak/27-gelert-slaapzak-tryfan-classic-300-dl.html This is how the short description looks like now Link to comment Share on other sites More sharing options...
vekia Posted October 19, 2013 Share Posted October 19, 2013 hello you've got there h2 tag. it's because of this it looks bigger. this is normal. if you want to change size of the font, you need to create new css styles #short_description_block h2 {font-size:12px;} Link to comment Share on other sites More sharing options...
detlev Posted October 20, 2013 Author Share Posted October 20, 2013 Wonderfull, that works like a charm! Is there anyway i can add H2 tags to the catagory page? Just add a few words or make the description the h2. Many thanks! Link to comment Share on other sites More sharing options...
vekia Posted October 20, 2013 Share Posted October 20, 2013 in this case you can do it in two ways: 1) in category description 2) in category.tpl file everything depends on you. I think that first option is much better and easiest. Link to comment Share on other sites More sharing options...
detlev Posted October 20, 2013 Author Share Posted October 20, 2013 Can you explain both options? Link to comment Share on other sites More sharing options...
vekia Posted October 21, 2013 Share Posted October 21, 2013 1) just open category.tpl file and add <h2></h2> tags anywhere you want. 2) while you create a category you can define category description. You can add <h2></h2> tags there in description editor Link to comment Share on other sites More sharing options...
detlev Posted October 21, 2013 Author Share Posted October 21, 2013 Hi, So i've changed the category.tpl into : </div> {/if} {/if} {if $category->description} <div class="cat_desc"><h2>{$category->description}</h2></div> {/if} {if isset($subcategories)} <!-- Subcategories --> <div id="subcategories"> <h3>{l s='Subcategories'}</h3> <ul class="inline_list"> {foreach from=$subcategories item=subcategory} <li> Now only the CSS.. what should i put there? Link to comment Share on other sites More sharing options...
vekia Posted October 21, 2013 Share Posted October 21, 2013 use this: .cat_desc h2 {font-size:12px; background:none; text-decoration:none; text-transform:none; font-weight:normal; display:block; clear:both; overflow:hidden; height:auto;} effect: Link to comment Share on other sites More sharing options...
detlev Posted October 21, 2013 Author Share Posted October 21, 2013 Wow! You are the best! One more question, i would like to hide the php extensions in the URL. With the option multiview in the Htacces it has no effect. Do you know a how i can make that adjustment? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now