简体   繁体   English

在Umbraco中找到Media项目的xml源?

[英]Finding the xml source for Media items in Umbraco?

I want to make some xslt or .net macros, but I don't really know how the xml-source. 我想制作一些xslt或.net宏,但是我真的不知道xml-source的方式。 Isn't there a way to retrieve the source or is it hidden? 是否没有办法检索源或将其隐藏?

I would recommend posting your questions on http://our.umbraco.org instead of on Stack Overflow as there are way more people who know the answer hanging out there than there are on Stack Overflow. 我建议将您的问题发布在http://our.umbraco.org上,而不要发布在Stack Overflow上,因为与Stack Overflow相比,知道答案的人更多。

The XML source for all of your content is available from the /App_Data/umbraco.config file. /App_Data/umbraco.config文件中提供了所有内容的XML源。

The XML source for media items is indeed hidden. 媒体项的XML源确实是隐藏的。 You could try to use: 您可以尝试使用:

<xsl:copy-of select="umbraco.library:GetMedia($currentPage/image, 0)" /> 

.. where "image" is the alias of the media picker property. ..其中“图像”是媒体选择器属性的别名。

The default media item's XML should look a bit like this: 默认媒体项的XML应该看起来像这样:

      <Image id="1080" version="95613824-93a7-42ea-b2dd-284d247e9c40" parentID="1079" level="2" writerID="0" nodeType="1032" template="0" sortOrder="1" createDate="2011-05-11T10:40:12" updateDate="2011-05-11T10:40:12" nodeName="Default" urlName="default" writerName="admin" nodeTypeAlias="Image" path="-1,1079,1080">
        <umbracoFile>/media/491/img1.jpg</umbracoFile>
        <umbracoWidth>2580</umbracoWidth>
        <umbracoHeight>436</umbracoHeight>
        <umbracoBytes>169477</umbracoBytes>
        <umbracoExtension>jpg</umbracoExtension>
      </Image>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM