Keyword

Show featured items only in menu page

  • kiemthu123
  • kiemthu123's Avatar Topic Author
  • Offline
  • New Member
More
10 years 6 months ago #126898 by kiemthu123
Show featured items only in menu page was created by kiemthu123
Hello,

Im using the newest k2 and joomla 3.2 . I have my home page showing all the k2 items. Now I want to create another menu to show only featured items. Im facing with 2 problem then:

1/ If I create a menu to show K2 categories, and then choose only 1 category (parent category), there is no option for me to choose the featured items only.

2/ If I choose many categories (child categories), and enble Only show featured items, the front-end page does show featured items but very messy. There is no introtext limitation so the featured items here display with introimage + full introtext.

Please help me to fix that problem.

Thanks

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

More
10 years 6 months ago #126899 by Lefteris
Replied by Lefteris on topic Re: Show featured items only in menu page
Hi. If you create a menu link to a single category then the settings are applied from the category settings and not the menu link. Regarding the appearance of multiple categories you can always create a new K2 template and make the menu link use it.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • kiemthu123
  • kiemthu123's Avatar Topic Author
  • Offline
  • New Member
More
10 years 6 months ago #126900 by kiemthu123
Replied by kiemthu123 on topic Re: Show featured items only in menu page
Can you make it more specific, because Im newbie and not familiar with it.

THanks

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

More
10 years 6 months ago #126901 by Lefteris
Replied by Lefteris on topic Re: Show featured items only in menu page
When you create a menu link to K2 categories and you chose only one category then all settings are inherited by the category. So to change those settings you need to go and edit the category. The settings on the menu link are used only when you select more than one category.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • kiemthu123
  • kiemthu123's Avatar Topic Author
  • Offline
  • New Member
More
10 years 6 months ago #126902 by kiemthu123
Replied by kiemthu123 on topic Re: Show featured items only in menu page
Thanks for reply and maybe there is some misunderstanding here.

As I told in the begining, I already have my home page showing the top parent (and fetching all items from children categories), so that my home page will show all the items.

And now I want to create another menu page to show only featured items only. However, I cannot choose only one category in the Basic Option, because my Home Page needs to show all the items.

Then, another choice is that choosing multiplie Categores. But choosing multiple categories and applying the option belows the menu to show featured items only, has led me to another issue is that there is no word limitation of the item showing in categories view. When I load that page, it shows all the introtext with the introimage together (full item text and images). I did limit the word limitaion in the K2 parameters but it does not seem to work.

So my question is: how can I have 1 menu showing all k2 items and 1 menu showing featured items only. (did google "k2 limit word in multicategories view" but the guidance is complecated)

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

More
10 years 6 months ago #126903 by Lefteris
Replied by Lefteris on topic Re: Show featured items only in menu page
Unfortunately you will have to make a template override to apply the word limit. Select the new K2 template in the menu link settings and then in the override of category_item.php use:
<?php echo K2HelperUtilities::wordLimit($this->item->introtext, 20); ?>

This will apply a word limit of 20 words.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • kiemthu123
  • kiemthu123's Avatar Topic Author
  • Offline
  • New Member
More
10 years 6 months ago #126904 by kiemthu123
Replied by kiemthu123 on topic Re: Show featured items only in menu page

Lefteris Kavadas wrote: Unfortunately you will have to make a template override to apply the word limit. Select the new K2 template in the menu link settings and then in the override of category_item.php use:

<?php echo K2HelperUtilities::wordLimit($this->item->introtext, 20); ?>

This will apply a word limit of 20 words.


So where should I put this code in? At the beginning of category_item.php or at the end of it?

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

More
10 years 6 months ago #126905 by Lefteris
Replied by Lefteris on topic Re: Show featured items only in menu page
You put it where introtext is printed.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • kiemthu123
  • kiemthu123's Avatar Topic Author
  • Offline
  • New Member
More
10 years 6 months ago #126906 by kiemthu123
Replied by kiemthu123 on topic Re: Show featured items only in menu page
I put that code in my overrided category_item.php but it does not work, it skill show all the introtext in multicategories view.

My code looks like this:
<?php if($this->item->params->get('catItemIntroText')): ?>
<!-- Item introtext -->
<div class="catItemIntroText">

<?php echo K2HelperUtilities::wordLimit($this->item->introtext, 26); ?>

</div>
<?php endif; ?>

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

More
10 years 6 months ago #126907 by Lefteris
Replied by Lefteris on topic Re: Show featured items only in menu page
If it doesn't work you put it on the wrong file. If this is a menu link to multiple categories you need to select the desired template from the menu link settings and then update the category_item.php of that template.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum