Keyword

How to change the layout by adding a new template

  • Oceanwatcher
  • Oceanwatcher's Avatar Topic Author
  • Offline
  • Elite Member
More
10 years 2 months ago #68356 by Oceanwatcher
Oceanwatcher created the topic: How to change the layout by adding a new template
I do not say that this is the correct way, or that it is the only way. But it works. You can see what I have done so far at:

www.datahverdag.com/joomla/ (it is a developing site - a lot left to be done)

Here is what I did.

First I placed all categories for articles under one main category and in each of the sub-categories, I set them to inherit the parameters from the main category. I then set all the parameters in this category the way I wanted them.

I then created a new menuitem in Joomla and chose K2 - itemlist/category as type.

In the parameters for the menuitem, I set up the number of articles and columns for each section of the front page. After saving this, I set the new menuoption as the default one, in other words, this becomes the new frontpage.

The next step was to make the new template. I have seen a couple of messages about this, and this is what I ended up doing:

In /components/com_k2/templates I duplicated the default folder with all it's content and renamed it (you can use whatever you want).

To get k2 to use the new template, you have to go to the main category and change the template from default to the new one you made. And you also have to do this in the parameters for the menuitem you created.

To change the picture sizes on the front page, you have to change it in the main category. But the number of columns is set in the menu item parameters.

You can now go on to change the template as much as you want. I reordered some of the things and also changed the style.css file to fix it further.

category.php is the main layout for the frontpage. It calls category_item.php for the display of each story on the front page.

item.php is the file that display the full articles.

There are still some things I struggle with, but it is getting closer :-) I got a lot of good help from Peter here in this forum to figure out what was going on. As I am not a programmer or a template developer, it is hard to know what each part do. But I am learning :-)

Please Log in or Create an account to join the conversation.

Moderators: william white

Powered by Kunena Forum