How to add a new view (as well as a new type of menu item) to existing Joomla 2.5 components?

Perhaps I want to add a new view , as well as a new Menu Item Type component for content.

What are the steps please?

UPDATE

Question (by @ValentinDespa ):

Do you want to extend the functionality of com_content or want to override view or create a new component that does something?

As I said, I want to extend com_content and add a new view to it. Now there are several types, such as Single Article , Category Blog and Category List .

I want to add other menu items called Article Titles , so only headings will be displayed, but with some parameters (for example, the number of columns).

This is a necessity that is not provided by current functions.

Note

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

+4
source share
1 answer

Yes, you can create a new presentation.

Simple copying of any kind (category, blog) from your com_content.

The file structure should be like inside a 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. 

You can then access this view by specifying the correct URL. for example: www.example.com/index.php?option=com_content&view=&ourviewname&layout=yourlayoutnames.

Here I mentioned the name of the view folder, which should be the name of the controller and model, which we can achieve with a different name, but it will create a problem for you when you do not succeed in joomla.

Note: To add a view, you do not need to install the component, this is not a good idea.

You can also add several layouts in the form inside your tmpl folder, just create new files. Also do not miss the controller and model to add to the folder com_contents / controller and com_contents / model

for more help take a look at this

+3
source

Source: https://habr.com/ru/post/1447420/


All Articles