Copied to clipboard

Flag this post as spam?

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


  • Nate 143 posts 184 karma points
    Sep 02, 2011 @ 21:51
    Nate
    0

    Choose which macro to load in a template?

    I have a template that chooses which macro to show based on a query string.  The below code is wrong though, it still loads both macros even though one is set to invisible.

    How do I only load one macro?  I wanted to stick with the WorkoutID=[@id] because of macro cacheing.

     <%  if (String.IsNullOrEmpty(Request.QueryString["id"]))
            {
                RideHome.Visible = true;
                RideDetail.Visible = false;
            }
            else
            {
                RideHome.Visible = false;
                RideDetail.Visible = true;
            }
        %>
    
        <umbraco:macro  ID="RideHome" Alias="RideHome" runat="server" pageIndex=[@pg] duration=[@duration]></umbraco:Macro>
        <umbraco:macro  ID="RideDetail" Alias="RideDetail" WorkoutID=[@id] runat="server"></umbraco:Macro>

  • Bex 444 posts 555 karma points
    Feb 23, 2012 @ 17:58
    Bex
    0

    Did you ever get anything like this working?

  • Nate 143 posts 184 karma points
    Feb 23, 2012 @ 19:38
    Nate
    0

    No, and it sucks!  Let me know if you figure anything out :).

Please Sign in or register to post replies

Write your reply to:

Draft