I have a content type called "FormContentType". This type has a field called "FormAlias". I have number of Macros pointing to UserControl forms. In corresponding templates of contents of "FormContentType" type, I'd like call that Macro based on the value entered in "FormName" field. I want to have some thing like this:
Notice that macor alias is dynamic and is based on what is entered in "FormAlias" field of content. But it does not work. If I put the name of one of those form macros explicitly, it works. But using above statement, it does not work. Is this something related to page life cycle?
Dynamic Macro
Hi
I have a content type called "FormContentType". This type has a field called "FormAlias". I have number of Macros pointing to UserControl forms. In corresponding templates of contents of "FormContentType" type, I'd like call that Macro based on the value entered in "FormName" field. I want to have some thing like this:
<umbraco:macro alias="[#FormAlias]" runat="server"/>
Notice that macor alias is dynamic and is based on what is entered in "FormAlias" field of content. But it does not work. If I put the name of one of those form macros explicitly, it works. But using above statement, it does not work. Is this something related to page life cycle?
Could you please help me?
Regards,
Nami
Hi Nami... it sounds like a job for the Macro Container data-type: http://umbraco.com/help-and-support/video-tutorials/umbraco-fundamentals/datatypes/using-the-macro-container-datatype
Cheers, Lee.
is working on a reply...