简体   繁体   English

Typo3 RealUrl + tt_news - >缩短网址

[英]Typo3 RealUrl + tt_news -> shorten URL

for my tt_news entries, realurl generates links like: 对于我的tt_news条目,realurl生成如下链接:

www.mydomain.com/announcements/news/news/article/date/2013/06/26/a_very_long_filename_which_is_horrible.html

so i try to get my typo3 to generate something like this: 所以我试着让我的错字3生成这样的东西:

www.mydomain.com/news/short_title.html

but I have no clue how to do this? 但我不知道怎么做?

Although Merec's solution is some option, de facto you can do the trick without any single line of coding. 虽然Merec的解决方案是一些选择,事实上你可以在没有任何单行编码的情况下完成这个工作。

  1. Place the 'news' page dedicated for single view in the root tree (not in branch Announcements > News > News ) 在根树中放置专用于单个视图的“新闻”页面(不在分支Announcements > News > News
  2. Use tt_news' config to remove dates from URL -> check the manual , search for HRdates options, to avoid them. 使用tt_news'config从URL中删除日期 - > 查看手册 ,搜索HRdates选项,以避免它们。
  3. If required use fixedPostVars to make the URL's as short as possible on given (single) page. 如果需要,使用fixedPostVars使URL在给定(单个)页面上尽可能短。

Also you have two options for horrible_long_title.html - first is using additional field in for tt_news where you can restrict the length in the BackEnd ie. 你也有两个horrible_long_title.html选项 - 首先是在tt_news中使用额外的字段,你可以限制tt_news中的长度,即。 to 100 chars... 到100个字符......

second probably better solution is allowing to use all characters by changing the RealURL config: 第二个可能更好的解决方案是允许通过更改RealURL配置来使用所有字符:

'lookUpTable' => array(
    'table'               => 'tx_ttnews', // I don't remember now if it's correct tt_news' table...
    'maxLength'           => 9999, // By default it's 100
    'id_field'            => 'uid',
    'alias_field'         => 'title',
    // other config
),

The best way to handle this is to create a small extension which extends the tt_news entries by a field which can be used as alternative for generating the title. 处理此问题的最佳方法是创建一个小扩展,它通过一个字段扩展tt_news条目,该字段可用作生成标题的替代方法。

Realurl uses the field title by default to generate the article-url. Realurl默认使用字段title来生成article-url。 The field that will be used can be modified in your realurl.conf . 可以在realurl.conf修改将要使用的字段。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM