- Posts: 18
COMMUNITY FORUM
Menu Item to multiple category shows full article
- ataman79
-
Topic Author
- Offline
- New Member
Less
More
9 years 10 months ago #144997
by ataman79
Menu Item to multiple category shows full article was created by ataman79
Hi,
I have the next problem. When I link a menu item to two categories, all items are shown with full text, but not with intro text only?!?! If i link only one category all is ok, but more than one shows full articles
I set for both categories to use intro text
How can I solve this (except adding Read more line in each article) ?
Thank you in advance
I have the next problem. When I link a menu item to two categories, all items are shown with full text, but not with intro text only?!?! If i link only one category all is ok, but more than one shows full articles
I set for both categories to use intro text
How can I solve this (except adding Read more line in each article) ?
Thank you in advance
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
9 years 10 months ago #145008
by Krikor Boghossian
Replied by Krikor Boghossian on topic Menu Item to multiple category shows full article
You can hardcode a limit in your overrides.
Although the most optimal solution would be to use the read more button.
More on overrides can be found here: getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates
<?php echo K2HelperUtilities::wordLimit($this->item->introtext, 15); ?>
Although the most optimal solution would be to use the read more button.
More on overrides can be found here: getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates
Please Log in or Create an account to join the conversation.
- ataman79
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 18
9 years 10 months ago #145010
by ataman79
Replied by ataman79 on topic Menu Item to multiple category shows full article
Thanks Krikor,
where should I hardcore it, in category.php of my template ?
where should I hardcore it, in category.php of my template ?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
9 years 10 months ago #145014
by Krikor Boghossian
Replied by Krikor Boghossian on topic Menu Item to multiple category shows full article
It's the category-item.php file.
Please Log in or Create an account to join the conversation.
- ataman79
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 18
9 years 10 months ago #145042
by ataman79
Replied by ataman79 on topic Menu Item to multiple category shows full article
Thank you
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
9 years 10 months ago #145062
by Krikor Boghossian
Replied by Krikor Boghossian on topic Menu Item to multiple category shows full article
You 're welcome.
Please Log in or Create an account to join the conversation.
- Villy Koutsogianni
-
- Offline
- New Member
Less
More
- Posts: 19
9 years 1 month ago - 9 years 1 month ago #152409
by Villy Koutsogianni
Replied by Villy Koutsogianni on topic Menu Item to multiple category shows full article
Hi
I face the same problem when I see authors`s list of articles, as I dont use Read more in items I only use intro text limit form category configuration.
I am not familiar with php so can you please advise me in witch line of category-item.php file should I add the line of code you have suggested?
I have check post #146062 that gives the line in witch I should add the code, but my file does not contain <div class="catItemIntroText">
Please note that I have noticed a difference between com_k2 files and those in template/html. I have replaced them and the layout of my template became a mess, so I used those of the template again.
I hope you can help me with this
best regards
I face the same problem when I see authors`s list of articles, as I dont use Read more in items I only use intro text limit form category configuration.
I am not familiar with php so can you please advise me in witch line of category-item.php file should I add the line of code you have suggested?
I have check post #146062 that gives the line in witch I should add the code, but my file does not contain <div class="catItemIntroText">
Please note that I have noticed a difference between com_k2 files and those in template/html. I have replaced them and the layout of my template became a mess, so I used those of the template again.
I hope you can help me with this
best regards
Last edit: 9 years 1 month ago by Villy Koutsogianni. Reason: added information
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 #152426
by Krikor Boghossian
Replied by Krikor Boghossian on topic Menu Item to multiple category shows full article
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates
This post will help you understand K2's files and overrides.
The file you need to edit is user.php and the code for that file is:
This post will help you understand K2's files and overrides.
The file you need to edit is user.php and the code for that file is:
<?php if($this->params->get('userItemIntroText')): ?>
<!-- Item introtext -->
<div class="userItemIntroText">
<?php echo K2HelperUtilities::wordLimit($item->introtext, 15); ?>
</div>
<?php endif; ?>
Please Log in or Create an account to join the conversation.
- Villy Koutsogianni
-
- Offline
- New Member
Less
More
- Posts: 19
9 years 1 month ago #152451
by Villy Koutsogianni
Replied by Villy Koutsogianni on topic Menu Item to multiple category shows full article
Thanks Krikor
That did the job!!!
That did the job!!!
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 #152469
by Krikor Boghossian
Replied by Krikor Boghossian on topic Menu Item to multiple category shows full article
You 're welcome Villy :)
Please Log in or Create an account to join the conversation.