Community Forums

information links question

Template support & advice for OpenCart v1.x

information links question

Postby salomonsson » Thu Aug 02, 2012 11:04 am

Hi!

Can anyone please tell me how to link (link codes) specific information titles to different positions in the footer.
I mean for example, in stead of putting all the information in the same box which will be in the same column,I want to put "About us" in one column, "Terms of use" in another column.

Thank you very much for your kind help.
Salomonsson
salomonsson
 
Posts: 15
Joined: Thu Aug 02, 2012 10:40 am

Re: information links question

Postby MarketInSG » Thu Aug 02, 2012 12:18 pm

you edit catalog/view/theme/yourtheme/template/common/footer.tpl
User avatar
MarketInSG
 
Posts: 2613
Joined: Wed Nov 16, 2011 3:53 am
Location: Singapore

Re: information links question

Postby mcamca » Thu Aug 02, 2012 2:19 pm

salomonsson wrote:Hi!

Can anyone please tell me how to link (link codes) specific information titles to different positions in the footer.
I mean for example, in stead of putting all the information in the same box which will be in the same column,I want to put "About us" in one column, "Terms of use" in another column.

Thank you very much for your kind help.
Salomonsson

If you need more detailed help then state the titles for each box you want together with the items that you want under each title!
User avatar
mcamca
 
Posts: 149
Joined: Fri Aug 06, 2010 9:57 am

Re: information links question

Postby salomonsson » Thu Aug 09, 2012 11:58 pm

Hi Mcamca!

Thank you very much for your reply. I’ve got problem with the server and have to rebuild my web. Now I come back to this point again.

I want to have four boxes in footer and I would like them to be as follows:

Under Box 1 – Company Info
4 items:
About us (original footer)
Our blogs (a new page in Information, SEO URL : i-smycken-bloggar)
Terms of use (original footer)
Sitemap (original footer)

Under Box 2 – Sales info
5 items (all 5 are new pages in Information):
Orders and delivery (SEO URL: smycken-leverans)
Payment options (SEO URL: smycken-betalning)
Money Back Guarantee (SEO URL: smycken-angerratt)
Complaint and Return (SEO URL: smycken-retur)
Personal Information (SEO URL: smycken-personuppgifter)


Under Box 3 – Customer service
4 items:
Cotact us (original footer)
Returns (original footer)
Newsletter (original footer)
Tell a friend (a new module URL: index.php?route=information/tellafriend)

Under Box 4 – Extra info
5 items:
Presenkort (original footer)
Coupons & Gift Vouchers (a new page in Information SEO URL: smycken-kuponger )
Caring for Jewelry (a new page in Information SEO URL: varda-smycken)
Ring size guide (a new page in Information SEO URL: ringar-storlek )
Lengths of necklaces (a new page in Information SEO URL: halsband-langder )


I hope that I’ve given clear information. Except for the original footer items , I need codes for those new items (marked with red color). My website is bilingual.

I tried this way:
<li><a href="http://www.i-smycken.se/smycken-leverans">Orders and delivery </a></li>
But it seems that both language shows "Orders and delivery". It doesn't change to Swedish title when in Swedish page (when click the link in Swedish footer, it goes to Swedish page. The problem is that when it's in Information Box, it shows the Swedish title. As soon as I move it to another box using the above way,the title refuse to change to Swedish).

Can you please help me? I really get stuck here! This is almost my last step in finishing my website. A lot of thanks in advance!
Last edited by salomonsson on Fri Aug 10, 2012 10:39 am, edited 1 time in total.
salomonsson
 
Posts: 15
Joined: Thu Aug 02, 2012 10:40 am

Re: information links question

Postby salomonsson » Fri Aug 10, 2012 9:02 am

Hi MarketInSG !

Thank you very much for your reply. I have posted the details. In my case, what will be the codes for the links of new information pages and new modoules in footer.tpl for a bilingual website? If you can give one example of each case, then I can understand the constructure and do the rest by myself. Best regards Salomonsson
salomonsson
 
Posts: 15
Joined: Thu Aug 02, 2012 10:40 am

Re: information links question

Postby MarketInSG » Fri Aug 10, 2012 11:30 am

Have a read on this, it might help: http://www.opencartnews.com/tutorials/c ... rt-part-1/
User avatar
MarketInSG
 
Posts: 2613
Joined: Wed Nov 16, 2011 3:53 am
Location: Singapore

Re: information links question

Postby salomonsson » Fri Aug 10, 2012 5:14 pm

MarketInSG wrote:Have a read on this, it might help: http://www.opencartnews.com/tutorials/c ... rt-part-1/


Hi MarketInSG!

Thank you very much for your tips. Yes, I've done everything and have the pages ready to use.

For example, I have this page ready: http://www.i-smycken.se/smycken-betalning
It works properly under information box. But how can I move the link of this page to Extra Box and still can show English title in English page and Swedish title in Swedish page? ( What will be the codes in footer.tpl?)

