如何将条件语句添加到resx文件?(How do I add a conditional statement to a resx file?)

编程入门 行业动态 更新时间:2024-10-24 14:17:35
如何将条件语句添加到resx文件?(How do I add a conditional statement to a resx file?)

我在DNN安装中有一个子门户,其站点名称我不想出现在由resx文件编译的电子邮件中。 我想改为使用主站点的名称。 例如,xyz.com将发送一封电子邮件,地址名称为“XZY”,但子门户网站xzy.com/abc将发送一封电子邮件,地址名称为“ABC”。 我想用“XZY”取代“ABC”。 请记住,我有不止一个子门户。 如何在resx文件中编写条件语句来检查[Portal:PortalName],如果是,则替换为“ABC”?

<data name="EMAIL_PORTAL_SIGNUP_SUBJECT.Text" xml:space="preserve"> <value>[Portal:PortalName] Portal Signup</value> </data>

添加如下条件:

<value>If[Portal:PortalName]="ABC", "XYZ" Else [Portal:PortalName]</value>

编辑:我忘了添加一件事。 resx文件是用于DNN安装中的所有门户的globalresources.resx。 此文件管理电子邮件模板(如忘记密码,通知等)和HTML页面(如使用条款和隐私声明)。 该文件位于httpdocs / App_GlobalResources文件夹中。 主要门户网站和所有儿童门户网站都使用此功能。

I have a child portal in DNN installation whose site name I do not want to appear in an email compiled by a resx file. I want to use the main site's name instead. Example, xyz.com will send an email with the site name of "XZY" but the child portal xzy.com/abc would send an email with the site name of "ABC". I want to replace "ABC" with "XZY". Keep in mind that I have more than one child portal. How do I write a conditional statement in the resx file to check [Portal:PortalName] and replace with "ABC" if yes?

<data name="EMAIL_PORTAL_SIGNUP_SUBJECT.Text" xml:space="preserve"> <value>[Portal:PortalName] Portal Signup</value> </data>

Add a condition like so:

<value>If[Portal:PortalName]="ABC", "XYZ" Else [Portal:PortalName]</value>

EDIT: I forgot to add one more thing. The resx file is globalresources.resx used for all portals in the DNN installation. This file manages email templates (such as forgot password, notification, etc) and HTML pages (such as Terms of Use and Privacy Statement). This file is located in httpdocs/App_GlobalResources folder. THis is used by the main portal and all child portals.

最满意答案

您可以通过转到“管理>语言”来编辑resx文件

在那里你可以点击“网站”。 这将打开一个Treeview熟悉的弹出窗口。

通过展开树形视图找到正确的resx文件,编辑并保存。 DNN会将门户标识添加到resx文件名中: Terms.ascx.Portal-0.resx ,因此它也可能通过手动编辑和保存(未经测试)

在这里输入图像描述

You can edit a resx file by going to "Admin > Languages"

There you can click on "Site". That will open the familiar popup with a Treeview.

Find the correct resx file by expanding the treeview, edit and save. DNN will add the portal id to the resx filename: Terms.ascx.Portal-0.resx, so it probably also work by editing and saving like that manually (not tested)

enter image description here

更多推荐

resx,ABC,file,Portal,电脑培训,计算机培训,IT培训"/> <meta name="descript

本文发布于:2023-07-24 00:27:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1239290.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何将   语句   条件   文件   statement

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!