Guest The Squirrel Posted September 18, 2008 Share Posted September 18, 2008 I'm no PHP whizz and I've never used xtemplates before but I understand how to assign and display the value of a variable by doing something like this: $view_cat->assign("MY_VAR", "Some stuff"); But there's something I don't understand. I'm trying to add some content to view_cat.tpl. When I add {MY_VAR} anwhere below <!-- BEGIN: cat_desc --> it doesn't display. How do I get my vars to work below that line? Any advice or guidance appreciated! Thanks! James Quote Link to comment Share on other sites More sharing options...
Guest Posted September 18, 2008 Share Posted September 18, 2008 If you've got {MY_VAR} inside of the <!-- BEGIN: cat_desc --> block then I think you need: $view_cat->assign("MY_VAR", 'stuffage'); $view_cat->parse("view_cat.cat_desc"); It won't work if you do $view_cat->assign("MY_VAR", 'stuffage'); $view_cat->parse("view_cat"); The dots in ->parse indicating going into blocks of <!-- BEGIN: ..> <!-- END: ..> I think ;) Quote Link to comment Share on other sites More sharing options...
Guest The Squirrel Posted September 18, 2008 Share Posted September 18, 2008 Thanks for the reply James! Unfortunately that didn't quite work because I was trying to assign a variable to a sub-block after it had already been parsed. Thanks a bundle for taking the time though. James Quote Link to comment Share on other sites More sharing options...
Guest Posted September 18, 2008 Share Posted September 18, 2008 sorry I couldn't be of more help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.