- Posts: 16
COMMUNITY FORUM
[SOLVED] tag.php display tags and attachments
- Kiwee
-
Topic Author
- Offline
- New Member
Less
More
9 years 1 month ago - 9 years 3 weeks ago #153341
by Kiwee
[SOLVED] tag.php display tags and attachments was created by Kiwee
Hi,
I use the tag.php, to display all the items using a specific tag. I overrided the tag.php using a file templates/xxx/html/com_k2/default/tag.php, it works fine.
I just need to display, for each item, the others tags and the attachments. How can I do that ?
I use the tag.php, to display all the items using a specific tag. I overrided the tag.php using a file templates/xxx/html/com_k2/default/tag.php, it works fine.
I just need to display, for each item, the others tags and the attachments. How can I do that ?
Last edit: 9 years 3 weeks ago by Kiwee. Reason: solved
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
9 years 1 month ago #153388
by Krikor Boghossian
Replied by Krikor Boghossian on topic tag.php display tags and attachments
Hello,
These values are not available by default in the object.
You would have to hack the model in order to add these values.
From that point, you can use the $item->tags and $item->attachments variables in your override.
These values are not available by default in the object.
You would have to hack the model in order to add these values.
From that point, you can use the $item->tags and $item->attachments variables in your override.
Please Log in or Create an account to join the conversation.
- Kiwee
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 16
9 years 4 weeks ago - 9 years 4 weeks ago #153430
by Kiwee
Replied by Kiwee on topic tag.php display tags and attachments
Any idea or tips or begining of something for the hack ?
Last edit: 9 years 4 weeks ago by Kiwee.
Please Log in or Create an account to join the conversation.
- Kiwee
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 16
9 years 3 weeks ago #153495
by Kiwee
Replied by Kiwee on topic tag.php display tags and attachments
I found the answer in another topic : www.joomlaworks.net/forum/k2-en/45159-solved-$item-tags-empty-in-tag-php
I know it is not recommended to edit the k2 core, but no choice, I need to display attachments and tags in the tag.php
What I did, if someone has the same problem :
/!\ BE CAREFUL /!\
always keep a backup of your edit in case of a update
always be careful when editing core files
/!\
in the /components/com_k2/models/item.php file, edit
Tags : line 107 :to
Attachments : line 187 :to
I know it is not recommended to edit the k2 core, but no choice, I need to display attachments and tags in the tag.php
What I did, if someone has the same problem :
/!\ BE CAREFUL /!\
always keep a backup of your edit in case of a update
always be careful when editing core files
/!\
in the /components/com_k2/models/item.php file, edit
Tags : line 107 :
if (($view == 'item' && ($item->params->get('itemTags') || $item->params->get('itemRelated'))) || ($view == 'itemlist' && ($task == '' || $task == 'category') && $item->params->get('catItemTags')) || ($view == 'itemlist' && $task == 'user' && $item->params->get('userItemTags')) || ($view == 'latest' && $params->get('latestItemTags')))
if (($view == 'item' && ($item->params->get('itemTags') || $item->params->get('itemRelated'))) || ($view == 'itemlist' && ($task == '' || $task == 'category' || $task == 'tag') && $item->params->get('catItemTags')) || ($view == 'itemlist' && $task == 'user' && $item->params->get('userItemTags')) || ($view == 'latest' && $params->get('latestItemTags')))
Attachments : line 187 :
if (($view == 'item' && $item->params->get('itemAttachments')) || ($view == 'itemlist' && ($task == '' || $task == 'category') && $item->params->get('catItemAttachments')))
if (($view == 'item' && $item->params->get('itemAttachments')) || ($view == 'itemlist' && ($task == '' || $task == 'category' || $task == 'tag') && $item->params->get('catItemAttachments')))
Please Log in or Create an account to join the conversation.
- Joe Campbell
-
- Offline
- Platinum Member
Less
More
- Posts: 438
8 years 8 months ago #157070
by Joe Campbell
Replied by Joe Campbell on topic [SOLVED] tag.php display tags and attachments
Has this limitation been resolved with the latest version of K2?
If not, can this be executed with a plugin or does it require a hack?
If not, can this be executed with a plugin or does it require a hack?
Please Log in or Create an account to join the conversation.