• <bdo id='WecZm'></bdo><ul id='WecZm'></ul>

      <tfoot id='WecZm'></tfoot>

      <small id='WecZm'></small><noframes id='WecZm'>

      <i id='WecZm'><tr id='WecZm'><dt id='WecZm'><q id='WecZm'><span id='WecZm'><b id='WecZm'><form id='WecZm'><ins id='WecZm'></ins><ul id='WecZm'></ul><sub id='WecZm'></sub></form><legend id='WecZm'></legend><bdo id='WecZm'><pre id='WecZm'><center id='WecZm'></center></pre></bdo></b><th id='WecZm'></th></span></q></dt></tr></i><div id='WecZm'><tfoot id='WecZm'></tfoot><dl id='WecZm'><fieldset id='WecZm'></fieldset></dl></div>
      <legend id='WecZm'><style id='WecZm'><dir id='WecZm'><q id='WecZm'></q></dir></style></legend>
    1. 如何向现有的 joomla 2.5 组件添加新视图(以及新的菜单项类型)?

      时间:2023-10-11
          <tbody id='eDcq6'></tbody>

          <tfoot id='eDcq6'></tfoot>

          <i id='eDcq6'><tr id='eDcq6'><dt id='eDcq6'><q id='eDcq6'><span id='eDcq6'><b id='eDcq6'><form id='eDcq6'><ins id='eDcq6'></ins><ul id='eDcq6'></ul><sub id='eDcq6'></sub></form><legend id='eDcq6'></legend><bdo id='eDcq6'><pre id='eDcq6'><center id='eDcq6'></center></pre></bdo></b><th id='eDcq6'></th></span></q></dt></tr></i><div id='eDcq6'><tfoot id='eDcq6'></tfoot><dl id='eDcq6'><fieldset id='eDcq6'></fieldset></dl></div>

          <small id='eDcq6'></small><noframes id='eDcq6'>

        1. <legend id='eDcq6'><style id='eDcq6'><dir id='eDcq6'><q id='eDcq6'></q></dir></style></legend>

            <bdo id='eDcq6'></bdo><ul id='eDcq6'></ul>
                本文介绍了如何向现有的 joomla 2.5 组件添加新视图(以及新的菜单项类型)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                也许我想向内容组件添加一个新的 view,以及一个新的 Menu Item Type.

                Maybe I want to add a new view, and also a new Menu Item Type to content component.

                请问步骤是什么?

                更新

                问题(来自@ValentinDespa):

                您想要扩展 com_content 功能或您想要覆盖查看或构建一个新组件来做某事?

                You want to extend com_content functionality or you want to override a view or to build a new component that does something?

                正如我所说,我想扩展 com_content 并向其添加一个新视图.现在有一些视图,例如Single ArticleCategory BlogCategory List.

                As I said, I want to extend com_content and add a new view to it. There are some views like Single Article, Category Blog, and Category List right now.

                我想添加另一个名为 Article Titles 的菜单项,这样只会显示标题,但带有一些参数(如列数).

                I want to add another menu items called Article Titles, so titles only will be displayed but with some parameters (like columns count).

                这是当前功能无法提供的需求.

                It is a need that is not supplied by current features.

                注意

                伙计们,我的新视图应该是什么样的并不重要,请告诉我如何创建新视图.

                Guys, it doesn't matter what my new view should be like, please tell me How to create a new view.

                推荐答案

                是的,您可以创建新视图.

                Yes You can create a new view.

                很简单,只需从您的 com_content 中复制任何视图(类别、博客).

                Its simple just copy any of the view (category,blog) from your com_content.

                文件结构应该和文件夹里面的一样.

                The file structure should be like inside the folder.

                Step 1
                
                view.html.php
                tmpl
                   your layout names(default.php)
                xml file.
                Also remember to change the class name of the view.html.php
                
                Step 2
                
                Add a controller file (just make a copy of existing one category or blog)
                Controller name must be your new view folder name.
                Also remember to change the class name of the controller
                
                step 3 
                
                add a model file for your new view (same make copy of any existing)
                remember to change the class name and file name should be view folder name.
                

                然后您可以通过提供正确的网址来访问此视图.例如:www.example.com/index.php?option=com_content&view=yourviewname&layout=yourlayoutnames.

                Then you can access this view by giving correct url. eg: www.example.com/index.php?option=com_content&view=yourviewname&layout=yourlayoutnames.

                这里我提到视图文件夹名称必须是控制器和模型文件名,我们也可以用其他名称来实现,但是当你不擅长 joomla 时,它会给你带来问题.

                Here I mentioned view folder name must be controller and model file name we can achieve with other name also but it will create problem for you when you are not good in joomla.

                注意:要添加视图,您根本不需要安装组件,这根本不是一个好主意.

                Note: For adding a view you don't need to install a component its not a good idea at all.

                您也可以在一个视图中添加多个布局在您的 tmpl 文件夹内只需创建新文件.另外不要错过控制器和模型放入 com_contents/controller 和 com_contents/model 文件夹

                Also You can add multiple layouts in a view inside your tmpl folder just create new files.Also don't miss the controller and model to put in com_contents/controller and com_contents/model folder

                更多帮助看看这个

                这篇关于如何向现有的 joomla 2.5 组件添加新视图(以及新的菜单项类型)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:仅向注册用户显示 joomla 文章,如果未登录则显示登录屏幕是 下一篇:joomla spambots 错误

                相关文章

                <i id='xaLdi'><tr id='xaLdi'><dt id='xaLdi'><q id='xaLdi'><span id='xaLdi'><b id='xaLdi'><form id='xaLdi'><ins id='xaLdi'></ins><ul id='xaLdi'></ul><sub id='xaLdi'></sub></form><legend id='xaLdi'></legend><bdo id='xaLdi'><pre id='xaLdi'><center id='xaLdi'></center></pre></bdo></b><th id='xaLdi'></th></span></q></dt></tr></i><div id='xaLdi'><tfoot id='xaLdi'></tfoot><dl id='xaLdi'><fieldset id='xaLdi'></fieldset></dl></div>

                    <bdo id='xaLdi'></bdo><ul id='xaLdi'></ul>

                  <small id='xaLdi'></small><noframes id='xaLdi'>

                  <legend id='xaLdi'><style id='xaLdi'><dir id='xaLdi'><q id='xaLdi'></q></dir></style></legend>
                  1. <tfoot id='xaLdi'></tfoot>