Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Max 144 posts 166 karma points
    Jan 18, 2012 @ 08:01
    Max
    0

    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

     

     

     

  • Rodion Novoselov 694 posts 859 karma points
    Jan 18, 2012 @ 08:27
    Rodion Novoselov
    0

    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.

  • Max 144 posts 166 karma points
    Jan 18, 2012 @ 08:50
    Max
    0

    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

     

Please Sign in or register to post replies

Write your reply to:

Draft