Page 1 of 1
Display html in column_left on certain pages
Posted: Sat Nov 20, 2010 6:03 pm
by jpopperman
Hello everyone,
Could anyone help to explain how to show a piece of html code on every page but exclude it from the product and home page in the left column. Its my facebook like page code.
opencart version: v1.4.9.1
Re: Display html in column_left on certain pages
Posted: Sat Nov 20, 2010 10:38 pm
by De[v]
So you would like to put your Facebook like code in the left ??
Re: Display html in column_left on certain pages
Posted: Sun Nov 21, 2010 12:04 am
by jpopperman
Yes and no, this is my left column with my facebook fan page code:
Code: Select all
<div id="column_left">
<?php foreach ($modules as $module) { ?>
<?php echo ${$module['code']}; ?>
<?php } ?><div id="fb-root"></div>
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
<script type="text/javascript">FB.init("973c930b53903697804275024dde9d78");</script>
<fb:fan profile_id="328454121419" connections="0" width="232" height="110" css="http://jpopperman.com/wid.css?17"></fb:fan>
</div>
I would like to show this fanpage code on every page but
not on the product page and the home page because its disturbing those pages. So I searched on the forum but could not find a way
This is my site:
http://art.jpopperman.com
Re: Display html in column_left on certain pages
Posted: Sun Nov 21, 2010 10:57 am
by De[v]
Are you using IE ? It would just be some if & else php commands. I will have to look up how to pull url and just do a block by if url == then disply=none something like that. I will look it up for you.
--
BTW your fan page does not disturbing any pages using firefox. You can just to a fast IE fix if you like. Also don't know the IE fix but i can search that also and let you pick
Re: Display html in column_left on certain pages
Posted: Mon Nov 22, 2010 1:07 am
by De[v]
Can you send me a url to the product page(s) you would like it not to show up on.
Also how do you get the people to show up ?
Re: Display html in column_left on certain pages
Posted: Mon Nov 22, 2010 3:27 am
by jpopperman
Hey De[v]
its already fixed a little by using the new collapse mod:
http://forum.opencart.com/viewtopic.php?f=121&t=22991 This way its not so disturbing anymore to see those peoples faces
To have a custom like box I used this tutorial:
http://line25.com/tutorials/how-to-add- ... -your-site
Thanks for your help!
Re: Display html in column_left on certain pages
Posted: Mon Nov 22, 2010 4:01 am
by De[v]
Happy to see you have it fixed. I like the art work on your site did you do it ?
Re: Display html in column_left on certain pages
Posted: Mon Nov 22, 2010 6:12 am
by Xsecrets
the code way would be something like
Code: Select all
<?php if($this->request->get['route'] == 'product/product' || !isset($this->request->get['route']) || $this->request->get['route'] == 'common/home'){ ?>
put nothing here or if you want something different in that spot for those two pages put it here
<?php } else { ?>
script goes here
<?php } ?>
Re: Display html in column_left on certain pages
Posted: Mon Nov 22, 2010 6:39 pm
by jpopperman
Works very well Xsecrets but on the index page I get this error message:
Code: Select all
Notice: Undefined index: path in /var/www/vhosts/jpopperman.com/subdomains/art/httpdocs/catalog/view/theme/cleaner-2-col-left-1491/template/common/column_left.tpl on line 4
On all other pages it works!
Re: Display html in column_left on certain pages
Posted: Mon Nov 22, 2010 6:40 pm
by jpopperman
De[v] wrote:Happy to see you have it fixed. I like the art work on your site did you do it ?
Thank you De[v]! yes its mine

Re: Display html in column_left on certain pages
Posted: Mon Nov 22, 2010 8:36 pm
by Xsecrets
oops put the !isset( first so like this.
Code: Select all
<?php if(!isset($this->request->get['route']) || $this->request->get['route'] == 'product/product' || $this->request->get['route'] == 'common/home'){ ?>
Re: Display html in column_left on certain pages
Posted: Mon Nov 22, 2010 9:11 pm
by jpopperman
Topic Solved!
Thanks so much Xsecrets!