In this guide i want to show you how easily you can create ribbon style menu based on official module named horizontal top menu (blocktopmenu). In this guide we will use free html block module. To create this nice modification we will use css and simple html code. Effect of the modification you can check on image below:
ribbon style menu in prestashop - default menu modification
or just see it live here: block top menu ribbon desing
Ribbon style top horizontal menu
Html block free module installation
First step of this modification is related to free html block module installation. Just install it as you install other prestashop modules. After module installation go to modules > positions tab in your back office and search for "displayTop" modules list. On this module list search for installed html block free module and move it to the top of the list. You can drag'n'drop it as i show on video (click).
Image for ribbon style
I will use images uploaded to imgur service, but you can of course upload these images to your server, then in code below you will need to use own links instead of links to imgur that i used. You have to use these images:
left ribbon |
this ribbon image is used for left hand side part of the menu to display "left ribbon effect" |
|
background |
this is background image for whole menu | |
right ribbon |
this ribbon image is used for right hand side part of the menu to display "right ribbon effect" |
Prepare the code for modified menu
Then open module configuration page. From the left hand side block select "Top". Right hand side textarea is a place where you have to paste the code:
<div style="width: 41px; height:37px; display:block; position:absolute; top: 117px; right: -23px; z-index:1; background:url('http://i.imgur.com/rMFy4fO.gif')"></div> <div style="width: 41px; height:37px; display:block; position:absolute; top: 117px; left: -23px; z-index:1; background:url('http://i.imgur.com/XqLnQRX.gif')"></div>
and this css code:
<style> .sf-contener{ z-index: 2!important; position: relative!important; } .sf-menu{ background: url('http://i.imgur.com/MIH6C41.gif')!important; height: 38px!important; } .sf-menu a{ display: block!important; margin-right: 2px!important; padding: 0 30px!important; line-height: 38px!important; border: 0!important; text-decoration: none!important; } </style>
Paste whole code to html block, and then just save changes. Refresh your front office page, and you will see your default block top menu module with nice ribbon effect. If you've got problems with left / right hand side "ribbon effect" check last part of this article:
Possible problems
If for some reasons ribbon images doesn't fit to your menu, it's because of top:117px; params. You have to increase / decrease this param values, both for left and right ribbon style image. In this case (left image) you have to increase it a bit, for example to 140px; but in fact, everything depends on other things like number of elements you've got in the top section. Just try several solutions, it will work as you want.