Support Forums

Smarty Templates and You. Posted BY Lhotch

This is a discussion on Smarty Templates and You. Posted BY Lhotch within the Templates, HTML, CSS, and Design Help forums, part of the General category; Smarty has its own program like functions, what I did above is smarty code not PHP. For php the "if" ...


Go Back   68 Classifieds Forums > General > Templates, HTML, CSS, and Design Help

Reply
 
Thread Tools Display Modes
Old 05-30-2007, 11:42 AM   #11
curmudgeon
 
Join Date: Mar 2006
Posts: 5,416
Rep Power: 139
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Smarty has its own program like functions, what I did above is smarty code not PHP. For php the "if" would be outside the braces and they wouldnt be curly brackets either.

To use php inside of a template you need to escape the code so the smarty compiler doesnt try to treat it as smarty or html. To do this you simply surround your php with tags like so...

{php} {/php}
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 05-31-2007, 12:25 PM   #12
Junior Member
 
Join Date: Apr 2007
Posts: 6
Rep Power: 0
taiwanted is on a distinguished road
Default

Excellent, many thanks for the help.
taiwanted is offline   Reply With Quote
Old 10-02-2007, 07:35 AM   #13
Junior Member
 
Join Date: Sep 2007
Posts: 23
Rep Power: 18
castus is on a distinguished road
Default

Is there anyway to pass variables to the smarty functions?

I have the category id, and would like to pass it a new function I have made, so I can show the links with this category id as it's parent.
castus is offline   Reply With Quote
Old 10-02-2007, 09:06 AM   #14
Junior Member
 
Join Date: Sep 2007
Posts: 23
Rep Power: 18
castus is on a distinguished road
Default

It's ok - I have found it!
castus is offline   Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -4. The time now is 04:07 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0