Need to add custom code to k2 item.php

October 2015 Joomla Template
Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Sun Oct 09, 2016 4:58 pm
Reply with quote
Report this post
Hi I need to add some custom code to K2 item.php in order to include scheme.org and open graphics tags.

I was editing the file located on:
html/com_k2/templates/default

But once I saved my changes I did not saw them on the site? I'm editing the wrong file?

Thanks,

Ivan Varela
User avatar
Junior Boarder

teitbite
Mon Oct 10, 2016 2:03 pm
Reply with quote
Report this post
Hi

If You are working in K2 item layout, than it's a correct file. Check if You have no cache working on site of server. This I believe is a problem in such case.
User avatar
Moderator

GK User
Tue Nov 22, 2016 3:54 am
Reply with quote
Report this post
Hi everyone,

I know this is an old post, but I'm still having this problem. I need to made some changes on the layout and order of the information inside the item.php.

I want to insert a Facebook Comments component in the bottom of each Item, and some other things.

I'm trying to modify the file /templates/gk_news/html/com_k2/templates/default/item.php but when I made some changes on it, they are not rendered on the frontend.

I clear cache on Joomla and try again... nothing.

Also I went to modify the html/com_k2/templates/default/item.php and nothing happend (I undo these changes because I thing this is not the file to edit)

I'm start thinking that there is something wrong in my setup, and can not determine which file I must edit and how to disable completly cache while I'm still working on frontend design...

Can any one take a look and give me a hint....

Thanks a lot.

Ivan
User avatar
Junior Boarder

teitbite
Mon Nov 28, 2016 9:26 am
Reply with quote
Report this post
Hi

html/com_k2/templates/default/item.php is most probably the correct file. It sounds like You have some server cache active and Your php files are not refreshed after changes. Please ask Your hosting provider to disable it or instruct You how to do this.
User avatar
Moderator

GK User
Tue Nov 29, 2016 5:31 pm
Reply with quote
Report this post
I disable all the cache in the joomla admin, from any component or module that has the cache feature and nothing happends.
So I'm really frustrated because I can not do any change, I rename the item.php to item.back, hooping to the site crash to see if I was working on the right file... nothing happends.
Then I made a search on the site root to find copies of item.php, insert ramdom string before the ItemDescription to see if someting happen... and nothing....

I thing there is something wrong on my site configuration or in the way it's ussing the template. I also have install de language pack for k2 and nothing that I can get the items in Spanish.

Can I sent you a FTP/admin account to take a look??

Thanks in advance.
User avatar
Junior Boarder

teitbite
Fri Dec 02, 2016 4:39 pm
Reply with quote
Report this post
Hi

You can send me FTP access so I'll run a similar tests, but in my opinion You have a server cache or cloud which refreshes after couple of hours or only after it got cleared. Ask Your hosting provider if something like this is enabled on Your server and if yes, ask them to disable it till You finish working with code.
User avatar
Moderator

GK User
Sat Dec 03, 2016 4:15 am
Reply with quote
Report this post
I found a way to edit item.php, but I had to do it inside Joomla.
Extensions -> Template -> Gk_news Details and Files
And use the edit to make the changes on the file, after editing I save the file and the changes were show in the front end.

I would prefered to edit the files outside and upload them as usual, but it works.

Do you know if I can disable this and just overwrite files?
IV
User avatar
Junior Boarder

teitbite
Thu Dec 08, 2016 1:28 pm
Reply with quote
Report this post
Hi

It's actually interesting since joomla editor is working similar to ftp edits. So if server cache is active changes should not be visible. Are You sure You've been changing correct files? Maybe You have a copy of website and working on this copy or probably was changing not output files which are located in /templates/gk_news/html/com_k2/templates/default/item.php
User avatar
Moderator


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.