You can see very clearly my question if you go to this page. I put the same link under both Information Box and Extra Box. (the last item). When yo click English, both show "Payment options". But when you click Swedish, under Information Box, the item changes to Swedish, but under Extra Box, it still shows " Payment Option".

As it shows only general link of Information Box in footer.tpl, so I don't know how to link each independent page.

With best regards
Salomonsson
salomonsson
 
Posts: 15
Joined: Thu Aug 02, 2012 10:40 am

Re: information links question

Postby MarketInSG » Sat Aug 11, 2012 1:50 am

Code: Select all
<?php foreach ($informations as information) {
if ($information['href'] == "place the link of the payment option here") { ?>
<li><a href="<?php echo $information['href']; ?>"><?php echo $information['title']; ?></a></li>
<?php } } ?>


use this code to replace the link under the extras column
User avatar
MarketInSG
 
Posts: 2613
Joined: Wed Nov 16, 2011 3:53 am
Location: Singapore

Re: information links question

Postby salomonsson » Sat Aug 11, 2012 2:47 am

MarketInSG wrote:
Code: Select all
<?php foreach ($informations as information) {
if ($information['href'] == "place the link of the payment option here") { ?>
<li><a href="<?php echo $information['href']; ?>"><?php echo $information['title']; ?></a></li>
<?php } } ?>


use this code to replace the link under the extras column


Thanks a lot, but sorry, the link is: http://www.i-smycken.se/smycken-betalning
When I put this under the extra column:

<?php foreach ($informations as information) {
if ($information['href'] = "http://www.i-smycken.se/smycken-betalning") { ?>
<li><a href="<?php echo $information['href']; ?>"><?php echo $information['title']; ?></a></li>
<?php } } ?>

It shows "Parse error: syntax error, unexpected ')', expecting T_PAAMAYIM_NEKUDOTAYIM in footer.tpl on line 27".

Have I made things correct?

Best regards
Salomonsson
salomonsson
 
Posts: 15
Joined: Thu Aug 02, 2012 10:40 am

Re: information links question

Postby MarketInSG » Sat Aug 11, 2012 4:26 am

show your codes
User avatar
MarketInSG
 
Posts: 2613
Joined: Wed Nov 16, 2011 3:53 am
Location: Singapore

Re: information links question

Postby salomonsson » Sat Aug 11, 2012 9:39 am

MarketInSG wrote:show your codes


<div id="footer">
<?php if ($informations) { ?>
<div class="column">
<h3><?php echo $text_information; ?></h3>
<ul>
<?php foreach ($informations as $information) { ?>
<li><a href="<?php echo $information['href']; ?>"><?php echo $information['title']; ?></a></li>
<?php } ?>
</ul>
</div>
<?php } ?>

<div class="column">
<h3><?php echo $text_account; ?></h3>
<ul>

<li><a href="<?php echo $order; ?>"><?php echo $text_order; ?></a></li>
<li><a href="<?php echo $wishlist; ?>"><?php echo $text_wishlist; ?></a></li>
<li><a href="<?php echo $newsletter; ?>"><?php echo $text_newsletter; ?></a></li>
</ul>
</div>

<div class="column">
<h3><?php echo $text_service; ?></h3>
<ul>
<li><a href="<?php echo $contact; ?>"><?php echo $text_contact; ?></a></li>
<li><a href="<?php echo $return; ?>"><?php echo $text_return; ?></a></li>
<li><a href="<?php echo $sitemap; ?>"><?php echo $text_sitemap; ?></a></li>
</ul>
</div>

<div class="column">
<h3><?php echo $text_extra; ?></h3>
<ul>
<li><a href="<?php echo $manufacturer; ?>"><?php echo $text_manufacturer; ?></a></li>
<li><a href="<?php echo $voucher; ?>"><?php echo $text_voucher; ?></a></li>
<li><a href="<?php echo $affiliate; ?>"><?php echo $text_affiliate; ?></a></li>
<li><a href="<?php echo $special; ?>"><?php echo $text_special; ?></a></li>
</ul>
</div>

</div>
<!--
OpenCart is open source software and you are free to remove the powered by OpenCart if you want, but its generally accepted practise to make a small donation.
Please donate via PayPal to donate@opencart.com
//-->
<div id="powered"><a href="http://www.i-smycken.se">i-Smycken.se</a>, jewelry online. <p>New <a href="http://www.i-smycken.se/halsband/">Necklaces</a> ,<a href="http://www.i-smycken.se/armband/">Bracelets</a> , <a href="http://www.i-smycken.se/orhangen/">Earrings</a> ,<a href="http://www.i-smycken.se/ringar/">Rings</a> ,och <a href="http://www.i-smycken.se/accessorier">Other accessoriesr</a> every day<p> </a>Copyright © 2012 i-smycken.se. All Rights Reserved. <a mailto:info@-smycken.se">:info@-smycken.se </a></cneter> &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://feeds.feedburner.com/i-smycken" title=" Prenumerera i-Smycken RSS " rel="alternate" type="application/rss+xml"><img src="http://www.feedburner.com/fb/images/pub/feed-icon32x32.png" alt="" style="border:0"/></a><a href="http://feeds.feedburner.com/i-smycken" title="Subscribe to my feed" rel="alternate" type="application/rss+xml"></div>
</body></html>
salomonsson
 
