如何在 Umbraco 中更改 URL 名称 [英] How to change URL names in Umbraco

查看:28
本文介绍了如何在 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

正确的解决方案:

  1. 文档类型中创建属性,这适用于您要更改 URL 的所有页面
  2. 任意命名,例如页面 URL 并可能给它一个新标签.
  3. 调用别名umbracoUrlName
  4. 输入为文本字符串
  5. 不应强制(当您开始在视图中将 .Url 替换为 .umbracoUrlAlias 时,它需要存在)
  6. 标签为通用
  7. 点击页面右上角的保存
  1. Create Property on in Document Types which applies to all pages you want to change the URL
  2. Call the name anything you want e.g Page URL and Possibly give it a new tab.
  3. Call the alias umbracoUrlName
  4. Type as text sting
  5. Should not be Mandatory (As when you start replacing .Url with .umbracoUrlAlias within the views it will need to be present)
  6. Tab as Generic
  7. Click Save on top right on the page

在 Umbraco v7.2.5 上添加了入门套件的屏幕截图

Added screenshot for starter kit on Umbraco v7.2.5

这篇关于如何在 Umbraco 中更改 URL 名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