Joomla blog templates. Menu type: category blog template Joomla category template

There are often situations when you need different categories in Joomla! output using individual templates. For example, the news category is displayed with its own template, and the article category should be displayed with its own template, which is very different from the Joomla news display template. Here is a simple way to do this at the level of output templates of the standard com_content, without affecting the core of Joomla.

Having examined the structure of the standard com_content component in Joomla, let's copy the output files of category templates into our Joomla template, if they are not already there. Consider the category blog output template:

(root) \ templates \ (TEMPLATE) \ html \ com_content \ category \ blog.php - initial template

(root) \ templates \ (TEMPLATE) \ html \ com_content \ category \ blog_item.php - material template

(root) \ templates \ (TEMPLATE) \ html \ com_content \ category \ blog_links.php - template for links to the following materials

The first is to load the blog.php output template, which in turn uses the other two templates. To solve the problem, you do not need to touch the Joomla core files, but only templates will be used.

Since blog.php will be loaded first, manipulations must be carried out with it accordingly. You can add the necessary condition to it to check Joomla categories... After checking the prohibition of direct access, add:

items-> catid === $ categories [$ i]) ($ this -> _ layout = "myblog"; $ this-> display (); $ check = true; break;)) // If the condition does not match, display the usual template if (! isset ($ check)): $ cparams = & JComponentHelper :: getParams ("com_media"); ?>

And at the end of the file, close the condition:

Let's analyze a little code:

Into a variable $ categories ask ID categories that need to be displayed in a separate template, separated by commas. Then, accordingly, we order this whole thing into an array and select the first element in order to determine the category to be displayed. Then we compare this category with those given in the variable. $ categories and if there is a match, set our template and display it. If no matches are found, then the variable $ check is not installed and the usual blog.php template is displayed.

All that remains to be done is to create our template files in the same directory:

(root) \ templates \ (TEMPLATE) \ html \ com_content \ category \ myblog.php - initial template

(root) \ templates \ (TEMPLATE) \ html \ com_content \ category \ myblog_item.php - material template

(root) \ templates \ (TEMPLATE) \ html \ com_content \ category \ myblog_links.php - template for links to the following materials

Thus, you can control the output templates for different categories without affecting the Joomla core.

V WordPress this is very easy to implement: just create a copy of the template category.php and add a slug to it (the English-language system name of the heading) from the required heading. For example: category-news.php will be used when displaying posts of a category with a slug news.

Hello dear readers of the blog site. Today we will continue, which we have already raised several times earlier, and also learned. Today we will try to consider various options for displaying articles on site pages using various menu items.

The menu is one of the fundamental parts and usually acts as navigation elements. But in addition to navigation, they determine what exactly will be displayed on dynamic page after going to it via the link. In fact, they determine what will be displayed on a particular page.

What is it for and how to work with Joomla menu items

This is not easy to understand, especially for those users who have dealt with static sites, in which the role of the menu was reduced only to providing navigation. In general, the issue of organizing content and methods of displaying content is one of the most difficult for novice jumblers.

At first, it is very difficult to grasp the entire relationship between the menu, its items, the content of the web pages and the modules in which they are displayed. But let's talk about everything in order. Firstly, they, as in any other website, can be located both horizontally (most often in the upper part of the window, but it is also possible to create the lower one), and vertically (either in the left or in the right column of the template).

Interestingly, the navigation menu item in Joomla can lead to a page with a single article, or to a blog or a list of materials contained in any category or section. Moreover, the same publication can be accessed by different links from the menu.

Some link will open it all alone on a web page, and some will display it as a list or as a blog of the category or section to which it belongs. You probably don't quite understand what this is about yet, but I hope that this understanding will come when you finish reading this guide.

So, you can see all this wealth in one place - in the menu manager. It will be possible to get into it from the admin panel by selecting from it top line"All menus" - "Menu". For each of them, you can create items that will form web pages with one or another.

Their appearance is set from the settings of these same menu items. This is very important to understand, because knowing where to look for certain settings, you will greatly facilitate your task. , as well as configuring modules for them.

Having entered the menu manager, you can click on the icon in the column opposite the one you need, as a result of which a list of all the items that are already in it will open. Access to this page can also be obtained by simply selecting in the admin panel from its top line "All menus" - "The name of the one you need":

As a result, a window with a list will open:

Creating a menu item

At the top of it you will see buttons, among them there will be a "Create" button, by clicking on which the wizard for creating a new navigation element will open:

In this window, you will see a tree structure of the types of menu links that you can create in Joomla. This tree contains nested elements that will open after clicking on the selected parent branch. Everything is pretty simple and intuitive.

