1) You can place all Macro control inside sections of asp:MultiView and select the view you need programmatically.
2) Another option can be to set programmatically the Alias property of your macro control. In this case however I'm not completely certain about the stage of the page lifecycle it should be done on (perhaps you will need to experiment with it) since the Alias property is processed once in the CreateChildControls overriden method of the umbraco:Macro control itself so that if you're going to set it in code it should be done before that.
calling 3 different login macros based on page domain:
Hi i have 3 domain and 3 different login user control in my umbraco pages
i would like to make conditional statement to attach the macro at runtime by identifying the ... domain of the umbraco website :
HttpContext.Current.Request.ServerVariables["HTTP_HOST"].ToString() ="dk.domain.dk"
for example
and 3 different login macros:= Login1control , Login2control, login3Control...
example of macro in templates page :
<umbraco:Macro Alias="AdmiralLogControl" runat="server">
any ideas and code suggestions will be very helpful..
without changing the template structure
Hi. I suppose:
1) You can place all Macro control inside sections of asp:MultiView and select the view you need programmatically.
2) Another option can be to set programmatically the Alias property of your macro control. In this case however I'm not completely certain about the stage of the page lifecycle it should be done on (perhaps you will need to experiment with it) since the Alias property is processed once in the CreateChildControls overriden method of the umbraco:Macro control itself so that if you're going to set it in code it should be done before that.
i have found that you can call macros form xslt file based on domains like this example below which iam trying to do now..
http://stackoverflow.com/questions/8854524/multiple-websites-on-one-umbraco-xslt-macro-required
i will inform if i can resolve it
any other suggestions are welcome
is working on a reply...