Posts: 15
Joined: Thu Aug 02, 2012 10:40 am

Re: information links question

Postby mcamca » Sat Aug 11, 2012 11:08 am

salomonsson wrote:
MarketInSG wrote:
Code: Select all
<?php foreach ($informations as information) {
if ($information['href'] == "place the link of the payment option here") { ?>
<li><a href="<?php echo $information['href']; ?>"><?php echo $information['title']; ?></a></li>
<?php } } ?>


use this code to replace the link under the extras column


Thanks a lot, but sorry, the link is: http://www.i-smycken.se/smycken-betalning
When I put this under the extra column:

<?php foreach ($informations as information) {
if ($information['href'] = "http://www.i-smycken.se/smycken-betalning") { ?>
<li><a href="<?php echo $information['href']; ?>"><?php echo $information['title']; ?></a></li>
<?php } } ?>

It shows "Parse error: syntax error, unexpected ')', expecting T_PAAMAYIM_NEKUDOTAYIM in footer.tpl on line 27".

Have I made things correct?

Best regards
Salomonsson

Yes, you have made a mistake.
The line:
Code: Select all
if ($information['href'] = "http://www.i-smycken.se/smycken-betalning") { ?>
should be:
Code: Select all
if ($information['href'] == "http://www.i-smycken.se/smycken-betalning") { ?>
ie. in this line of code you should use == NOT =
User avatar
mcamca
 
Posts: 149
Joined: Fri Aug 06, 2010 9:57 am

Re: information links question

Postby mcamca » Sat Aug 11, 2012 12:54 pm

To make room for an extra column in the footer in:
catalog/view/theme/yourtheme/stylesheet/stylesheet.css
Change:
Code: Select all
#footer .column {
   float: left;
   width: 25%;
   min-height: 100px;
}
to:
Code: Select all
#footer .column {
   float: left;
   width: 20%;
   min-height: 100px;
}
You can then add another column to the footer in footer.tpl
You may also find the following useful!
To make the language change you should include the new item/s in both of the language files and define them in the controller footer.php
But a way that does not need these files changing is as follows:
In footer.tpl:
eg. for Necklaces use:
Code: Select all
<li><a href="http://www.i-smycken.se/halsband/"><?php $lang = $this->language->get('code'); if ($lang == "en") {echo "Necklaces";} elseif ($lang == "sv") {echo "Halsband";} else {echo "Necklaces";} ?></a></li>

or:
Code: Select all
<a href="http://www.i-smycken.se/halsband/"><?php $lang = $this->language->get('code'); if ($lang == "en") {echo "Necklaces";} elseif ($lang == "sv") {echo "Halsband";} else {echo "Necklaces";} ?></a>

if its not part of a list.
You can use the same principle for the column header or any other words.
TAKE NOTE IN THE ABOVE OF WHERE = IS USED OR ==
Tell us how you get on!
User avatar
mcamca
 
Posts: 149
Joined: Fri Aug 06, 2010 9:57 am

Re: information links question

Postby salomonsson » Sat Aug 11, 2012 11:02 pm

mcamca wrote:To make room for an extra column in the footer in:
catalog/view/theme/yourtheme/stylesheet/stylesheet.css
Change:
Code: Select all
#footer .column {
   float: left;
   width: 25%;
   min-height: 100px;
}
to:
Code: Select all
#footer .column {
   float: left;
   width: 20%;
   min-height: 100px;
}
You can then add another column to the footer in footer.tpl
You may also find the following useful!
To make the language change you should include the new item/s in both of the language files and define them in the controller footer.php
But a way that does not need these files changing is as follows:
In footer.tpl:
eg. for Necklaces use:
Code: Select all
<li><a href="http://www.i-smycken.se/halsband/"><?php $lang = $this->language->get('code'); if ($lang == "en") {echo "Necklaces";} elseif ($lang == "sv") {echo "Halsband";} else {echo "Necklaces";} ?></a></li>

or:
Code: Select all
<a href="http://www.i-smycken.se/halsband/"><?php $lang = $this->language->get('code'); if ($lang == "en") {echo "Necklaces";} elseif ($lang == "sv") {echo "Halsband";} else {echo "Necklaces";} ?></a>

if its not part of a list.
You can use the same principle for the column header or any other words.
TAKE NOTE IN THE ABOVE OF WHERE = IS USED OR ==
Tell us how you get on!


Hi Guys!
You are really great. Now my problem is solved. Thank you very much for your time and help.

With best regard
Salomonsson
salomonsson
 
Posts: 15
Joined: Thu Aug 02, 2012 10:40 am


Return to Template Support

Who is online

Users browsing this forum: Exabot [Bot] and 13 guests

Hosted by Arvixe Web Hosting