PDA

View Full Version : catergory pages


Cymru
03-01-2006, 05:50 PM
i have used this piece of code ( which i found here) inserted in the main.tpl

{if $category.PARENT_ID == 0} {php}include("http://mysite /frontpage.php");{/php} {/if}

this works a treat and displays my frontpage with the catergories listed down the left of the page ... I remember in the post that i got the code from, that he had a seperate page for each catergory by using the same code but changing the parent id i have tried searching for this on here can anyone help me out here .....

if my explation was rubbish http://gcommercial.co.uk/lookworthwhile/index.php note the front page if you click the accomodation link the included page should change to the accomodation one

Cymru
03-02-2006, 08:53 AM
ok i have found the post its here {topic moved or deleted}
it works for the first line but gives errors if you repeat the code like this

{if $category.PARENT_ID == 0} {php}include("http://gcommercial.co.uk/lookworthwhile/frontpage.php");{/php} {/if}

{if $category.PARENT_ID == 1} {php}include("http://gcommercial.co.uk/lookworthwhile/otherpage.php");{/php} {/if}


it returns this error
Parse error: parse error, unexpected '&' in /home/gcomm/public_html/lookworthwhile/temp/templates/en^%%72^72D^72DAF6E8%%main.tpl.php on line 37


......anyone know why ?

anon
03-02-2006, 07:58 PM
Are you 100% certain that $category.PARENT_ID 1 exists?

Could you have maybe deleted a Parent directory(ala that particular id), or maybe it's disabled and doesnt take? Just speculating to help get to the bottom of this.