Copied to clipboard

Flag this post as spam?

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


  • Carlos 338 posts 472 karma points
    Jun 15, 2012 @ 21:02
    Carlos
    0

    Multinode Tree Picker Razor Macro Error

    I am having an issue with my Multinode tree picker Macro.  I have the MTP in a property that is in my Global doctype.  Some pages/nodes are using the MTP to put certain content on pages I need them for.  

    My issue is, on the pages that I have picked something in the MTP, they work fine. But for pages that I have not chosen anything, I am getting "Error loading MacroEngine script (file: SurveyModule.cshtml)"

    I have nod idea why, I have tried a few things.  I did a simple test to see if the my picker was Empty and print out some text and that seemed to work. 

    BUT when I try to find my node properties, it gives me the MacroEngine error on the pages that done have anything selected in the MTP.  It almost seems to be when I add my var it errors. But I don't know for sure.  Can someone please help me out?

    My code is below.

     

    @{
       var nodeItem @Model.surveyModulePicker;
        var surveyNode @Model.NodeById(nodeItem.InnerText); 

      @*TODOPut logic in to test if the current page has anything in the surveyModulePicker and now show it on those pages. Currently shows on all pages.*@
      if(@Model.GetProperty("surveyModulePicker"!= string.Empty){
     
       if(@surveyNode.HasValue("surveyModuleURL")){
                                               
        <div class="surveyHintModule">
          <span class="surveyModuleCloseBtn">Close X</span>
          <p>Help the Museum design newuseful content for our website by taking this short survey. You could <strong>win four Museum tickets</strongjust for participating!
          </p>
          <href="@surveyNode.surveyModuleURL" target="_blank" class="surveyModuleLink">Click Here</a>
        </div>
         }
         
       }
      else{
           
           }
       

  • umbracocool 108 posts 197 karma points
    Nov 18, 2012 @ 07:39
    umbracocool
    0

    Try this and see:

    var nodeItem @Model.surveyModulePicker.XPath("//nodeId[1]").InnerText;
    var node @Model.NodeById(@nodeItem);

    @node.Name

    Best of luck!

    /Raylin

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies