Use underscore (_) in joomla menu alias

倾然丶 夕夏残阳落幕 提交于 2019-12-24 03:03:52

问题


I want to use underscore in menu alias in joomla. For a menu item called "Residential Storage" I want to use "residential_storage" as alias but when I save this it becomes "residential-storage", so underscore is being replaced by hyphen. How can I use hyphen?


回答1:


Normally the alias should consist of lowercase letters and hyphens (-). No blank spaces or underscores are allowed.But to use underscore check the link below.This method will replace all (-) to (_). http://forum.joomla.org/viewtopic.php?f=618&t=638854




回答2:


Previous answer do not work for me.

And I find easy (and dirty) way.

  1. Look for \libraries\joomla\filter\output.php
  2. Just after the line (102), which contains: $str = trim($str, '-');
  3. Insert this code: $str = str_replace('ttt', '_', $str);
  4. Now in every menu alias, where you type tripple t it'll be replaced with (_) symbol. You can use other characters obviously. You can even use (-) here, but I do not recommend it. Let's just say- this method is good help when you change CMS, but do not want to loose positions in search results, because of this_kind_of_links on old site and this-kind-link on new. Just remember- you need to use lowercase character for replacements (because all characters becames lowercase after menu saving).


来源:https://stackoverflow.com/questions/13717253/use-underscore-in-joomla-menu-alias

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!