Copied to clipboard

Flag this post as spam?

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


  • Tom 713 posts 954 karma points
    Jul 15, 2011 @ 03:04
    Tom
    0

    Proper Check For DynamicNodeList?

    Hi Guys,

    DynamicNodeList doesn't expose Count but rather assumes on the GetEnumerator that it's Items won't be null even though they have a publically accessible setter..

     

    just wondering for now is the applicable check something like:

     

    var something = @Model.Children;

    if(something.Items != null && something.Items.Count > 0) { //do stuff; }

  • Sebastiaan Janssen 5058 posts 15520 karma points MVP admin hq
    Jul 15, 2011 @ 08:47
    Sebastiaan Janssen
    1

    In 4.7.1 you will be able to just do Model.Children.Count() - Get a copy of umbraco.macroengines.dll from the latest nightly build.

  • Rajeev 126 posts 154 karma points
    Jul 15, 2011 @ 08:56
    Rajeev
    0

    Hi Sebastian,

    Is there any other dependancy if I am using this umbraco.macroengines.dll from this build.

    Thanks,

    Rajeev

     

  • Sebastiaan Janssen 5058 posts 15520 karma points MVP admin hq
    Jul 15, 2011 @ 09:01
    Sebastiaan Janssen
    0

    No, you only need the macroengines dll. Be aware that this is a nightly build and not a final so things could break. If they do, don't worry, it is going to be an easy fix! :-)

    Would like to know if the upgrade goes well so there's some more user feedback for the upcoming 4.7.1 release.

  • Rajeev 126 posts 154 karma points
    Jul 15, 2011 @ 09:15
    Rajeev
    0

    Thank you for the update.

    I have a Node with Property startDate and endDate and have its template

    I need to display the item in the template only if that is within the date range.

    Otherwise that shouldn't be shown in the page.

    @Model will give the dynamic node, I would like to know how to check the date range for this,  I have tried the .Where and

    @Model.startDate >=DateTime.Now.Date etc and I am getting an error like DynamicNull cannot use >= with DateTime.Date

     

    Thanks,

    Rajeev

  • Sebastiaan Janssen 5058 posts 15520 karma points MVP admin hq
    Jul 15, 2011 @ 09:26
    Sebastiaan Janssen
    0

    Ehm, I don't know what your question is? Or answer?

  • Rajeev 126 posts 154 karma points
    Jul 15, 2011 @ 09:39
    Rajeev
    0

    Edited the question above after trying with that.

    Please let me know if you understand my question.

     

    Thanking you.

  • Sebastiaan Janssen 5058 posts 15520 karma points MVP admin hq
    Jul 15, 2011 @ 09:42
    Sebastiaan Janssen
    0

    Ah I see, that's not at all related to the original question, but an interesting one. Could you post it as a new question please? That will make it easier for other people to find later. 

    I'll dig up some code I have for this scenario.

  • Rajeev 126 posts 154 karma points
    Jul 15, 2011 @ 09:55
    Rajeev
    1

    I have posted that as a new topic. Thank you.

Please Sign in or register to post replies

Write your reply to:

Draft