It serves so that we can choose a presentation option for the page to which the transition will be made after clicking on the created menu link. In other words, you will have to select one of the Joomla page templates. Different templates allow you to combine one or more articles based on the sections and categories to which they belong.

Please note that in the above tree there are quite a few options and they are broken down by the types of components (this), on the basis of which the content will be displayed on the site. We are primarily interested in the options that offer to create a Content component built into the engine by default, which is responsible for working with materials.

But in addition to the main component for working with articles, there are others, which, in turn, will also add their own options to this tree, allowing you to link to web pages with content generated by our Content.

But for now we will dwell on the consideration of the withdrawal of materials, and everything else will be considered to the best of our ability. So, a menu item in Joomla can refer to three main types of pages: with a single article, an entire category, or a section.

In addition, a menu item can point to both separate component and the category of this component. For example, for you can create a link leading both to a page with a list of all categories of the gallery you have created, and to a page with content (photos) of a single one.

This disgrace can look like this:

At the same time, the following options were selected in the tree from those that were added after installing the Phoca Gallery component:

The main task when creating a site in Joomla is to properly organize the content (content, content). I mean the structure of sections and categories, both for articles and, for example, for the photo gallery component. Well, there are a lot of methods for displaying well-structured content.

True, it is often the variety of withdrawal methods that causes difficulties for novice users. But, I hope that by the end of reading this publication, you will slightly reduce the confusion introduced by the confused system, and there will be clarity on at least some issues.

If you want to achieve the most convenient navigation, then you should start with the correct formation of sections and categories and the distribution of existing articles between them. And to form already on this basis a branched system of menus and their elements for a convenient and understandable output for users will already be a matter of technology.

Menu items that allow you to display articles on the site

To display content on the site, which includes articles, you will need to add new elements to the menu from the tree branch called "Materials". Quite logical, I suppose. By clicking on this branch of the tree, you will see a list of all possible options that you can use to display materials on the web pages of your site:

There are not so many of them, but they will allow you to display article content in a wide variety of forms - from individual publications to a blog of an entire section on one page of the website.

Now we just need to understand what this or that option is for in this branch of the tree, and then figure out their settings, which allow you to display blogs or lists of articles in Joomla. With these settings, you can set the appearance and display order of materials. But first things first.

We will consider the option of displaying a single article at the end of the publication, and there is nothing complicated and requiring attention there. And now I want to dwell on two main output patterns:

  1. Blog template (category or section) - so called because the way articles are displayed in this case resembles standard blogs. In this case, the web page generated in Joomla, in general, will be a series of announcements (introductory parts) of articles, which will end with the link "More". They will all belong to either one section or one category that you choose when setting up.
  2. A standard template for a section or a category list, which is essentially the same thing. The web page formed in Joomla will be a table in which either the headings of the categories from a specific section, or the headings of articles from a specific category will be listed.

Of course, the blog template has much more flexibility than the standard one, which displays page content in a table only in the form of headings that are links to full versions articles.

The format of a category or section blog allows you to display not only the titles of articles, but also add a small announcement, which allows you to arouse additional interest among visitors to this page to continue reading and click on the "More" link.

At the same time, you can quite flexibly customize the appearance of displaying articles. It will be possible to set how many announcements will be displayed in the full width of the page, how many will be divided into columns, set the number of columns and determine the number of materials displayed at the bottom as links.

How to create a blog in Joomla based on category articles

Let's first try to create a menu item in Joomla based on a category (or section) blog template and look at all the settings that we can change. They will be almost identical for them. Therefore, we will consider only the option based on the category template, and you can figure out the section yourself by analogy.

So, go to the Joomla admin panel, select their top line items "All menus" - "The name you need." On the page that opens, click the "Create" button located at the top. In the tree that opens, click on the option "Materials" - "Category" - "List template". As a result of these actions, a window will open with the settings of the menu item based on the template you selected:

In the "Title" field, as usual, enter the name for this menu item that will be displayed on the site. The "Alias" field should only be filled in if. Then you will need to.

If you use third-party components for organizing SEF, you will not need to fill it out. I already wrote.

The Link field displays a hyperlink to the page generated from this menu item. You can copy it and use it to provide web links from the text of other articles on your site. In the "Show in" field, you will have to select a menu in which the item we are creating will be located.

In the column " Parent element»You can choose a parent for the created element, when you click on which, our nested item will be displayed in the menu. If you do not want to make it nested, then you should leave the default option "Top".

In the "Access" area, you can specify which of the visitors will see this item. Either everyone (used most often), or only registered, or only Joomla administrators (option "Special").

