Copied to clipboard

Flag this post as spam?

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


  • Torben Warberg Rohde 35 posts 89 karma points
    Sep 11, 2009 @ 11:20
    Torben Warberg Rohde
    0

    Including user control in rendered list of e.g. expo boxes or news

    Working on my first Umbraco powered site I've gotten stuck on the following.

    Background "story"
    On the side, the right side bar contains a number of expo boxes. I want these boxes to be editable by the end user.

    I have created a site tree for all the main pages, and totally seperate from this is a "Content folder" containing collections of expo.

    Example of structure

    - Site pages (home)
       - News
       - About us
       - ... etc.
    - Content folder
       - Expo box collections
          - Standard expos
              - Who are we?
              - Why trade with us?
              - Newsletter subscription
          - Standard expos excl. newsletter subscription
              - Who are we?
              - Why trade with us?





          - Christmas expos
              - Who are we?
              - Why trade with us?
              - Newsletter subscription
              - Christmas bonus


    The customer can create new expo collections, and add or remove expos to the collections. For each page on the site, they can select which expo collection they want to show in the right side bar.
    The actual expos are simple document types with e.g a link and an image. These are rendered using XSLT - and it all works perfectly.

    The problem
    The newsletter subscription is a user control. The customer will not be able to edit its content or functionality, but I would like for them to be able to add or remove it to the "expo box collections" and decide their position in respect to the other expos (below, above, number 3 etc.)

    Since I'm in the context of an XSLT script, I can't "embed" or output a macro or user control. Do I need to use a completely different architecture for my expo-setup, or is there a clever workaround?

  • Chris Koiak 700 posts 2626 karma points
    Sep 11, 2009 @ 12:15
    Chris Koiak
    0

    If I'm following you correctly, could you not

    • Wrap the usercontrol up in a macro. Allow this macro to be inserted into the RTE.
    • Create an expo for newsletter, add the macro into the RTE of this expo

    What stops you taking this approach?

    Chris

  • Torben Warberg Rohde 35 posts 89 karma points
    Sep 11, 2009 @ 13:14
    Torben Warberg Rohde
    0

    Yes, I think you are, and I have actually tried just that (didn't mention it since the post was long enough already ;o).

    But the output I get is the raw macro declaration:

    <?UMBRACO_MACRO macroAlias="NewsletterSubscriptionExpo" />

    First I used this XSLT

        <!-- HTML Expo -->
        <xsl:value-of select="data [@alias = 'html']" />

    Then I found out it was HTML-encoding the the < > chars and changed it to

        <!-- HTML Expo -->
        <xsl:value-of select="data [@alias = 'html']" disable-output-escaping="yes" />

    But that didn't help. My knowledge about the Umbraco page lifecycle is limited, but I have read elsewhere that it is not possible to list one macro in another (the XSLT macro ExpoListing.xslt tries to call the user control macro NewsletterSubscriptionExpo)

  • Chris Koiak 700 posts 2626 karma points
    Sep 11, 2009 @ 13:29
    Chris Koiak
    0

    There was a similar discussion here http://our.umbraco.org/forum/getting-started/questions-about-runway-and-modules/3922-Listing-videos-from-macro

    It's a bit of a work around, but if you changed your "Newsletter Subscription" to just be a empty node, your xslt could identify when the Newsletter content should be output, but instead output the macro in the above method.

    Chris

  • Torben Warberg Rohde 35 posts 89 karma points
    Sep 11, 2009 @ 13:54
    Torben Warberg Rohde
    0

    Works perfectly! Thanks a lot :-)

    Greets,
    Torben

Please Sign in or register to post replies

Write your reply to:

Draft