Keyword

Override for tag.php not working

  • Tracey
  • Tracey's Avatar Topic Author
  • Offline
  • Senior Member
More
10 years 7 months ago #125255 by Tracey
Override for tag.php not working was created by Tracey
Hello,

I am trying to do a template override for the tag.php file but it is not working.

I have the tag.php located here inside the custom_override folder:

templates/myTemplate/html/com_k2/custom_override

Should my tag.php be put somewhere else?

I have my item.php override in the same folder and that works good so why doesn't the tag.php work?

I am not sure why but depending on where i get the information(different websites) it seems people have a different opinion of how to structure k2 overrides in the file system.

There just seems to be alot of confusion on how to do k2 overrides for newbees like myself and it doesnt help that your override tutorial refers to joomla 1.5 .

Aside from finding an answer to the above questions is there any chance that the k2 team could publish a new guide for overrides that is relevant to joomla 3 and the latest version of k2?


If it helps I am using k2 v2.6.7, Joomla! v3.2.2 and RocketTheme Oculus template

Joomla! v3.5.1
Gantry5 - Hydrogen Template
k2 v2.7.0

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

  • Kannan Naidu Venugopal
  • Kannan Naidu Venugopal's Avatar
  • Offline
  • Platinum Member
  • Aham Brahmasmi
More
10 years 7 months ago #125256 by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Re: Override for tag.php not working
If i'm not mistaken the tag overrides works when you create a menu and choose the type as K2 tag, and in the menu options you can select the template to use.

K2 Rocks \m/

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

  • Tracey
  • Tracey's Avatar Topic Author
  • Offline
  • Senior Member
More
10 years 7 months ago #125257 by Tracey
Replied by Tracey on topic Re: Override for tag.php not working
Wow, ok.. I just answered part of my own question again!

After making my last post I looked back at some of my old post from 2 years ago and in one of my post I asked a similar question about the user.php file.

It seems I moved the user.php file from my override folder and put it directly into the com_k2 folder and it started working. So.. to make a long story short I just tried the same thing with the tag.php file and it worked. Problem is I don't understand why.

Could someone please make a tutorial that shows where each file should go that can be templated. I really think it would benefit allot of people.

Just so it's clear, from what i can tell the downloadable override zip doesn't even have the right file structure, if it did my tag.php override would have worked without moving it.

Thanks

Joomla! v3.5.1
Gantry5 - Hydrogen Template
k2 v2.7.0

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

  • Tracey
  • Tracey's Avatar Topic Author
  • Offline
  • Senior Member
More
10 years 7 months ago #125258 by Tracey
Replied by Tracey on topic Re: Override for tag.php not working
Hi Kannan,

Thanks for the reply, I must have been typing my second post when you responded.

If I did that the way you explained, would I have a clickable menu link for tags because I wouldn't want that. Please correct me if I'm wrong.

This is only my 2nd stab at using joomla and k2 so I have alot to learn lol especially since I am not a professional web designer or developer, just learning as I go.

If you would like, you can see what I am trying to do here: 184.154.228.17/~townofsa/

My website is still a work in progress but when looking at the home page you can see my custom k2 content module in the mainbody postion. I actually want to get my tag results page to have a more or less similar look. In other words when I click a tag the result page would list out the proper items similiar to what my k2 content module does.

Joomla! v3.5.1
Gantry5 - Hydrogen Template
k2 v2.7.0

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

  • Kannan Naidu Venugopal
  • Kannan Naidu Venugopal's Avatar
  • Offline
  • Platinum Member
  • Aham Brahmasmi
More
10 years 7 months ago #125259 by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Re: Override for tag.php not working
Hi Tracey,

I believe your home menu item type is the default joomla home menu, which is featured articles ?

I normally would create the Home menu item type to K2 Categories, and if i need more that one category i will select more and choose a template name - eg: home.

I will style accordingly, even if each category have their own sub-template, my home i will style it differently.

K2 Rocks \m/

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

  • Tracey
  • Tracey's Avatar Topic Author
  • Offline
  • Senior Member
More
10 years 7 months ago #125260 by Tracey
Replied by Tracey on topic Re: Override for tag.php not working
Hi Kannan,

Actually I had my home menu item set to k2 item with [module114] in the item description. Module 114 in my backend is the k2 content module set to show featured items only from all categories. At the point I am at with the site build it seemed to work as intended. LOL, well almost..

I am not really sure why I went that route^ (probably lack of k2 & Joomla knowledge) but after reading your last post I decided to try your approach. After setting things up I found I could not control intro text word limit in the way I wanted. I wanted around 29 words for the homepage featured item intros but around 100 words for all other category views. I just couldn't figure out a way to make it work.

I ended up using the k2 latest items for my home menu item type. This allowed me to have a custom template for just that home page view. Among other things I also was able to modify the latest_item.php to limit intro text to 29 words like i wanted.

I also wanted to mention I watched the video on templating you posted in another thread and for me that helped alot. I don't know why but that video didn't come up in search results for me when searching for k2 overrides and templating. Wish it had because it is very informative and would have saved me allot of head scratching!

Concerning the tag.php override I found yet another way to make a custom template for the results page. I found that I can modify the tag.php located in templates/mytemplate/html/com_k2/templates/default/.

I am guessing it has to be modified there because k2 Tools doesn't allow you to choose a custom template override?

Anyway I think I am squared away at the moment but thank you for your replies. You helped me look into things with a different perspective by trying a new approach and as a result I have learned much more about k2.

Joomla! v3.5.1
Gantry5 - Hydrogen Template
k2 v2.7.0

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

  • Kannan Naidu Venugopal
  • Kannan Naidu Venugopal's Avatar
  • Offline
  • Platinum Member
  • Aham Brahmasmi
More
10 years 7 months ago #125261 by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Re: Override for tag.php not working
Hi Tracey,

You're welcome :)

You can override K2 tools, just make a folder in your template/html/ called mod_k2_tool and inside it just add the k2 tools specific files, like archive.php or breadcrumbs.php

K2 Rocks \m/

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


Powered by Kunena Forum