In the "Open in" field, choose whether the page will be opened in the same window, or in a new window, or in a new browser tab.

Setting up a blog on Joomla

Go to right side settings, where tabs with parameters responsible for the presentation of the web page, which will be opened as a result of clicking on this link, are concentrated. Let's start with the main parameters located on the tab of the same name:

In the "Category" field, you must select the one whose content will be displayed in the form of a blog. In the "Description" column, you can hide or show the display of the description for this category, which will be displayed at the top of the blog page. The same goes for the "Description picture".

In the "Full width" field, you can specify the number of articles (most often only their introductory parts - announcements), which will be displayed in the full width of the web page, without splitting into columns. In the “Introduction” column, you specify the number of materials that will be divided into columns, and in the “Columns” field, specify their number. They will be displayed behind those articles that are displayed in full width.

Thus, you can, for example, put in these four fields the numbers: 1 6 2 4, as a result of which the generated blog page will look like this: at the very top one article announcement will be displayed, followed by six more announcements from of this category, well, at the very bottom there will be a list of four more links.

Clear? No? Then try experimenting with the numbers in these settings yourself and everything will become clear and understandable to you. Implement in Joomla the output of articles in a blog category or section, first in columns, and then on the full width of the page - on this moment impossible. Therefore, you have to be content with what you have.

By the way, the number zero in any of these four fields, except for "column", will mean that none of the materials in this category will use this display option. This is what we examined the main parameters that can be changed when creating a menu item in Joomla. Now let's go to the advanced tab:

Here are the settings that are responsible for the order of the articles. There are a lot of options - by date, alphabetically, in the display order that you specified in the content manager (of this category).

You will need the Order field if you are creating a menu item for a section that contains more than one category. In this case, you can choose the way you want to sort the categories in the section, according to which their list will be displayed on the page, formed on the basis of the section blog template.

The "Sorting" field determines how the articles themselves are displayed when they are displayed. By the way, when creating a menu item codenamed "Section Blog Template", you can sort all articles without regard to their belonging to a particular category, but for this you need to select the "Default" option in the previous "Order" field.

If you choose the "Display order" option, then articles from the selected Joomla category will be displayed on the page in the order that you specify in the material manager, by filtering only by it.

There are two ways to sort articles in the content manager that belong to the category we need. You can arrange the desired numbers in the "Sort" column and click on the floppy disk located next to the name of this column. And you can also use the green arrows in the same column, but with a large number articles it will be, perhaps, inconvenient.

In the Pagination column and the next few columns of the advanced settings of the menu item based on the category or section blog template, you can hide and show the pagination. For example, if there are more materials in the displayed category than you specified in the settings described above, then Joomla will add numbering (pagination) at the bottom of the generated web page with a blog, unless you disable it in the “Pagination” field.

Do not forget that articles intended to be displayed as part of a blog in Joomla must be prepared accordingly, namely, you will need to open it in visual editor for editing, put the mouse cursor after several paragraphs of text and click on the button " More details"Located at the bottom of the editor window.

As a result, at the position of the cursor, a line will appear that separates the text of the announcement. Only the announcement above this line will be displayed on the blog.

Display of individual material, list of categories or articles

Let's now go over the settings that you can set when creating or editing a menu item based on a standard section template. To get started, go to the admin panel, select from the top line "All menus" - "The name of the one you need." In the window that opens, click the "Create" button located at the top.

In the opened tree of items that you can create, click on the option "Materials" - "Category" - "Standard section template". As a result of these actions, a window with settings will open.

Remarkably, its left side will look exactly the same as in the one we reviewed earlier. The main difference lies in the points of the main parameters:

In the "Section" field, you will have to select a section, the list of categories of which will be displayed when you click on this link in the menu. By the way, the visitor, when viewing the list of categories, will be able to view the list of materials in each of them, simply by clicking on its name with the mouse. The purpose of the "Description" and "Picture" fields is similar to that described above.

The purpose of the rest of the fields will be easier for you to see in action than to read about it. All other settings are no different from those discussed above.

Let's try to create a menu item in Joomla based on a category list template and see how the settings differ:

In the settings below, you can set the number of articles displayed in the list, as well as enable or disable the display of list column headings, creation date (you can set your own format for it) and a filter that will allow you to sort materials by titles, authors, or by hits (number views of the material by visitors).

Well, and finally, I will say a few words about creating a menu item in Joomla based on a standard material template. Everything is quite simple here, in the main parameters there is only the ability to select the article you need from the material manager, which will open when you click on the menu item link.

