• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Inject HTML into custom template with template variables?

Liam W

Well-known member
#1
I have a custom template setup for an addon, which basically contains a select drop down box.

The options are dynamic, and I though I would be able to stick them in by creating an array of the <option></option> tags in the php, and then adding this to the viewparams and then using <xen:foreach> to loop through the option tags and output them.

Well, this sort of works - but it doesn't. The outputted text is obviously not intepreted as HTML, and as such the options aren't being added to the drop down.

Is there any way I could do this?

(If only there was an <xen:eval> template thingy...)
 

Liam W

Well-known member
#5
If you're already using a <xen:foreach> in the template, you should just put any HTML in the templates and not in the PHP.
True, but I was initially doing it a different way, and it was easier to not change it. I'll do it that way now though :)

(Also, I didn't think of your way ;))

Incidentally, is it possible to define custom actions for existing controllers to create a custom route of the existing route?
 

Jeremy

Well-known member
#6
True, but I was initially doing it a different way, and it was easier to not change it. I'll do it that way now though :)

(Also, I didn't think of your way ;))

Incidentally, is it possible to define custom actions for existing controllers to create a custom route of the existing route?
Yes. Hook into the listener and extend the controller. I believe the listener is load_class_controller.