View Full Version : Help editing main template
phil2564
10-10-2005, 06:17 PM
I want to just have my news on my front page of my directory plus the categories of course and on all the other pages I may add different content per category but first things first how do I edit the main.tpl to only show news on the main page. Right now I have this code added in my main.tpl
{php} include("http://www.mysite.com/search/rss/reader.php");{/php}
{include file="footer.tpl"}
{/strip}
Now adding the {php} block where it is now at the bottom above the {include file="footer.tpl"} makes the news show up on all my pages I just want it on the first page. Any help would real helpful.
Thanks
PHIL
seothatworks
10-10-2005, 10:27 PM
You have to put it inside of this rule:
{if $category.ID == 0}
{/if}
phil2564
10-10-2005, 11:12 PM
Thanks very much that worked very well I just need help with one more thing. If I have another include that runs a random display of articles what would I use for a rule around that include? Sorry to be a bother.
Phil
phil2564
10-10-2005, 11:14 PM
Would the inlcude just go between the "else"
{else}
{/else}
seothatworks
10-11-2005, 09:36 AM
Not sure what you want to accomplish, but the {else} rule I think doesnt need the closing tag, ie it seems to work as follows (I'm not a coder, might be wrong):
{if .............}
if condition is satisfied this text is displayed
{else}
in all other cases you will see this
{/if}
phil2564
10-11-2005, 05:22 PM
I want the news to be on the main opening page only then I have 10 other categories what I wanted to do is have 5 articles for each of the 10 categories and when a person would choose a category it would display 1 of the 5 articles assigned to that category randomly. So I need the main template to check and see which category is being called for then include that script the does the displaying of the random article. Hope I explained this to you understandable
vBulletin® v3.8.0, Copyright ©2000-2012, Jelsoft Enterprises Ltd.