It is possible that this bourgeois vision of successful blog promotion will come in handy (the author of the most popular blog on SEO in the bourgeoisie):

Good luck to you! See you soon on the pages of the blog site

You may be interested

Creation and display of articles (content) in Joomla using sections and categories, a blog on Joomla and the More button
Contacts for the site and the form feedback using the built-in Joomla component
What is Joomla
Modules for displaying a list of sections in Joomla, random and latest news, similar materials, arbitrary photos and Html code
Menu in Joomla - adding a nested or drop-down menu, as well as creating and configuring a module to display it on the site
Modules in Joomla - viewing position, setting and displaying, as well as assigning class suffixes
Organizing content in Joomla - deleting and creating articles in the admin area, as well as setting parameters for all materials
Component K2 for creating blogs, catalogs and portals on Joomla - features, installation and russification
Joomla admin panel - a complete manual on all the settings of the Joomla admin panel in details and pictures

We have touched wordpress theme, here we will consider joomla, namely how to create and redefine output templates. No, no, not a general site template (although we will work with it), but something else that many developers, unfortunately, simply neglect. But first things first.

Let's first take a look at how templating works in joomla. I will explain in general terms, but so that it becomes clear to you what patterns I am talking about. We all know that the site has a template that we can change to whatever we want. So this template may contain sub-templates, namely, extension templates. Imagine you want to change the style of the output, for example, of a module, take the module for displaying the latest materials. The module can be both native built-in and third-party, in principle it does not matter, the essence is the same. Imagine we need to swap the title of the article and the picture of the announcement, i.e. was - first comes the title of the article, then the picture under it, then the date, then the text, etc. And for us the designer drew it like this - the picture is above, and the title is below. How are we going to change? This is where the most interesting thing ... Many developers do not think about the fact that joomla is a rapidly developing system, which is characterized by frequent updates. But many developers find these very lines in the module files and change them as they need. Isn't that so? Why, it is possible, only after updating the module or engine, if it is a native module - your changes were crying and all your work will go nowhere. That is, the changed files will simply be overwritten during the update. So, the developers foresaw this and came up with a templating system, and in my opinion this is a very correct and convenient approach.

Article structure

So how does template redefinition work? Joomla, like most modern engines, works according to the MVC model - model, view, controller. I will not go deeper now, but I will say that this model provides for the separation of logic from the template. So, just this template is taken out to the main joomla template... Joomla is designed in such a way that if extension templates are not found in the main site template in the "html" folder, it will output them from the core. To make it clear I will give one example.

Let's take a standard component com_content Is a joomla article component. Let's try to redefine the appearance of featured articles. Let's display them, for example, on home page... To do this, we need to move the output template of the selected articles of the component to the main joomla template. To do this, create an html folder at the root of the main site template, then a “com_content” folder in it, then a “featured” folder (selected materials) in it, i.e. the path will be something like this - / templates / your template / html / com_content / featured. Now go to the following path - / components / com_content / views / featured / tmpl / and copy the files default.php, default_links.php and default_item.php into the created "featured" folder of your template. Now edit these files as we need. You can immediately see the changes on the site. Now, when you update joomla, your changes will remain intact.

In this way, you can override the output template of almost any component or module, both built-in and third-party. Plugins do not have templates. On the one hand, overriding templates may seem like a chore - to create folders in a certain sequence, if we do something wrong, the templates will not work. V latest versions joomla, starting from joomla 3.2 it became possible to create overrides automatically directly from the site admin panel. To do this, go to Extensions -> Template Manager -> in the list of templates opposite the template used in the "Template" column, click on the template name and get into the template editor.

Now it is enough to click on the extension of interest and overrides will be automatically created in the folder of the selected template. In my opinion, this greatly simplifies life, tk. no need to steam what folders to create, what to put in, etc.

Also, in addition to the component and module templates, we can override the layout view. What are layouts? For example, we need to change the page navigation template. To do this, it is enough to create a "Pagination" layout template in the admin area and change it as needed. Layouts are a new addition to joomla 3.

Alternative layout

Now we understand that before changing the appearance of the output of a certain extension, it is necessary to create its template. But imagine that one and the same module needs to set several skins, i.e. in one section of the site, the design is one, in the other section, the design is different. How to be here? I will say that the developers have foreseen this and created a special option called "Alternative layout". You can see this option in the settings of the module or component. For example, in the module settings it looks like this.

For example, let's redefine the authorization form module template on the site and create two templates. To make it clear how they differ from each other, let's make the login button in one template orange, by default the login button in the template "Protostar" blue. To do this, first go to the template manager and create an override for the module "Mod_login"- Extensions -> Template Manager -> in the "Template" column, select our template, I have this template "Protostar"-> tab "Create Override" and in the column "Modules" click on the link "Mod_login".

