0

我在 Razor-Mediator 模板中使用了一些常用函数,

根据 Razor 文档,我们可以创建一个帮助文件并在其中定义所有常用函数。

<razor.mediator cacheTime="60" extractBinaries="true" adminUser="XXX\pgupta">
    <namespaces>
      <add namespace="System.Linq" />
      <add namespace="Tridion.Extensions.Mediators.Razor.Templating" />
    </namespaces>
    <assemblies>
      <!-- <add assembly="C:\Program Files\Assembly\Test.Sample.dll" /> -->
      <!--<add assembly="RazorSample.Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=60ad7434f03dfcdc" />-->
    </assemblies>
    <imports>
      <!--<add import="tcm:4-21631-2048" />-->
      <add import="/webdav/04 Vanilla Layout/Building Blocks/System/Template Building Blocks/Razor/razor.cshtml" />
      <add import="C:\Program Files (x86)\Tridion\Razor Mediator\helper.cshtml" />
      <!-- <add import="tcm:120-2200-2048" publications="020 Design Master,030 Another Web Design" />-->
    </imports>
    <importSettings includeConfigWhereUsed="true" includeImportWhereUsed="true" replaceRelativePaths="false" />
  </razor.mediator>

当我在配置文件中定义物理路径时,我成功导入了这些所有功能。

但是,当我在配置文件中定义 wevDAV URL 时,它不起作用,

有人可以帮我吗?

4

1 回答 1

1

I see spaces in your webdav path - is it like this or do you have %20 and SO is stripping them out?

I usually write a small VBScript Page Template and put use this code to get the webdav URL:

[%
dim uri, item
uri = "tcm:0-0-0"  ' update this uri and use the item in the parent repository
set item = TDSE.GeTObject(uri, 1)
WriteOut item.info.WebdavUrl
%]

Otherwise, the Razor 1.3 Mediator added Where Used functionality compatibility and this could be causing some issues. The source code was updated to 1.31 but a compiled version of it is not on the Google Code Downloads. You can grab the source and compile yourself to use the latest version: http://code.google.com/p/razor-mediator-4-tridion/source/list

于 2012-10-30T12:56:23.773 回答