Post by DIHI » Mon Dec 18, 2017 3:50 am

Hello

How can I display a link to our about us page on the top navigation bar?

Thanks in advance :)

New member

Posts

Joined
Sun Nov 30, 2014 12:44 am

Post by straightlight » Mon Dec 18, 2017 4:04 am

No OC version posted. In catalog/controller/common/header.php file,

find:

Code: Select all

// Wishlist
add above:

Code: Select all

$this->load->model('catalog/information');

		$data['informations'] = array();

		foreach ($this->model_catalog_information->getInformations() as $result) {
			if ((int)$result['information_id'] == X) {
				$data['informations'][] = array(
					'title' => $result['title'],
					'href'  => $this->url->link('information/information', 'information_id=' . $result['information_id'])
				);
			}
		}
		
Note: Replace the X in the condition with your actual information ID where it leads to the About Us page.

Then, in your catalog/view/theme/<your_theme>/common/header.twig file,

use the informations array where you want:

Code: Select all

{{ informations }}
To create the loop. Follow the example from footer.tpl file.

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by DIHI » Mon Dec 18, 2017 4:10 am

Thank you Starlight I shall have a play this evening and see if I can make it work :)

New member

Posts

Joined
Sun Nov 30, 2014 12:44 am
Who is online

Users browsing this forum: No registered users and 11 guests