Next, we receive a message that the override has been created and the next that we will do this we will go to the template folder "Protostar" (if the site is hosted, then it is better to use an ftp client, for example, total commander) and see that a folder has appeared at the root of the template "Html", open this folder, then the folder "Mod_login" and we see two template files: default.php and default_logout.php... We can change these files the way we want it and the result can be immediately observed on the site after refreshing the page. But these changes will be applied immediately to all created modules. "Mod_login", but we need to create two different designs.

In order to understand the essence of the alternative layout, go to the module settings Login Form-> tab " Extra options"And make sure that in the drop-down list "Alternative layout" there is only a default template and that's it.

Now let's create copies of the override templates in the folder mod_login site template (select the file, press ctrl + c, then ctrl + v), we will have files with the "- copy" prefix. Let's rename both files, replacing the "- copy" prefix with, for example, "-Alternative"(file names must be strictly Latin characters and not contain underscores), i.e. we should have two additional files: default-alternative.php and default-alternative_logout.php... Now we are looking for the button code in the file default-alternative.php with class "Btn btn-primary" and change "Btn-primary" on "Btn-warning"(class of alert button in), i.e. like this - class = "btn btn-warning".

Now go to the module settings mod_login and we see that an additional template "default-alternative" has appeared in the "Alternative layout" list.

That's it, now we can clone our module and select the "default-alternative" template in the "Alternative layout" option. Now this template will be displayed on the site with an orange login button.

Alternative layout of categories and articles

As well as modules, articles and categories can also be assigned their own alternative output layout. We can override the display of any article or category. When creating a site, you often have to resort to such methods, especially if it is a large site and there is a lot of all kinds of information on it.

We can assign an alternative layout to a separate category and a separate article.


It should be noted right away that the alternative layout of the category will work only if the category is not tied to a menu item with the type "Category Blog" or "List of Category Materials". To display an alternative layout of the category that is attached to the menu item, we will use another method, but more on that below ...

Alternative layout for a separate article

Let's create an alternate layout for a separate story. For example, in a separate article, I set the pageTitle class to the H2 title, so this article became unique in relation to others. How can this be achieved? We simply create an alternate page layout and assign it to the desired article. To do this, first create an override for the article: Extensions -> Template manager -> column "Template", select your template -> Create override -> in the column "Components" find "com_content", expand the list and click on the link "article".

Now go to the directory - / templates / your template / html / com_content / article / and create a copy of the default.php file. Next, rename this file, for example, like this - default-alt.php. We make the necessary edits to the template (I set the pageTitle class to the page title, if you remember). Now let's assign this template to the desired article - Materials -> Materials manager -> select the desired material -> Display options for the material -> go down and in the "Alternative layout" field select our layout - default-alt.

Now, if we reload the page, we can see our changes.

Let's now give our alternative "default-alt" layout an appropriate name. For example, let's call it My Alternate Layout. To do this, we must add a constant with translation - TPL_ NAME OF YOUR TEMPLATE _COM_CONTENT_ARTICLE_LAYOUT_ NAME OF ALTERNATIVE LAYOUT FILE = "My alternative layout" - to the template localization file - ru-RU.tpl_ template name .sys.ini.

I use standard template"Protostar" and the name of the alternative layout file I have is default-alt.php. In my case, for translation, I added the TPL_PROTOSTAR_COM_CONTENT_ARTICLE_LAYOUT_DEFAULT-ALT = "My alternative layout" constant to the ru-RU.tpl_protostar.sys.ini file (/ language / en-RU /). Now when I select an alternate layout, my name is displayed.

There is an easier method to localize the alternate layout by overriding the joomla language constants. I wrote about this in, you can also read. The translation is created from the admin area and you do not need to get into the files. To do this, go - Extensions -> Language Manager -> Override Constants. Next, in the "Filter" field, switch to the control panel area with the desired language (I have Russian, in a multilingual site I will have to create it for each language).

Now click on the "Create" button and enter our constant in the "Language constant" field, for me it is TPL_PROTOSTAR_COM_CONTENT_ARTICLE_LAYOUT_DEFAULT-ALT. In the "Text" field, enter its translation - My alternative layout. We press to save. That's it, the layout will also be translated.

I would like to add that our alternative layout can be defined globally, i.e. will be applied to all materials by default. To do this, go to the material settings - Material manager -> click on the "Settings" button in the right upper corner-> in the first tab "Materials" at the very top we see the "Select layout" field.

