Malemi Posted January 27, 2015 Share Posted January 27, 2015 (edited) Hello everyone, This is my first post, nice to meet you I need to set-up a custom URL in Default Theme stores.tpl template, I would like img to be linked to each individual shop. I have been able to call "store name" in URL, just need to call CMS page ID assigned to each shop page (I have rewriting ON), not talking about store ID <a href="http://www.mysite.com/{$cms->id}-{$store.name|escape:'html':'UTF-8'}"></a> Might you please help how to call page ID, {$cms->id} seems not working in stores.tpl template {foreach $stores as $store} <tr class="store-small"> <td class="logo"> {if $store.has_picture} <div class="store-image"> <a href="http://www.mysite.com/{$cms->id}-{$store.name|escape:'html':'UTF-8'}"> <img src="{$img_store_dir}{$store.id_store}.jpg" alt="" /> </a> [/color]</div> {/if} Original file from default theme stores.tpl {foreach $stores as $store} <tr class="store-small"> <td class="logo"> {if $store.has_picture} <div class="store-image"> <img src="{$img_store_dir}{$store.id_store}.jpg" alt="" /> </div> {/if} Thank you Cheers! Edited January 27, 2015 by Malemi (see edit history) Link to comment Share on other sites More sharing options...
Malemi Posted January 28, 2015 Author Share Posted January 28, 2015 Good morning, Have been reading this thread https://www.prestashop.com/forums/topic/154781-get-cms-id-in-template/ , have been trying using {$cms->id} Not working on 1.6 Might you please help ? THK Cheers! Link to comment Share on other sites More sharing options...
Malemi Posted February 2, 2015 Author Share Posted February 2, 2015 Hello everyone, Could you please help on this issue ? THK Cheers Link to comment Share on other sites More sharing options...
vekia Posted February 2, 2015 Share Posted February 2, 2015 i don't understand what you're trying to accomplish. $cms variable doesnt exist in stores.tpl file you have to alter stores controller if you want to use $cms variable in stores.tpl file. Link to comment Share on other sites More sharing options...
Malemi Posted February 4, 2015 Author Share Posted February 4, 2015 (edited) Vekia, hello Thaks for answering. Just would like custom link, placed in stores.tpl, to work for any current store links: <a href="http://www.mysite.com/{$cms->id}-{$store.name|escape:'html':'UTF-8'}"></a> I get this, CMS ID is missing: http://www.mysite.com/en/content/-storename Might you please help how to modify StoreController.php in order this to work in stores.tpl ? THKs Edited February 4, 2015 by Malemi (see edit history) Link to comment Share on other sites More sharing options...
Malemi Posted February 6, 2015 Author Share Posted February 6, 2015 Anyone willing to help with this ?? Vekia ? THKs Link to comment Share on other sites More sharing options...
Malemi Posted February 11, 2015 Author Share Posted February 11, 2015 Might you please help with this ? Thank you Cheers Link to comment Share on other sites More sharing options...
Malemi Posted April 22, 2015 Author Share Posted April 22, 2015 For anyone looking for the same, here it is a perfect workaround: http://www.prestaforum.com/instalacion-configuracion-y-personalizacion-de-prestashop/llamar-id-de-pagina-en-url-de-stores-tpl-(tema-default-1-6)/ Big thanks to "devoment" user ! 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