Post by jpopperman » Sat Nov 20, 2010 6:03 pm

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

Fotografie van Tiel en omgeving Tielse.nl


New member

Posts

Joined
Mon Nov 15, 2010 1:24 am


Post by De[v] » Sat Nov 20, 2010 10:38 pm

So you would like to put your Facebook like code in the left ??

New member

Posts

Joined
Mon Nov 15, 2010 11:21 am

Post by jpopperman » Sun Nov 21, 2010 12:04 am

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

Fotografie van Tiel en omgeving Tielse.nl


New member

Posts

Joined
Mon Nov 15, 2010 1:24 am


Post by De[v] » Sun Nov 21, 2010 10:57 am

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

New member

Posts

Joined
Mon Nov 15, 2010 11:21 am

Post by De[v] » Mon Nov 22, 2010 1:07 am

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 ?

New member

Posts

Joined
Mon Nov 15, 2010 11:21 am

Post by jpopperman » Mon Nov 22, 2010 3:27 am

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 ;D

To have a custom like box I used this tutorial: http://line25.com/tutorials/how-to-add- ... -your-site

Thanks for your help!

Fotografie van Tiel en omgeving Tielse.nl


New member

Posts

Joined
Mon Nov 15, 2010 1:24 am


Post by De[v] » Mon Nov 22, 2010 4:01 am

Happy to see you have it fixed. I like the art work on your site did you do it ?

New member

Posts

Joined
Mon Nov 15, 2010 11:21 am

Post by Xsecrets » Mon Nov 22, 2010 6:12 am

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 } ?>

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by jpopperman » Mon Nov 22, 2010 6:39 pm

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!

Fotografie van Tiel en omgeving Tielse.nl


New member

Posts

Joined
Mon Nov 15, 2010 1:24 am


Post by jpopperman » Mon Nov 22, 2010 6:40 pm

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 :)

Fotografie van Tiel en omgeving Tielse.nl


New member

Posts

Joined
Mon Nov 15, 2010 1:24 am


Post by Xsecrets » Mon Nov 22, 2010 8:36 pm

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'){ ?>

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by jpopperman » Mon Nov 22, 2010 9:11 pm

Topic Solved! ;D

Thanks so much Xsecrets!

Fotografie van Tiel en omgeving Tielse.nl


New member

Posts

Joined
Mon Nov 15, 2010 1:24 am

Who is online

Users browsing this forum: No registered users and 13 guests