如何在 Umbraco 中更改 URL 名称
这是我第一次使用 Umbraco,我使用错误的命名格式创建了文档类型/页面,现在这已经转化为我的页面 URL,例如 /about-page/
.我将如何将它们更改为 /about
,因为我已经搜索了后端管理面板,并且似乎没有更改其 文档链接
的选项价值.
This is my first time round using Umbraco and I have created Document Types / Pages using the wrong naming format and now this has transpired into my page URL's, for instance /about-page/
. How would I go about changing them to /about
as I have searched the back-end admin panel and there dose't seem to be an option to change their link to document
values.
是否有人能够使用 umbracoUrlAlias 或 umbracoUrlName 提供一个基于代码的简单示例,我如何最好在 Razor 中更改它.
Would anyone be able to provide a simple code based example using umbracoUrlAlias or umbracoUrlName how I could change this preferably in Razor.
谢谢
Editing @run yards Solution by digbyswift help in comment
Editing @run yards Solution by digbyswift help in comment
正确的解决方案:
- 在文档类型中创建属性,这适用于您要更改 URL 的所有页面
- 任意命名,例如页面 URL 并可能给它一个新标签.
- 调用别名umbracoUrlName
- 输入为文本字符串
- 不应强制(当您开始在视图中将
.Url
替换为.umbracoUrlAlias
时,它需要存在) - 标签为通用
- 点击页面右上角的保存
- Create Property on in Document Types which applies to all pages you want to change the URL
- Call the name anything you want e.g Page URL and Possibly give it a new tab.
- Call the alias umbracoUrlName
- Type as text sting
- Should not be Mandatory (As when you start replacing
.Url
with.umbracoUrlAlias
within the views it will need to be present) - Tab as Generic
- Click Save on top right on the page
在 Umbraco v7.2.5 上添加了入门套件的屏幕截图
Added screenshot for starter kit on Umbraco v7.2.5