gpt4 book ai didi

Tridion 核心服务 : How to check if multi line field has rich text formatting enabled?

转载 作者:行者123 更新时间:2023-12-04 22:33:55 25 4
gpt4 key购买 nike

我想检查核心服务是否在多行字段上启用了富文本格式。

如果我在启用富文本格式后分析模式的来源,那么为此目的插入了很多标签:-

  <tcm:Size xmlns:tcm="http://www.tridion.com/ContentManager/5.0">2</tcm:Size>
<tcm:FilterXSLT xmlns:tcm="http://www.tridion.com/ContentManager/5.0">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" method="xml" cdata-section-elements="script"></xsl:output>
<xsl:template name="FormattingFeatures">
<FormattingFeatures xmlns="http://www.tridion.com/ContentManager/5.2/FormatArea">
<Doctype>Transitional</Doctype>
<AccessibilityLevel>0</AccessibilityLevel>
<DisallowedActions></DisallowedActions>
<DisallowedStyles></DisallowedStyles>
</FormattingFeatures>
</xsl:template>
<xsl:template match="/ | node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"></xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template match="/body[not(processing-instruction() or comment() or normalize-space(translate(., &apos; &apos;, &apos;&apos;)) != &apos;&apos; or *[@* or * or comment() or processing-instruction() or not(self::p or self::br)])]">
<!-- make an empty <body> if all the body has is empty paragraphs, line-breaks and (non-breaking) spaces -->
<xsl:copy></xsl:copy>
</xsl:template>
<xsl:template match="p[not(@* or * or comment() or processing-instruction() or normalize-space(translate(., &apos; &apos;, &apos;&apos;)) != &apos;&apos; or following-sibling::node()[@* or * or comment() or processing-instruction() or not(self::p or self::text()) or normalize-space(translate(., &apos; &apos;, &apos;&apos;)) != &apos;&apos;])]">
<!-- ignore all paragraphs at the end that have nothing but (non-breaking) spaces -->
</xsl:template>
</xsl:stylesheet>
</tcm:FilterXSLT>

但究竟哪个属性是查找是否启用富文本的属性,即使在核心服务 API 文档中我也无法弄清楚。

我的核心服务代码有点像下面:-

SessionAwareCoreService2010Client client = new SessionAwareCoreService2010Client();
client.ClientCredentials.Windows.ClientCredential.UserName = "myUserName";
client.ClientCredentials.Windows.ClientCredential.Password = "myPassword";
client.Open();
SchemaFieldsData fields = client.ReadSchemaFields("tcm-x-y-z",
true, new ReadOptions());


foreach (var field in fields.Fields)
{
if (field is MultiLineTextFieldDefinitionData)
{
return Constants.DataType.STRING;
}
}

请建议。

最佳答案

只需更改您的“is”检查以与 XhtmlFieldDefinitionData 进行比较:

if (field is XhtmlFieldDefinitionData)
{
...
}

关于Tridion 核心服务 : How to check if multi line field has rich text formatting enabled?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12914726/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com