Where and/or how can I edit the parent category link?
For example I want two main parent links at the top of my navigation to simply link to an external blog page and one to an external auction page store.
I can't find anywhere to enter the link address. I guess that goes for sub-categories too? Is there a way to do this? I don't need every single category to go to an internal page on my site.
Thanks!
For example I want two main parent links at the top of my navigation to simply link to an external blog page and one to an external auction page store.
I can't find anywhere to enter the link address. I guess that goes for sub-categories too? Is there a way to do this? I don't need every single category to go to an internal page on my site.
Thanks!
Edit the header.tpl of your current theme and insert your links manualy.
This is the default code for categories:
This is the default code for categories:
With your links , should look something like this:<?php if ($categories) { ?>
<div id="menu">
<ul>
<?php foreach ($categories as $category) { ?>
<li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
<?php if ($category['children']) { ?>
<div>
<?php for ($i = 0; $i < count($category['children']);) { ?>
<ul>
<?php $j = $i + ceil(count($category['children']) / $category['column']); ?>
<?php for (; $i < $j; $i++) { ?>
<?php if (isset($category['children'][$i])) { ?>
<li><a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a></li>
<?php } ?>
<?php } ?>
</ul>
<?php } ?>
</div>
<?php } ?>
</li>
<?php } ?>
</ul>
</div>
<?php } ?>
<?php if ($categories) { ?>
<div id="menu">
<ul>
<?php foreach ($categories as $category) { ?>
<li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
<?php if ($category['children']) { ?>
<div>
<?php for ($i = 0; $i < count($category['children']);) { ?>
<ul>
<?php $j = $i + ceil(count($category['children']) / $category['column']); ?>
<?php for (; $i < $j; $i++) { ?>
<?php if (isset($category['children'][$i])) { ?>
<li><a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a></li>
<?php } ?>
<?php } ?>
</ul>
<?php } ?>
</div>
<?php } ?>
</li>
<?php } ?>
<li> <a href="http://outside location">Blog</a></li>
<li> <a href="http://outside location">Another external link</a></li>
</ul>
</div>
<?php } ?>
Awesome. Worked like a charm. I'm a noob and having a hard time just finding where certain module are located to edit them manually to my liking. Thanks again!
For other languages/multilanguage.
Edit the file catalog/controller/common/header.php
and after the line
introduce your links text like this:
Now edit the catalog/language/*/common/header.php and for each link above add its text like this;
Insert it after the comment line:
like this:
Now, in the header.tpl file mentioned few posts above , the added lines should look like:
Edit the file catalog/controller/common/header.php
and after the line
Code: Select all
$this->data['text_checkout'] = $this->language->get('text_checkout');
Code: Select all
$this->data['text_onelink'] = $this->language->get('text_onelink');
$this->data['text_anotherlink'] = $this->language->get('text_anotherlink');
Insert it after the comment line:
Code: Select all
// Text
Code: Select all
$_['text_onelink'] = 'The link name';
$_['text_anotherlink'] = 'Another link name';
Code: Select all
<li> <a href="http://outside location"><?php echo $text_onelink; ?></a></li>
<li> <a href="http://outside location"><?php echo $text_anotherlink; ?></a></li>
I get duplicate links on my category header. Both english and spanish links with the other switching from the text_spanishlink and text_englishlink when switching languages. I followed all steps correctly above and am using 1.5.4.1
take a look here http://www.mandamexico.com
take a look here http://www.mandamexico.com
My Extensions
OpenCart Developer (OCD) Tools
Donate - If I ever helped you.
You are not supposed to make 2 variable one for english and one for spanish, please review the code above. There should be only one variable text_link that takes its value from language , and in the language file you will have taxt_link = something in the english file and text_link = something else in the language file.
in the header.tpl file there should only be one variable? please advise im not sure where to have only one whether it be the header.php or .tpl file because it breaks when i remove one variable from the php and tpl files.
your instructions are confusing because u wrote two examples. i thought each example represented a diff language which was what the original poster wanted. my site still looks messed up
this might not work for the new 1.5.4.1 structure because i tried it EXACTLY how you posted in the instructions above to no avail please help!
your instructions are confusing because u wrote two examples. i thought each example represented a diff language which was what the original poster wanted. my site still looks messed up
this might not work for the new 1.5.4.1 structure because i tried it EXACTLY how you posted in the instructions above to no avail please help!
My Extensions
OpenCart Developer (OCD) Tools
Donate - If I ever helped you.
here is my common/header.php code
here is my common/header.tpl code
language file in spanish
english language file
Code: Select all
$this->data['text_account'] = $this->language->get('text_account');
$this->data['text_checkout'] = $this->language->get('text_checkout');
$this->data['text_spanishlink'] = $this->language->get('text_spanishlink');
$this->data['text_englishlink'] = $this->language->get('text_englishlink');
Code: Select all
<?php } ?>
<?php } ?>
</ul>
<?php } ?>
</div>
<?php } ?>
</li>
<?php } ?>
<li><a href="http://mandamexico.com/silver-membership"><?php echo $text_spanishlink; ?></a></li>
<li><a href="http://mandamexico.com/silver-membership"><?php echo $text_englishlink; ?></a></li>
</ul>
</div>
<?php } ?>
<div id="notification"></div>
Code: Select all
$_['text_account'] = 'Mi Cuenta';
$_['text_checkout'] = 'Realizar Pedido';
$_['text_spanishlink'] = 'Membresia de Plata';
?>
Code: Select all
$_['text_account'] = 'My Account';
$_['text_checkout'] = 'Checkout';
$_['text_englishlink'] = 'Silver Membership';
?>
My Extensions
OpenCart Developer (OCD) Tools
Donate - If I ever helped you.
You dont seem to understand how the language part works.
you dont need to have in the header.php controller:
you need to have only:
then in the language english file:
and in the spanish langage file:
and finaly, in the tpl, have just 1 line:
you dont need to have in the header.php controller:
Code: Select all
$this->data['text_spanishlink'] = $this->language->get('text_spanishlink');
$this->data['text_englishlink'] = $this->language->get('text_englishlink');
Code: Select all
$this->data['text_link'] = $this->language->get('text_link');
Code: Select all
$_['text_link'] = 'Silver Membership';
Code: Select all
$_['text_link'] = 'Membresia de Plata';
Code: Select all
<li><a href="http://mandamexico.com/silver-membership"><?php echo $text_link; ?></a></li>
yes i didnt understand it. thanks now i do! your last explanation was perfect!!
My Extensions
OpenCart Developer (OCD) Tools
Donate - If I ever helped you.
Hi Florinsith,
Thanks for taking the time to answer. My code looks like the following (actual URLs replaced):
Thanks for taking the time to answer. My code looks like the following (actual URLs replaced):
Code: Select all
<div class="links"><a href="<?php echo $home; ?>"><?php echo $text_home; ?></a><a href="<?php echo $wishlist; ?>" id="wishlist-total"><?php echo $text_wishlist; ?></a><a href="<?php echo $account; ?>"><?php echo $text_account; ?></a><a href="<?php echo $shopping_cart; ?>"><?php echo $text_shopping_cart; ?></a><a href="<?php echo $checkout; ?>"><?php echo $text_checkout; ?></a></div>
</div>
<?php if ($categories) { ?>
<div id="menu">
<ul>
<?php foreach ($categories as $category) { ?>
<li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
<?php if ($category['children']) { ?>
<div>
<?php for ($i = 0; $i < count($category['children']);) { ?>
<ul>
<?php $j = $i + ceil(count($category['children']) / $category['column']); ?>
<?php for (; $i < $j; $i++) { ?>
<?php if (isset($category['children'][$i])) { ?>
<li><a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a></li>
<?php } ?>
<?php } ?>
</ul>
<?php } ?>
</div>
<?php } ?>
</li>
<?php } ?>
<li> <a href="http://www.external_link.co.uk/">Main_1</a>
<ul>
<li><a href="/notebooks/notebooks-macs">Sub_1</a></li>
<li><a href="/notebooks/notebooks-windows">Sub_2</a></li>
<li><a href="/notebooks/notebooks-macs">Sub_3</a></li>
<li><a href="/notebooks/notebooks-macs">Sub_4</a></li>
<li><a href="/notebooks/notebooks-macs">Sub_5</a></li>
</ul></li>
</ul>
</div>
The sublist must be in a div:
Code: Select all
<li> <a href="http://www.external_link.co.uk/">Main_1</a>
<div><ul>
<li><a href="/notebooks/notebooks-macs">Sub_1</a></li>
<li><a href="/notebooks/notebooks-windows">Sub_2</a></li>
<li><a href="/notebooks/notebooks-macs">Sub_3</a></li>
<li><a href="/notebooks/notebooks-macs">Sub_4</a></li>
<li><a href="/notebooks/notebooks-macs">Sub_5</a></li>
</ul></div></li>
Who is online
Users browsing this forum: No registered users and 88 guests