Post by precise » Fri Feb 08, 2008 9:43 pm

Hi,

First post so please be gentle. I am used to smarty based templates and I was hoping that I could do something like the following. I have tried a lot of different variables to try and get the same result but to no avail.

In this example I tried to define the variable in the home.php controller file and put the following in the layout.tpl file.

Code: Select all

<?php if ($ishomepage == "1")  { ?>
This is the homepage
<? } ?>
What I am trying to achieve - Is add a div containing images, adverts, promos or what ever it might be above the main content and side navigation divs on the homepage but on no other pages.

Thanks very much in advance, I hope there is a solution.

And congrats on a great product at a great price  ;)

Regards
Jon
Last edited by precise on Tue Feb 26, 2008 2:21 am, edited 1 time in total.

Newbie

Posts

Joined
Fri Feb 08, 2008 9:30 pm

Post by sitina » Sat Feb 09, 2008 1:29 am

Dear Jon,
your solution would work as well, but it would be quite cumbersome. All you need to do is to add required divs into the home.tpl template, which is shown only on the homepage.

Regards

Jiri Sitina
www.sitina.net

Newbie

Posts

Joined
Mon Feb 04, 2008 2:57 pm
Location - Czech republic

Post by precise » Thu Feb 14, 2008 8:48 pm

The problem is that this div is not in that template file, it is in the layout template file. It's not really that cumbersome.

With another cart using smarty I use the following:

Code: Select all

{if $current_page == "home"}
Do this on the homepage
{else}
Nothing here
{/if}
This allows me to do specific things in specific areas.

The only other way, that would be cumbersome, is to have each template file as the full template so one simple change would have to be made across all files. My way would enable a quick and easy resolution.

Regards
Jon

Newbie

Posts

Joined
Fri Feb 08, 2008 9:30 pm
Who is online

Users browsing this forum: No registered users and 6 guests