Alternative category layout

In much the same way as for the article, an alternative layout of the category is created. Create an override of the category articles list template (when creating an override, click on the "category" link). Next, go to our template and open the created override folder - category. In this folder we find the files: blog.php, blog_item.php and blog_children.php and create copies of them (select, CTRL + C -> CTRL + V). Let's rename the copies of these files, I named them like this: myblog.php, myblog_item.php and myblog_children.php... You can replace the prefix " myblog_»With your own name, but the sequence of actions must be exactly that, otherwise errors may occur. Now, in the site admin panel, open the category to which we want to assign an alternative layout and in the "Parameters" tab we find the "Alternative layout" field. Expanding the list, we will see the layout we have created (by default, there are already two layouts: Blog and List).

Let me remind you again! This alternate layout will only be applied if the category is not associated with a menu item of type blog category or category list.

You can also give an adequate name to the layout by creating a language constant - TPL_ TEMPLATE NAME _COM_CONTENT_CATEGORY_LAYOUT_ LAYOUT FILE NAME (copy of the blog.php file). In my case, it will be - TPL_PROTOSTAR_COM_CONTENT_CATEGORY_LAYOUT_MYBLOG, in the translation field I gave my name - My blog.

So we redefined the category blog output template, but if you noticed in the category folder there are also overrides files: default.php, default_item.php and default_children.php - these are the category list template files. So, if you want to create an alternative layout of the category list, then you need to create copies of these files. The rest is all the same.

It would seem that everything, but there is one more thing about which I also want to tell. Just imagine we have a list of category materials, they are displayed in blog format. Let's now change the title of the material in the category list. By default, it is H2, and we will convert it to H3. The edits are made in the blog_item.php file, but I will be making changes to the alternate layout, in the myblog_item.php file. So if we open this file, it turns out that some blocks are moved to separate files including our article title. Remember the third column "Layouts" when creating an override in a template. So, now we are just going to turn to this column. We need to create layout overrides for the standard joomla article component. To do this, we go to the overrides and in the "Layouts" column click on the "content" link. Now go to the folder of our template, then the folder "html" and see that there is another folder there - "layouts". Fine! Now let's go to this folder -> joomla -> content and here we need to find the file that contains the title of our article. To do this, go back to our myblog_item.php file (in my case) and look for the lines where the title is displayed. I have this line 23. It looks like this:

item); ?>

Based on this code, we see that we have a file with the name - blog_style_default_item_title, so we will look for it in the layouts folder. I have this file - blog_style_default_item_title.php... You can open it right away and edit it, but I suggest creating an alternate layout for this header template as well. To do this, create a copy of this file and rename it, for example, I named it so -. Now go to the file myblog_item.php and change the line

item); ?>

item); ?>

Now, the template file myblog_style_default_item_title.php can be changed as you like and the changes will be applied exactly in the category to which the alternative category layout is assigned. That's how it works. Other templates in the Layouts column are redefined in the same way.

This alternative layout can also be defined globally, i.e. will be assigned to all categories by default. Go to the settings of the standard joomla article component and select the desired layout in the Category tab.

Alternative menu item layout

Now let's look at another option for creating an alternate layout with a binding to a menu item. Go to the directory - / templates / your template / html / com_content / categoty and create a copy of the blog.xml file and then rename it to (in my case) myblog.xml. Now let's open this file. At the beginning of the file, we will see a structure that looks like this:

It is this structure that defines the menu item for our layout. Let's change the following constants to our own, replacing the selection in accordance with the created alternative template and create overrides for them in the language files:

COM_CONTENT_CATEGORY_VIEW_ BLOG _TITLE
COM_CONTENT_CATEGORY_VIEW_ BLOG _OPTION
JHELP_MENUS_MENU_ITEM_ARTICLE_CATEGORY_ BLOG
COM_CONTENT_CATEGORY_VIEW_ BLOG _DESC

I named them as follows:

COM_CONTENT_CATEGORY_VIEW_MYBLOG_TITLE
COM_CONTENT_CATEGORY_VIEW_MYBLOG_OPTION
JHELP_MENUS_MENU_ITEM_ARTICLE_CATEGORY_MYBLOG
COM_CONTENT_CATEGORY_VIEW_MYBLOG_DESC

Go to the language manager and create constant overrides for the control panel area with the language you need. It was enough for me to create overrides for two constants: COM_CONTENT_CATEGORY_VIEW_MYBLOG_TITLE and COM_CONTENT_CATEGORY_VIEW_MYBLOG_DESC.

Create a new menu item, select the "Materials" type and see that a new type of our created alternative layout has appeared there. I named it "Alternative Category Blog Layout".

