简体   繁体   English

Joomla菜单项

[英]Joomla menu item

I want to create a subtitle option for menu items in Joomla (an alternate layout), so a menu item displays with its title and subtitle. 我想为Joomla(替代布局)中的菜单项创建字幕选项,因此显示菜单项及其标题和字幕。 I imagine this can be done in many ways, including: 我想这可以通过多种方式完成,包括:

1) Altering menu item layout in Joomla and adding a subtitle input field, telling Joomla to display this subtitle field in the menus that I wish to display it in. 1)更改Joomla中的菜单项布局并添加字幕输入字段,告诉Joomla在希望显示它的菜单中显示此字幕字段。

2) Entering the subtitle directly in the current menu item title field and getting Joomla to render this as a separate title (subtitle). 2)直接在当前菜单项的标题字段中输入字幕,并让Joomla将其呈现为单独的标题(字幕)。

I am sure there are more ways and pros or cons for all. 我相信所有人都有更多的方法和利弊。 I reckon going for option 2 would be the easiest. 我认为选择选项2是最简单的。 In option 2 the input in the menu item manager can be: 在选项2中,菜单项管理器中的输入可以是:

Menu Item title: blablabla || 菜单项标题:blablabla || yadayadayada yadayadayada

Joomla needs to reckognize the pipes as seperator between menu item title and menu item subtitle and render them seperately so I can style them. Joomla需要将管道重新识别为菜单项标题和菜单项副标题之间的分隔符,并分别渲染它们,以便我可以对其进行样式设置。

I am really noob in php. 我真的是PHP的菜鸟。 Could anyone point me in the right direction on how to construct this override? 谁能指出我关于如何构造此替代的正确方向?

Any help is highly appreciated. 非常感谢您的帮助。

/nitro29 /硝基29

If you're a 'real noob' in php I would suggest using one of many menu extensions on the Joomla Extension Directory that already do this. 如果您是php中的“真正的菜鸟”,我建议您使用Joomla扩展目录中已经执行此操作的众多菜单扩展之一。

One of the most popular that comes to mind is RokNavMenu from RocketTheme — it's both free and open source and used extensively by them in all of their templates. 想到的最流行的一种是RocketThemeRokNavMenu ,它既免费又开源,并且在他们的所有模板中得到了广泛的使用。

If none of them do exactly what you want, then you can pick the one closest to your needs and modify it, which will definitely be quicker that re-inventing the wheel and learning all the ins and outs of the Joomla CMS and frameworks. 如果它们都不能够完全满足您的需求,那么您可以选择最接近您的需求并对其进行修改,这无疑会更快地重新发明轮子并了解Joomla CMS和框架的所有来龙去脉。

If you do want to develop your own I would suggest keeping the Joomla Doc's site open to the Developer portal page . 如果您确实想开发自己的应用程序,建议您将Joomla Doc的网站保持在开发人员门户页面 打开。 It can be very handy, even if you have to search a bit. 即使您需要进行一些搜索 ,它也可能非常方便

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

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