简体   繁体   中英

How to add class name to a block in prestashop 1.7

I'm currently using prestashop 1.7.4.3, I need to edit the header.tpl file in the _partials . I barely know about this framework.

My problem is:

What I attempted: Tried to add a custom class name for the header logo

 <div class="col-md-2 hidden-sm-down hlogo" id="_desktop_logo"> {if $page.page_name == 'index'} <h1> <a href="{$urls.base_url}"> <img class="logo img-responsive" src="{$shop.logo}" alt="{$shop.name}"> </a> </h1> {else} <a href="{$urls.base_url}"> <img class="logo img-responsive" src="{$shop.logo}" alt="{$shop.name}"> </a> {/if} </div>

As you can see I have added hlogo a custom class to the header logo and I tried display:none in my custom.css

My problem is: The newly added class name is not updated in the front office.

Guide me if I made anything wrong!

As I said before, try clear your cache

To clear cache: Go to Back office Configure/Advanced Parameters/Performance/Clear Cache

You can find the clear cache button in the top right corner in the back office.

Also you can clear cache manually from root_folder/var/cache/dev/smarty/cache

If the problem persists to continue re-check the file you are editing make sure you are editing the correct theme's files

As Viira said, you need to clear your cache. You can do this within your admin panel by going to Configure -> Advanced Parameters -> Performance and press button Clear cache(right top corner) or you can delete it forcibly by clearing folders root_folder/var/cache/dev/smarty/cache and root_folder/var/cache/dev/smarty/compile .

And also it's better to turn off Cache and turn on Template compilation until you will not finish all your customizations. You can do this in Configure -> Advanced Parameters -> Performance as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM