Forums / Templates, Stylesheets, Page Layout / Questions about adding text & links to footer

Questions about adding text & links to footer

Locked

Views: 2,059

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
2 Dec 2009, 8:03 AM
#1
cslakans avatar

cslakans

New Zenner

Join Date:
Mar 2009
Posts:
64
Plugin Contributions:
0

Questions about adding text & links to footer

  1. I was reviewing previous posts about adding text (no hyperlinks) to a footer and followed the directions of this old thread....

http://www.zen-cart.com/forum/showthread.php?t=108238

It added my footer text, however it did not add to the correct area. If you check my site at http://animalsuperstore.com/zenpro/index.php you will see that it didn't add to the green grass area like the other links I've been adding. Anyone know how I can fix this?

  1. Also, I was also adding the links and if you noticed the first link in my footer has a "colon" in front of it?!? I could only think it's because I started my sort order at 1 instead of 0, but that disables it if you use 0. How can I get rid of that? And possibly the one at the end of the last link before the next link on the bottom? Doesn't make sense if the link is on the bottom.

  2. Lastly, is there a way to even out the links in the footer? Like as you can see in my site, I have 7 links on top and one all by itself on the bottom. Can it someone be set to evened up like 4 and 4 on each line?

Thanks in advance!

2 Dec 2009, 8:39 AM
#2
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Questions about adding text & links to footer

  1. You want to investigate EZ Pages. A page can be a whole new page or it can be simply a link to an existing page (either external or internal) So, you can create pages that are the links you require and then specify that they get added to the footer menu.

  2. Don't know but suspect that possibly someone has edited the footer file that creates the menu to remove the link to the home page but has not got it quite right. The file is:

includes/templates/yourtemplate/common/tpl_footer.php

  1. Yes, this is possible with a bit of php coding but I would wait until you have the final list of links confirmed first.

Nick
iszent.com

2 Dec 2009, 9:13 AM
#3
cslakans avatar

cslakans

New Zenner

Join Date:
Mar 2009
Posts:
64
Plugin Contributions:
0

Re: Questions about adding text & links to footer

Thanks for the quick reply!

  1. I have been using the the EZ Pages but this is the first time I'm using it for footers! From my understanding, the EZ Pages will only put hyperlinks at the footer and not static text. That's why I edited the tpl_footer.php file as explained in that other forum to add my copyright and other text. If there is a way to add static text using the EZ Pages, please let me know how.

  2. I don't see anything in that file that dealt with colons but maybe it's calling to somewhere else? I'm not a strong coder, but get by.

  3. I don't know php so I will propably just have to deal with it for now and like you said, see how many links I'll have in the long run.

Thanks!

2 Dec 2009, 9:48 AM
#4
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Questions about adding text & links to footer

OOPS.

yes I understand what you mean by the text now. I was looking at the links above 'Dog' etc. sorry.

As far as the colon goes the chunk of code you are looking at in tpl_footer looks like this:

<!--bof-navigation display -->
<div id="navSuppWrapper">
<div id="navSupp">
<ul>
<li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>
<?php if (EZPAGES_STATUS_FOOTER == '1' or (EZPAGES_STATUS_FOOTER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) { ?>
<li><?php require($template->get_template_dir('tpl_ezpages_bar_footer.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_footer.php'); ?></li>
<?php } ?>
</ul>
</div>

<!--eof-navigation display -->

It forms a list the first element of which is a link to the home page and then the EZ pages if enabled. So, if you simply take out the home page then the colons will be wrong. And yes you are right - in order to construct the EZ Page list is calls :

tpl_ezpages_bar_footer.php

So, you have two options. Either put a link in before the EZ Page list as the home page was or edit tpl_ezpages_bar_footer to remove that colon. Which will involve a conditional to test if it is the first occurance of the colon.

While we are looking at that chunk of code you can see the <div> structure clearly. For text to be in the green as it stands you need the text to be inside #navSuppWrapper so you could just put it in there, preferably inside its own div.

The other option here is to color the lower block green as well which would be in the stylesheet. There have been a few modifications to your install so that might just take a bit of working out.

PS. Your footer file must be a little bit different to e creating the result you have, so you will need to work out the differences I am afraid.

Nick
iszent.com

2 Dec 2009, 10:02 AM
#5
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Questions about adding text & links to footer

If you want to simply remove that colon then the chunk of code (in tpl_ezpages_bar_footer) that you are concerned with looks like this:

<?php echo ($i <= $n ? EZPAGES_SEPARATOR_FOOTER : '') . "\n"; ?>
  <a href="<?php echo $var_linksList[$i]['link']; ?>"><?php echo $var_linksList[$i]['name']; ?></a>

You could try changing it to:

<?php echo (($i <= $n && $i!=1) ? EZPAGES_SEPARATOR_FOOTER : '') . "\n"; ?>
  <a href="<?php echo $var_linksList[$i]['link']; ?>"><?php echo $var_linksList[$i]['name']; ?></a>

Haven't tested that but give it a go.

OR:

<?php
if ($i==1){
}
elseif ($i==4){
echo '<br/>';
}
else{
echo EZPAGES_SEPARATOR_FOOTER;
}
?>
<a href="<?php echo $var_linksList[$i]['link']; ?>"><?php echo $var_linksList[$i]['name']; ?></a>

And that should break the row after four entries. Again not tested but give it a go.

Nick
iszent.com

2 Dec 2009, 2:14 PM
#6
cslakans avatar

cslakans

New Zenner

Join Date:
Mar 2009
Posts:
64
Plugin Contributions:
0

Re: Questions about adding text & links to footer

I've been up all night working on this site, so I'm going to try to get some sleep now and I'll give your suggestions a try tomorrow. I'll come back and post how it goes.

Thanks again Nick for your reply! :smile:

5 Dec 2009, 7:44 AM
#7
cslakans avatar

cslakans

New Zenner

Join Date:
Mar 2009
Posts:
64
Plugin Contributions:
0

Re: Questions about adding text & links to footer

Sorry, I was delayed to try your suggestions above. I had to go to the hospital cause I broke my foot. Home and more alert now.

Your suggestions worked great for the most part.

  1. FIXED - Added my footer text in the <div> brackets and it looks great now.

  2. Semi fixed - First colon is removed, but now I have two colons between each link. Hopefully, when I figure out how to get rid of the extra colon it will get rid of the one on the end as well.

  3. Mostly worked - It put 3 links on top and 5 below. I changed the 4 to a 5 and now it's even. So works now!

http://animalsuperstore.com/zenpro/index.php

I really appreciated the extra time you took to create the code suggestions. It's really appreciated! :D

5 Dec 2009, 9:40 AM
#8
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Questions about adding text & links to footer

  1. Great - yes it looks better, doesn't it?

  2. OK, that's a bit strange. Can you post all the code from your tpl_ezpages_bar_footer file, please. Something must be awry! Either zip the file and attach it, or as it is a small file just post the code in to the post.

  3. Yes that was my error. Well spotted! You see you are becoming a coder. :-) Of course, the break comes before the 5th item not before the 4th item. Duh!

Hope your foot is better. How did you do it? Kicking the wall in frustration is a bad idea.

Nick
iszent.com

5 Dec 2009, 10:06 AM
#9
cslakans avatar

cslakans

New Zenner

Join Date:
Mar 2009
Posts:
64
Plugin Contributions:
0

Re: Questions about adding text & links to footer

That's funny about kicking the wall in frustration! Felt like it at times or throwing my laptop into the pool. Just dropped something on it cleaning my closet. On pain pills now so hopefully my brain doesn't mess up coding any worse than my brain on NO meds would do :laugh:

Here's the code...

  include(DIR_WS_MODULES . zen_get_module_directory('ezpages_bar_footer.php'));

?>

<?php if (sizeof($var_linksList) >= 1) { ?>

<?php for ($i=1, $n=sizeof($var_linksList); $i<=$n; $i++) {  ?>

<?php echo (($i <= $n && $i!=1) ? EZPAGES_SEPARATOR_FOOTER : '') . "\n"; ?>
  
  <?php
if ($i==1){
}
elseif ($i==5){
echo '<br/>';
}
else{
echo EZPAGES_SEPARATOR_FOOTER;
}
?>
  
  <a href="<?php echo $var_linksList[$i]['link']; ?>">

  <?php echo $var_linksList[$i]['name']; ?></a>
 

<?php } // end FOR loop ?>

<?php } ?>
5 Dec 2009, 10:24 AM
#10
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Questions about adding text & links to footer

Well, we all kick the wall at times!

Yes, you have an extra line in there.

<?php echo (($i <= $n && $i!=1) ? EZPAGES_SEPARATOR_FOOTER : '') . "\n"; ?>

Delete it - it should have been replaced by the additional code.

Nick
iszent.com

5 Dec 2009, 11:16 AM
#11
cslakans avatar

cslakans

New Zenner

Join Date:
Mar 2009
Posts:
64
Plugin Contributions:
0

Re: Questions about adding text & links to footer

Yeah, I did that before but it didn't do anything. Tried again now after reading your reply and it looks the same. This is the code that I uploaded (and verified file made it to my server).

  include(DIR_WS_MODULES . zen_get_module_directory('ezpages_bar_footer.php'));

?>

<?php if (sizeof($var_linksList) >= 1) { ?>

<?php for ($i=1, $n=sizeof($var_linksList); $i<=$n; $i++) {  ?>

  <?php
if ($i==1){
}
elseif ($i==5){
echo '<br/>';
}
else{
echo EZPAGES_SEPARATOR_FOOTER;
}
?>
  
  <a href="<?php echo $var_linksList[$i]['link']; ?>">

  <?php echo $var_linksList[$i]['name']; ?></a>

<?php } // end FOR loop ?>

<?php } ?>
5 Dec 2009, 11:46 AM
#12
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Questions about adding text & links to footer

When I look at the site I get one separator between each item. The separator is like this '::' . If you want to change what the separator looks like then you can do that in admin. Off the top of my head I think it is in:

admin >> configuration >> ez pages

Personally, I like using '|' but that is just me.

Nick
iszent.com

5 Dec 2009, 1:01 PM
#13
cslakans avatar

cslakans

New Zenner

Join Date:
Mar 2009
Posts:
64
Plugin Contributions:
0

Re: Questions about adding text & links to footer

Sweet! I didn't realize they were set up as :: in the admin. I thought I saw one : when we originally started this. Oh well, I changed to your suggestion of "|" and it looks great now.

You guys are so great to help us out like this. Especially after I had a developer recently take my money and not finish the job. So trying to work out the few things that are left with my site myself.

Hopefully, I don't have to come back for my banner problem, but I will continue to review old banner postings first and create new thread if still needed.

Thanks so much Nick! Your awesome!

:clap: