![]() |
Making home.php only control home page not catergories
Hi All, I'm trying to get a certain look with xcart and slowly getting there. I wanted my product.tpl page to load outside the normal template and take up the whole screen, as in lose the left column, I managed to do that.
Now I want my home page to have a left and right column, right side for news, but the rest of the site I want it to have 1 column and drop the right column. I'm able to do that for the most part however all the categories point to the home.php file. So when I make the changes my home page has both columns, I can go anywhere else and I only have the left column, just as I want, however when I click a category and see the list of products or sub categories I also get the right column, thats because all the links point to the home.php file. Is there any way to have the category links called from a different file other than home.php? I don't understand why they both share the same file. If these weren't linked together it would be no problem having a different template for all the pages. I created a new .php file and located it in the same place as the home.php, then I went through a ton of other files that I thought held the links for the categories and changed all references from home.php to the new .php file. The new .php file pointed to the home.tpl so I get the 1 column template. But every change I made, which was a lot, seemed to make no difference. The category links are always pointing to home.php I think if I can find out where to change the actual link for the categories I might be able to do it. Would anybody have any ideas? Thanks Rob |
I think you are working too hard. Instead of changing code all over the place, try this approach. In home.tpl add this before the third column HTML:
Code:
{if $main eq "catalog" and $current_category.category eq ""} Code:
{/if} BTW, please add your version into your signature. Sometimes answers are very version dependent. My answer applies to versons 4.0.14 and 4.0.18 for sure and probably 4.1.x versions and earlier 4.0.x versions. |
ah, you're amazing! Seems so hard yet so simple.
I use 4.1.2 and its in my signature, your were probably looking in the topic review window, it doesn't show there. Thanks so much! :D |
Quote:
Sorry, yes you are right. Glad I could help. |
Quote:
Geckotoday, can u please explain what this does in plain newbie terms? |
Quote:
The smarty {if ...} {/if} defines a block of html and smarty code that should only be included if the condition in the {if ...} is true. So putting the third column inside the {if ...} and {/if} means it will only be displayed if the condition inside the if is true. In this case if $main is set to "catalog" and $current_category is an empty string - the condition for displaying the home page. So the third column will only be displayed on the home page. Which come to think of it isn't exactly what was being asked for. To remove the third column from only the category pages it really should be this: Add this before the third column HTML: Code:
{if $main eq "catalog" and $current_category.category ne ""} Code:
{/if} So do you know what $main is set to for what page? Take a look at home_main.tpl. |
good explanation!
I guess thats how mosaic template works. on the home page, it doesnt show the third column. |
Quote:
What do you mean "third column HTML in home.tpl "? Does it mean after Code:
Thanks a lot. |
Quote:
Code:
<TD width="6"></TD> |
All times are GMT -8. The time now is 06:01 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.