Keyword

Exclude categories from User Page

  • Andreaz
  • Andreaz's Avatar Topic Author
  • Offline
  • New Member
More
13 years 4 months ago #96644 by Andreaz
Exclude categories from User Page was created by Andreaz
I really need to make this happen and I believe it shouldn't be that hard, but I don't know how to do it. I'm going to use K2 for community website and I want users to write their blog and post ads using K2. Though I dont want ad posts to show on their page, I only want blog posts to show. So I need to set that K2 User page would show only posts from one category, that is Blogs and exclude posts from Ads category. Also I believe that there should be User Page parameters in K2 core, so it's a suggestion for developer to add this feature in the future. Thank you,

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

  • Andreaz
  • Andreaz's Avatar Topic Author
  • Offline
  • New Member
More
13 years 4 months ago #96645 by Andreaz
Replied by Andreaz on topic Exclude categories from User Page
Well I believe I need to add some code change to /components/com_k2/templates/user.php around lines 89-95, but I'm not good with php so I don't know how to add code in order to exclude categories from displaying, or set just some categories to display. Please help. This shouldn't be that complicated to do.

 

<?php if(count($this->items)): ?>    <!-- Item list -->    <div class="userItemList">        <?php foreach ($this->items as $item): ?>                <!-- Start K2 Item Layout -->        <div class="userItemView<?php if(!$item->published || ($item->publish_up != $this->nullDate && $item->publish_up > $this->now) || ($item->publish_down != $this->nullDate && $item->publish_down < $this->now)) echo ' userItemViewUnpublished'; ?><?php echo ($item->featured) ? ' userItemIsFeatured' : ''; ?>">

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

  • Andreaz
  • Andreaz's Avatar Topic Author
  • Offline
  • New Member
More
13 years 3 months ago #96646 by Andreaz
Replied by Andreaz on topic Exclude categories from User Page
Anyone? I really need this feature.

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


Powered by Kunena Forum