Copied to clipboard

Flag this post as spam?

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


  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Sep 12, 2012 @ 18:47
    Ismail Mayat
    0

    Razor macro issues

    Using umbraco 4.9.0 and damp its set to multiple images and to save as xml. I have

    @inherits umbraco.MacroEngines.DynamicNodeContext

    @using DigibizAdvancedMediaPicker

    @if (Model.HasValue("pageImages"))

     

    {    

     

       foreach (var imageItem in Model.pageImages){

     

                            <div class="pic">

     

                                <a href="@imageItem.umbracoFile">@imageItem.nodeName</a>

     

                            </div>

       }

    I get the following error 

    Error Loading Razor Script (file: List Images) 'umbraco.MacroEngines.DynamicXml' does not contain a definition for 'umbracoFile'    at CallSite.Target(Closure , CallSite , Object )

    Any ideas

    }

     

     

  • Markus Johansson 1911 posts 5735 karma points MVP c-trib
    Sep 12, 2012 @ 21:06
    Markus Johansson
    0

    Are you picking them up from the content section or from the media section? Did you name the custom field "umbracoFile"?

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Sep 13, 2012 @ 10:14
    Ismail Mayat
    0

    Markus,

    DAMP is on a content node and the images are being picked from media section.  There is not custom field its just the default media field umbracoFile.  I also tried

    imageItem.mediaItem.umbracoFile

    Still get error.

    Regards

    Ismail

  • Markus Johansson 1911 posts 5735 karma points MVP c-trib
    Sep 13, 2012 @ 10:30
    Markus Johansson
    0

    Could you post some of the cached XML from /app_data/ ?

    / m

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Sep 13, 2012 @ 10:33
    Ismail Mayat
    0

    Markus,

    I just stepped through the code and the xml is

    <mediaItem>

    <node id="1107" version="5600e63e-4222-48c5-8e4e-e5a6723fb7ab" parentID="1106" level="2" writerID="0" nodeType="1032" template="0" sortOrder="1" createDate="2010-06-10T14:41:51" updateDate="2010-06-10T14:41:51" nodeName="news image 4" urlName="newsimage4" writerName="Administrator" nodeTypeAlias="Image" path="-1,1106,1107">

    <data alias="umbracoFile">/media/770/franc6.jpg</data> 

    <data alias="umbracoWidth">392</data> 

    <data alias="umbracoHeight">154</data> 

    <data alias="umbracoBytes">21006</data> 

    <data alias="umbracoExtension">jpg</data> 

    </node>

    </mediaItem>

    Regards

    Ismail

     

     

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Sep 13, 2012 @ 10:49
    Ismail Mayat
    0

    Markus,

    Arghghghghghhgghghghghghhgh!!!!! Just figured out what the issue is. I have xml set to legacy!!!

    Total doh moment!!

    Regards

    Ismail

  • Markus Johansson 1911 posts 5735 karma points MVP c-trib
    Sep 13, 2012 @ 10:58
    Markus Johansson
    0

    Ahaa =D

    Great that you did find a solution! =D

  • Suraj Pant 11 posts 42 karma points
    Jan 07, 2014 @ 08:17
    Suraj Pant
    0

    Hi Ismail,

     

    I am getting same issue un V6.1.6 also, while  XML setting is also falese. <UseLegacyXmlSchema>false</UseLegacyXmlSchema>

    Can you help?

    Regards,

    Suraj

     

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Jan 07, 2014 @ 10:08
    Ismail Mayat
    0

    Suraj,

    Try rebuilding your internal index if that dont work then try re saving just one of the media items see if that regenerates the xml.

    Regards

    Ismail

  • Zakhar 171 posts 397 karma points
    May 08, 2014 @ 13:24
    Zakhar
    0

    Have you been able to solve the problem, Suraj, I use the same version and have the same problem, my xml is:

    <images>
                  <DAMP fullMedia="">
                    <mediaItem>
                      <Image id="1069" version="aca7833b-9167-4c88-a5a4-7bf77bb13611" parentID="1066" level="2" writerID="0" nodeType="1032" template="0" sortOrder="2" createDate="2014-01-14T17:53:59" updateDate="2014-01-14T17:53:59" nodeName="Financials Workflow" urlName="financialsworkflow" writerName="zakhar" nodeTypeAlias="Image" path="-1,1066,1069">
                        <umbracoFile>/media/1005/financials-workflow.png</umbracoFile>
                        <umbracoWidth>640</umbracoWidth>
                        <umbracoHeight>350</umbracoHeight>
                        <umbracoBytes>90040</umbracoBytes>
                        <umbracoExtension>png</umbracoExtension>
                      </Image>
                    </mediaItem>
                    <mediaItem>
                      <Image id="1068" version="96510599-85fa-4442-9fc0-db63121d6175" parentID="1066" level="2" writerID="0" nodeType="1032" template="0" sortOrder="1" createDate="2014-01-14T17:53:58" updateDate="2014-01-14T17:53:58" nodeName="DATAFLOW" urlName="dataflow" writerName="zakhar" nodeTypeAlias="Image" path="-1,1066,1068">
                        <umbracoFile>/media/1004/DATAFLOW.gif</umbracoFile>
                        <umbracoWidth>640</umbracoWidth>
                        <umbracoHeight>397</umbracoHeight>
                        <umbracoBytes>195066</umbracoBytes>
                        <umbracoExtension>gif</umbracoExtension>
                      </Image>
                    </mediaItem>
    

    I gat all kind of errors, just can't access any of the properties

    'Umbraco.Core.Dynamics.DynamicXml' does not contain a definition for 'Id'
    'Umbraco.Core.Dynamics.DynamicXml' does not contain a definition for 'Url'
    'Umbraco.Core.Dynamics.DynamicXml' does not contain a definition for 'mediaItem'
    'Umbraco.Core.Dynamics.DynamicXml' does not contain a definition for 'umbracoFile'
    

    I simply need to get url of a file, can anyone advise?

    Thank you

  • Arjun Singh 15 posts 86 karma points
    Mar 06, 2018 @ 10:56
    Arjun Singh
    0

    This issue comes when we upgrade from version 6 to 7.

    To resolve this issue , you have to check the data type of the existing node type that the picker is using.

    umbraco 6 uses the custom data type created by uComponent which is deprecated in version higher than 7.

    Just replace the respective picker with **MultiNode Tree picker** in Umbraco 7 , that will help in resolving the issue.
    
    You can get the list of available list of Data Types supported by Umbraco 7 , in Developer section when you login as Admin.
    

    Just create new data type with Multinode Tree Picker and use it to replace with the existing content property.

    Dynamic Xml will be converted to DynamicNodeList and your life is easy :)

    Thanks , let me know for any further queries. i have successfully upgraded version 6 to 7 of very Huge banking site.

    Regards, Arjun Singh

Please Sign in or register to post replies

Write your reply to:

Draft