Jump to content

how to add html in top menu


Recommended Posts

 

If we need to buy one we know where to find it!! If you don't want to help us, don't make marketing!! One of the biggest DISLIKE of my entire life!! :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r:

  • Like 1
Link to comment
Share on other sites

modules/blocktopmenu/blocktopmenu.tpl

 

or if exist: themes/yourtheme/blocktopmenu/blocktopmenu.tpl

 

Vekia, I saw in some posts about the horizontal menu that tpl makes the job, but I tried to find out (deleting the content of tpl) and nothing happened.. everything works properly.. i think they hide the html coding inside some php file or worse inside js....

Link to comment
Share on other sites

Vekia, I saw in some posts about the horizontal menu that tpl makes the job, but I tried to find out (deleting the content of tpl) and nothing happened.. everything works properly.. i think they hide the html coding inside some php file or worse inside js....

 

in this files you can find the {$MENU} value, that contains html. It is assign here: blocktopmenu.php -> hookDisplayTop()

 

If we need to buy one we know where to find it!! If you don't want to help us, don't make marketing!! One of the biggest DISLIKE of my entire life!! :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r: :ph34r:

 

I didn't do any marketing, but this modules will save a lot of time for you or any other man. If you don't have money to buy one of this modules, community is not want know about it. Your dislike you can post with personal message for me.

Link to comment
Share on other sites

16px-Peace_sign.svg.png peace guys

 

so, what is the main case in this thread now?

 

I need a way to put ids in top horizontal menu elements in order to edit them separately in css.. i want to make the module look like the menu on this site www.e-shop.gr

 

or whatever is your suggestion in order to have as closer result to this as possible! Thanx again my prestas-icon!!

Link to comment
Share on other sites

by default, unfortunately, elements in top horizontal menu haven't got own classes / id

to achieve this you have to edit core of the module.

 

i will show you how to achieve this on example of the CMS link.

 

i the code you've got:

 

case 'CMS_CAT':
$category = new CMSCategory((int)$id, (int)$id_lang);
if (count($category))
{
$this->_menu .= '<li><a href="'.$category->getLink().'">'.$category->name.'</a>';
$this->getCMSMenuItems($category->id);
$this->_menu .= '</li>'.PHP_EOL;
}
break;

 

you need to include id to the <li> element:

 

$this->_menu .= '<li><a href="'.$category->getLink().'" id="cms_menu_item_'.$id.'">'.$category->name.'</a>';

 

 

then main menu elements related to the CMS pages will have got own id: cms_menu_item_$id where the $id is ID number of the CMS page / category

 

 

unfortunately, if you want to achieve this for other elements (like categories of products) you have to modify code related to it (you will see the code in the source, just use the same method as I used for cms pages)

 

let me know if you've got questions ;)

  • Like 2
Link to comment
Share on other sites

by default, unfortunately, elements in top horizontal menu haven't got own classes / id

to achieve this you have to edit core of the module.

 

i will show you how to achieve this on example of the CMS link.

 

i the code you've got:

 

case 'CMS_CAT':
$category = new CMSCategory((int)$id, (int)$id_lang);
if (count($category))
{
$this->_menu .= '<li><a href="'.$category->getLink().'">'.$category->name.'</a>';
$this->getCMSMenuItems($category->id);
$this->_menu .= '</li>'.PHP_EOL;
}
break;

 

you need to include id to the <li> element:

 

$this->_menu .= '<li><a href="'.$category->getLink().'" id="cms_menu_item_'.$id.'">'.$category->name.'</a>';

 

 

then main menu elements related to the CMS pages will have got own id: cms_menu_item_$id where the $id is ID number of the CMS page / category

 

 

unfortunately, if you want to achieve this for other elements (like categories of products) you have to modify code related to it (you will see the code in the source, just use the same method as I used for cms pages)

 

let me know if you've got questions ;)

 

Thank you for the guidelines.. For now I put a totally custom menu.. I deleted everything inside of blocktopmenu.tpl (i left only the outer div) and I want to make it the easy way ;)

 

** for now the e-shop is closed.. if you want to check it out.. send me pm your ip to put it inside ;)

Link to comment
Share on other sites

  • 1 month later...

Hi Vekia,

In Modules > Top Horizontal Menu > Configure, you can only select CMS pages, manufacturers, suppliers etc. You can't select the contact form from the list because it is none of the above. I'm talking about themes/contact-form.php.

 

So I try to add a link in the section below, where is says 'Add Top Menu Link', but this doesn't work. When I try to save it it says 'Link successfully added', but the link doesn't appear anywhere.

Link to comment
Share on other sites

  • 3 months later...

Thank!!!!

by default, unfortunately, elements in top horizontal menu haven't got own classes / id
to achieve this you have to edit core of the module.

i will show you how to achieve this on example of the CMS link.

i the code you've got:
 

case 'CMS_CAT':
$category = new CMSCategory((int)$id, (int)$id_lang);
if (count($category))
{
$this->_menu .= '<li><a href="'.$category->getLink().'">'.$category->name.'</a>';
$this->getCMSMenuItems($category->id);
$this->_menu .= '</li>'.PHP_EOL;
}
break;
you need to include id to the <li> element:

$this->_menu .= '<li><a href="'.$category->getLink().'" id="cms_menu_item_'.$id.'">'.$category->name.'</a>';

then main menu elements related to the CMS pages will have got own id: cms_menu_item_$id where the $id is ID number of the CMS page / category


unfortunately, if you want to achieve this for other elements (like categories of products) you have to modify code related to it (you will see the code in the source, just use the same method as I used for cms pages)

let me know if you've got questions ;)

 

Link to comment
Share on other sites

  • 6 months later...

I changed blocktopmenu.php file. I moved one step farther, just now I have classes assigned to case PRD, CMS and CMS_CAT and I did it like it is described here. But what I actually need is to assign class to case CAT, but code looks like this:

case 'CAT':
($this->_menu .= $this->generateCategoriesMenu(Category::getNestedCategories($id, $id_lang, true, $this->user_groups)))    ;
break;

and I don't know how to do it.

Link to comment
Share on other sites

×
×
  • Create New...