Now the output of articles in this menu item will be displayed in accordance with the created layout.

I want to warn you that if you create an alternative layout for a menu item, then you will not be able to select this alternative layout globally or from a category, because it will no longer be available.

Module style

Let's go back to our modules and see what else we can do there to make our life easier. Until now, we have analyzed the internal layouts of each extension, said that they can be redefined, but the modules also have an external shell, which was not available to us with the above methods. What kind of shell is this? This is, for example, a block with a moduletable class that wraps each module with a standard xhtml output style. You can also include the module header here, which is displayed in the H3 tag by default. Now imagine the situation - you need one of the modules, or rather its heading, to change the H3 tag to a regular div-block with a certain class, say, the moduleTitle class, + also add a span tag inside this block, i.e. frame the heading with an additional span tag. This concerned a separate module. But what if you need to display all modules in a certain modular position in this way?

Let's figure it out. We can create a unique wrapper and assign it to any module. To do this, create a modules.php file in your template folder, namely the full path looks like this - / templates / your template / html / modules.php. Open this file and paste the following code into it:

content)):?>

">showtitle):?>

title; ?>

content; ?>

But do not rush to save it, we still need to edit it, or, to be more precise, create a unique style of the module, otherwise an error will pop up on the site in the form of a white screen (when the display of errors is disabled), because this style already exists. We are interested in the function "ModChrome_xhtm" let's give it a unique name, I called it like this - "ModChrome_myStyle"... That's it, now the contents of the function can be edited the way we need it. As a result, if I implement my plan, I modernized the code as follows:

content)):?>

">showtitle):?>
title; ?>
content; ?>

Now you can save this file. The next thing we will do is go to the module manager and open the required module for editing. Go to the "Additional parameters" tab, go down and in the last filter "Module Style" we see that we have an additional style - mine is myStyle.

We choose this style and see the result. If we inspect, we see that instead of the usual H3 heading, we now have a div-block with the moduleTitle class, which also contains an inner span tag.

This feature of assigning a unique style to each module appeared in joomla 3. In joomla 2.5, I did not see such an opportunity. So what if you haven't already.

Now let's look at how to render all modules in a given style at a specific modular position. The modular position in the template is inserted as follows:

name = "header" - instead of header enter your name for the modular position.

If you noticed in this position, the standard style is displayed - xhtml. Let's replace it with our created one - myStyle, i.e. like this:

That's it, now all modules in this modular position will be displayed in our style. Respect to the developers for giving such an opportunity to customize the template so flexibly!

Additional features

If you noticed in the same tab of the module "Additional parameters", in addition to the fields "Alternative layout" and "Style of the module", there are also such fields as "CSS class suffix of the module", "Caching", "HTML tag of the module", " Bootstrap Size ”,“ HTML Header Tag ”,“ CSS Header Class ”. Well, the "Caching" field has nothing to do with templating, so let's omit it for now. Let's consider the rest of the fields.

Module CSS class suffix- adds a suffix to the block with the moduletable class. An additional class can be specified, either separated by a space or a hyphen, or even written in one piece. This way we can uniqueize the class of the module block and write whatever styles we want for it.

HTML module tag- works if we choose the module style html5... This style is created by default. The option allows you to replace the standard div block with one of the selected ones - section, nav, article, etc.

Bootstrap size- works with the selected module style html5... This option is relevant only if you use

In this article, I would like to touch on an already very often used type of menu - category blog template... In fact, this item allows you to display the content of the category on the page. The only nuance is the word " blog". In fact, this is just a type of output. For example, on my home page (and in sections), a practically similar option is implemented. However, it is better to see once than hear a hundred times, so it is better to add a category blog template to the menu and to see the result And here's how to add this type of menu, we will analyze in this article.

When creating a new menu item, you need to select the type - " Category Blog Template":

But as for " Parameters-Basic" and " Options-Advanced"they need to be considered here as they differ from other types of menus.

Let's start with the group " Parameters-Basic":

  • Category... In this drop-down list, select the category that you want to display.
  • Description... If you wrote a description when creating a category, then here you can either show or hide it.
  • Description picture... If you specified a picture for a category, then you can display it here.
  • Full width... This parameter specifies how many materials will be displayed on the full width of the content. It is better to look at the result here, and you will immediately understand what this option does.
  • Introduction... The number of articles that the user will see with a short description.
  • Loudspeakers... Number of blog columns.
  • Links... The number of simple links to articles that appear immediately after the output of all materials in full width and introductory.

