Keyword

Template help - files

  • Aaron
  • Aaron's Avatar Topic Author
  • Offline
  • Premium Member
More
12 years 6 months ago #63700 by Aaron
Template help - files was created by Aaron
I am a little confused about some of the files in the template. I have gone into each file and added the filename in a comment but as I navigate around, I am at a loss of where all the files are being used...

Can anyone help me fill in the blanks?


category.php
- this is the file that is shown when you click on a category and the items are displayed
- link: maincategory/category

item.php
- this is the file that is shown when you click on an item title
- link: maincategory/item/itemname


???
category_item.php
category_item_links.php
item_comments_form.php
itemform.php
latest.php
latest_item.php
tag.php
user.php


Aaron :)

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

More
12 years 6 months ago #63701 by william white
Replied by william white on topic Re: Template help - files
a couple quickly
search category.php line 153 category_item.php is called

search item.php
line 581 loads item_comments

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

More
12 years 6 months ago #63702 by Joom_Lee
Replied by Joom_Lee on topic Re: Template help - files

Aaron wrote: (...)

category.php
- this is the file that is shown when you click on a category and the items are displayed
- link: maincategory/category

item.php
- this is the file that is shown when you click on an item title
- link: maincategory/item/itemname


???
category_item.php
category_item_links.php
item_comments_form.php
itemform.php
latest.php
latest_item.php
tag.php
user.php


here is what I remember.
category.php is called when you click on a category. Within category.php -->


category_item.php: is included taking care of items' layout in category_view


category_item_links.php: same here but for links.

item_comments_form.php
is for the comment field called in item.php

and so on as far as I remember from the last custom layout ... do not have the time to check all references but names are mostly self-explaining. If I remember correctly category is the most confusing since it calls two sub files and it takes time to understand where the <divs> come from. ;)

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

  • Aaron
  • Aaron's Avatar Topic Author
  • Offline
  • Premium Member
More
12 years 6 months ago #63703 by Aaron
Replied by Aaron on topic Re: Template help - files
Okay.. let me put this together then.. I think it is beginning to make sense!!
My problem was not taking into consideration the fact that one file might call another. I was, for some reason, expecting individual calls from K2 directly to a file which does not appear to the be case.

Seeing that I edit a file and the changes show up on different pages, let me see if we can break it down that way...
So, when I edit...
category_item.php I see changes:
- when I click on a category and the items are listed as per the category settings
- link: maincategory/category

When I edit:
item.php I see changes:
- when I click on any item

from what William and Joom_Lee state below:
There are files called from other files but what I don't understand is why, when I change those files, the changes do not show up anywhere?

for instance, if category.php is called when I click on a category, changing that file should change what the page looks like right? But, I am finding that is not what is happening. I have put comments in there that are not present when I go to each page which I think is calling the file.

I will have to work with it a little more but it seems that some of the files may change portions of other files - for instance, item_comments_form.php may change how the comments form in item.php appears.

I'll do more research though as I am still confused to the dependencies and full relationships of the files.

Thanks for the help!! :D


Aaron :)

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

More
12 years 6 months ago #63704 by Joom_Lee
Replied by Joom_Lee on topic Re: Template help - files

Aaron wrote: (...)
from what William and Joom_Lee state below:
There are files called from other files but what I don't understand is why, when I change those files, the changes do not show up anywhere?

for instance, if category.php is called when I click on a category, changing that file should change what the page looks like right? But, I am finding that is not what is happening. I have put comments in there that are not present when I go to each page which I think is calling the file.


You mean you want to show comments in a category but they are not displayed although you copied the code in category.php from item.php?

My quick guess is that the category does not have the defined variable comments while the item model passing it to the view does. As result you should have the empty divs for comments but no comment content in the category view.
Check if this is the case to confirm the hypothesis. If so (this is similar to the multicategory issue topic) you need to modify the php calling the comments.

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


Powered by Kunena Forum