As templates are .NET masterpages you could drop in an asp:checkboxlist control directly onto the masterpage and create a codebehind file in Visual studio to do your code
OR the best practise & common way is to have any dynamic functionality (such as forms etc) put into a ASP.NET usercontrol.
To add a .NET usercontrol to your template you need to:
Add the usercontrol .ascx file in the /usercontrols folder
Copy the compiled code (.dll) to the /bin directory
Login to Umbraco and goto the Developer section
Right click on the macro folder and click create/new
Give your macro a meaningful name - eg contactform
On the macro use the dropdown next to .net usercontrol and browse to your .ascx file
Ammend the alias to suit your coding style (camelCase) or whatever
Hit Save
Goto your template/masterpage you wish to add the macro to in Umbraco
Then click the fourth icon from the left (has this as the icon ><)
Choose which macro you wish to insert into the template
Save the template & volia you have your .NET usercontrol running in your template
If statments in templates
Is it possible to have if statments in a template, so if the value of checkbox is checked do something? Can you do some kind of inline xslt?
You can use inline xslt:
http://umbraco.org/documentation/books/inline-xslt
but I dont know about using an if statement.
You would probably just want to either create a macro (that uses XSLT) or use javascript.
Hiya Vincent you could do the following:
As templates are .NET masterpages you could drop in an asp:checkboxlist control directly onto the masterpage and create a codebehind file in Visual studio to do your code
OR the best practise & common way is to have any dynamic functionality (such as forms etc) put into a ASP.NET usercontrol.
To add a .NET usercontrol to your template you need to:
I hope this helps you out.
Warren :)
is working on a reply...