Copied to clipboard

Flag this post as spam?

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


  • Peter Duncanson 430 posts 1358 karma points c-trib
    Aug 20, 2009 @ 12:52
    Peter Duncanson
    0

    Anyone else using MooTools?

    We've been using MooTools in house for about 2 years now, notice that most of the examples and JS used in Umbraco is JQuery. Is anyone else using MooTools with Umbraco?

    We've created an alternative accordian using Mootools, would anyone be interested in it, I could release it as a project I guess?

    One problem I noticed, I only wanted to include moo on the accordian pages but the only way I could do it was in the accordian marco code itself and not in the footer where I normally would put it. Is there a cleaner smarter way of including Moo, would be nice to have a similar call as the umbraco library call to include jquery.

    Pete

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Aug 20, 2009 @ 13:01
    Thomas Höhler
    1

    You can add several ContentPlaceHolders in the Templates. So you can add a footer ContentPlaceholder and only in the template for the accordion pages you can add the mootools to the template via the footer placeholder

    hth, Thomas

  • Peter Duncanson 430 posts 1358 karma points c-trib
    Aug 20, 2009 @ 16:18
    Peter Duncanson
    0

    Ooh I like the sound of that, any chance of a quick and dirty sample? Something close enough will do :)

  • Bert 128 posts 251 karma points
    Aug 20, 2009 @ 16:27
    Bert
    0

    Add in your master template a placeholder with the id "scripts" on the place you want your scripts to be inserted

    In the template where you use your macro requiring the 'my-mootool.js' add:

    <asp:content ContentPlaceHolderId="scripts" runat="server">
    <script src="/scripts/my-mootool.js" type="text/javascript"></script>
    </asp:content>
  • Peter Duncanson 430 posts 1358 karma points c-trib
    Aug 21, 2009 @ 15:13
    Peter Duncanson
    0

    Like it, is it possible to have multiple "scripts" defined? Would they all render out in the placeholder? So if you defined a scripts in one template and then again in a child template would it render out both or just error?

    Cheers

     

    Pete

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Aug 21, 2009 @ 15:19
    Thomas Höhler
    0

    I thinkt you are searching for the general placeholder concept of asp.net. Take a look here:

    http://www.asp.net/learn/master-pages/tutorial-01-cs.aspx

    http://www.asp.net/learn/master-pages/tutorial-02-cs.aspx

    This evening I can give you more examples, have to prepare for a meeting

    Thomas

  • Bert 128 posts 251 karma points
    Aug 21, 2009 @ 17:20
    Bert
    0

    I would recommend not using to many template lvl's, this can get confusing to manage on larger projects. This makes it fairly easy to check if the script is added in parent templates.

  • Bert 128 posts 251 karma points
    Aug 21, 2009 @ 17:21
    Bert
    0

    Still no edit button :) more posts for us!

    <asp:content ContentPlaceHolderId="scripts" runat="server">
            <script src="/scripts/my-mootool.js" type="text/javascript"></script>
    <script src="/scripts/my-mootool1.js" type="text/javascript"></script>
            <script src="/scripts/my-mootool2.js" type="text/javascript"></script>
    <script src="/scripts/my-mootool3.js" type="text/javascript"></script>
    </asp:content>

    It is possible to add anything or even nothin in a placeholder. You just have to check that your output makes sence.

Please Sign in or register to post replies

Write your reply to:

Draft