Hi!
Does anyone know how I can have conditional content on the index page, I want to have specific FB Opengraph data on the home page but not on the product pages etc... so I'm looking for this type of script:
IF Page = Home then...
Else
End
Many thanks!
Tom
Does anyone know how I can have conditional content on the index page, I want to have specific FB Opengraph data on the home page but not on the product pages etc... so I'm looking for this type of script:
IF Page = Home then...
Else
End
Many thanks!
Tom
Code: Select all
<?php if(!empty($this->request->get['route']) && $this->request->get['route'] == 'common/home') : ?>
<?php else: ?>
<?php endif; ?>
Yeh Ive used:
But it only works if you are on: http://mysite.com/index.php?route=common/home
It doesnt if you are on: http://mysite.com/
Anyone know how to fix this?
Code: Select all
if (isset($this->request->get['route']) && $this->request->get['route'] == 'common/home') {
It doesnt if you are on: http://mysite.com/
Anyone know how to fix this?
OpenCart Theme Options - See All My Extensions - OpenCart Themes and Mods
Found solution:
<?php if (!isset($this->request->get['route']) || (isset($this->request->get['route']) && $this->request->get['route'] == 'common/home')) { ?>
<?php if (!isset($this->request->get['route']) || (isset($this->request->get['route']) && $this->request->get['route'] == 'common/home')) { ?>
OpenCart Theme Options - See All My Extensions - OpenCart Themes and Mods
Thank you for your solution. The end curly tag } in your last post brought up an error message for me (OC v.1.5.2.1):
This worked for me:
This worked for me:
Code: Select all
<?php if (!isset($this->request->get['route']) || (isset($this->request->get['route']) && $this->request->get['route'] == 'common/home')) : ?>
This is the text if it is the home page
<?php else: ?>
This is the text if it is not the home page
<?php endif; ?>
Who is online
Users browsing this forum: No registered users and 22 guests