In general, it is better not to describe these parameters, but to look at it right away, and then you will immediately understand. The only thing is, you need to create at least a few articles to really see the difference.

And now consider " Options-Advanced":

  • Category order... It is sorting items into categories. " Alphabetical title"is an alphabetical sort," Heading versus alphabet"conversely, sorting against the alphabet. A" Display order"means the items will be sorted according to the order you specified.
  • Sorting... Here you need to select the sorting option that you want to get from the drop-down list. Just in case, hits- This is the number of views of the article, because this word is often found in various versions of the localization, and not everyone knows it.
  • Order for multi-speakers... Sorting category materials by pegs. This only applies to blog types where 2 and more column.
  • Breaking the page... Show or hide pagination.
  • Paging results... If the previous option is enabled, then here you can display the split result. For example, " 1-2 of 2".
  • Show feed link... You can include Rss feed for this category, then people can subscribe to it and receive notifications about updates.

From my own experience, I will say that all these settings often do not need to be changed, so if something remains unclear, then just look at them in practice. Although, most likely, this will not be required either.

Here you can download unique Blogger templates... The topics in this collection are more advanced SEO optimization.

Languages: English Russian.

Types: News, Magazine, Blog, Minimalism, Portfolio, One-page, Gallery, Grid "grid", Internet shop, Business cards, Corporate sites.

Themes: Sports, Photos, Games, Cooking, Style and Fashion, Womens, Kids, Cars, Health, Travel, Tourism, Design, Home Renovation, Interior, Nature, Animals, Dancing, Video, Music, Politics, Economy, Business, Forex, Art, Pictures, Wallpaper, Earnings, Real Estate, Fishing, Hunting, Software, Software, Android Game Applications.

Technologies: Jquery, AMP, Bootstrap, Ajax, Javascript, Responsive Design.

Best blogger templates, users' choice

UberSpot is an excellent solution for those who value beautiful design, SEO optimization and effective functionality. In this thread you will find a number of cool and productive innovations, such as the new Instagram widget, Sitemap, Posts, Comments, etc. You can also use two different types of layouts.

Unstoppable Niche Conqueror. This is the perfect solution for single thematic sites and blogging. The idea when creating the theme was to implement endless navigation, which can be tracked by search engines. Thus, the new navigation system, unlike the previous ones, will not only increase the behavioral factor, but also fully display it, which will entail an increase in the site's position in search.

Designed on the basis of the new Blogger Themes from the (CNES) series. Able to solve many tasks. You can use it with all widgets, or partially as a personal information blog. The page loading speed will pleasantly surprise you.

BlogBoard is one of the best griders of 2018. Combines several styles at once. Can be used as an online blog store. It will do a great job of presenting your skills and services so it will work well for a portfolio as well.

Dionis has a simplified messaging style. Suitable for all niches and stories. Of the chips, a beautiful preloader can be distinguished (an animation picture before loading the main page), recommended messages pop up on the right side when scrolling the page.

It is a fast and flexible model that has absorbed several social media add-ons. An excellent option for those who value their time. Translated into Russian.


Mistik comes in four different styles. You can choose the one that you like the most. Easy customization of the menu, colors and other elements, allow you to create your own unique design.


NewsB is a lightweight news theme with a combination of colors, simple yet stylish widgets designed for a variety of topics and content categories. NewsB is fully responsive and seamlessly supported by all modern browsers. The full version includes the latest blogging SEO settings to date, which will allow your site to raise its search engine rankings even higher.

Minima Mag is a modern news template with a responsive design, fast message loading, stylish gadgets and of course a clean design that seamlessly blends three colors to make Minima Mag neat and elegant.

A stunning classic styled theme designed for womens websites and blogs. Avicia is a professional theme with an elegant and modern design that is able to inspire and convey only positive emotions to readers.

Dream Press, ranks among the top blogger themes. In it you will see a modern, elegant, stylish and simple design. In general, all these qualities will help keep the reader on the site.

The only thing you need to know about ExGPress is that it has the most user-friendly functionality to match a social network, which will provide your site with a large return rate. To all this you can add SEO optimization, high loading speed and a large supply of space for gadgets and ads. ExGPress has been designed specifically to provide a comfortable browsing experience and the best engagement with search engines, which makes it one of the best blogger templates available today. The other day we added a new function to it, floating sidebars, when scrolling down or up the page, the sidebars with widgets move after scrolling.

Grid Line is a modern and stylish blogspot template. All of its elements are carefully selected, optimized and built in such a way as to maximize the focus of the reader's attention on the content. Grid Line was created not only to successfully promote your web resource in search engines, but also to cheer up its users and readers.