Jump to content

[Solved] Help with Top Horizontal Menu


Redous

Recommended Posts

Okay, so I have been reading the forums about modifications to the block module top navigation block. I have successfully created a page for each of my links I want in a drop menu as described in the below forum

 

https://www.prestashop.com/forums/topic/286948-solved-top-horizontal-menu-create-submenu-links

 

Now having done that I would like to find a way of giving the actual menu header a defined link.

 

so instead of the link being 

 

http://www.mysite.com/different/content/category/3-Lingerie

 

I would like it to be

 

http://www.sites.sphyx.com/different/search?controller=search&orderby=position&orderway=desc&search_query=Lingerie&submit_search

 

Preferably using the above-linked method.

 

 

My Website

http://www.sites.sphyx.com/different/

Edited by Redous (see edit history)
Link to comment
Share on other sites

Hi,

 

Just an update I been trying different codes but still doesn't work in blocktopmenu.php

			foreach ($categories as $category)
			{
				$cat = new CMSCategory((int)$category['id_cms_category'], (int)$id_lang);
				$links = $cat->getLinks((int)$id_lang, array((int)$cat->id));
				
				$selected = ($this->cat_name == 'cms' && ((int)Tools::HtmlEntitiesUTF8($cat->getLink()))) ? ' class="sfHoverForce"' : '';
				
				if ($cat->id_cms_category==3){
					$this->_menu .= '<li '.$selected.'>';
					$this->_menu .= '<a href="http://www.mysite.com/Lingerie">'.$cms->meta_title.'</a>';
					$this->_menu .= '</li>';
                } else {
					$this->_menu .= '<li>';
					$this->_menu .= '<a href="'.Tools::HtmlEntitiesUTF8($cat->getLink()).'">'.$category['name'].'</a>';
					$this->getCMSMenuItems($category['id_cms_category'], (int)$depth + 1);
					$this->_menu .= '</li>';
				}
			}
Edited by Redous (see edit history)
Link to comment
Share on other sites

Okay,

 

Still working on this got the link to work

 

however, this stops it from being a drop-down.

 

Just so we are clear on what I am trying to accomplish, the link Lingerie that brings down the drop down menu links to a category in CMS I want to be able to define this link using the method used previously.

 

20150910205258495.png

Edited by Redous (see edit history)
Link to comment
Share on other sites

Here is the code i have so far on line 498 of blocktopmenu.php

				case 'CMS_CAT':
					$category = new CMSCategory((int)$id, (int)$id_lang);
					$links = $category->getLinks((int)$id_lang, array((int)$category->id));
					
					$selected = ($this->page_name == 'category' && ((int)Tools::HtmlEntitiesUTF8($category->getLink()))) ? ' class="sfHoverForce"' : '';
					
					if (count($category)) {
						if($category->id == 3){
						$this->_menu .= '<li '.$selected.'>';
						$this->_menu .= '<a href="http://www.sites.sphyx.com/different/search?controller=search&orderby=position&orderway=desc&search_query=Lingerie&submit_search">'.$category->name.'</a>';
						$this->_menu .= '</li>';
						} else {
						$this->_menu .= '<li><a href="'.$category->getLink().'">'.$category->name.'</a>';	
						$this->getCMSMenuItems($category->id);
						$this->_menu .= '</li>'.PHP_EOL;
						}
					}
				break;
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...