Keyword

Exclude category from user pages

  • burnyourears
  • burnyourears's Avatar Topic Author
  • Offline
  • Senior Member
More
11 years 8 months ago #108453 by burnyourears
Exclude category from user pages was created by burnyourears
I have a magazine with news and articles. On the author pages I only want to show the articles and exclude the news.

Has anyone any idea how I can exclude the category "news" from the itemlist on the author pages?

Thank you very much for any help or suggestions!

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

More
11 years 8 months ago #108454 by william white
Replied by william white on topic Re: Exclude category from user pages
You can probably create an override and change the foreach loop at line 92 or the if statement on line 95 (k2 ver 2.6.2) and hardcode the category you want to skip if the item belongs to it.

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

  • burnyourears
  • burnyourears's Avatar Topic Author
  • Offline
  • Senior Member
More
11 years 8 months ago #108455 by burnyourears
Replied by burnyourears on topic Re: Exclude category from user pages
Thank you very much for that tipp - can you tell me which php-file I have to change?

... and maybe what I must do exactly? I'm no coder ... :/

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

  • burnyourears
  • burnyourears's Avatar Topic Author
  • Offline
  • Senior Member
More
11 years 8 months ago #108456 by burnyourears
Replied by burnyourears on topic Re: Exclude category from user pages
No idea anybody? It must be some way easy :dry:

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

More
11 years 8 months ago #108457 by william white
Replied by william white on topic Re: Exclude category from user pages
try user.php

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

  • burnyourears
  • burnyourears's Avatar Topic Author
  • Offline
  • Senior Member
More
11 years 8 months ago - 11 years 8 months ago #108458 by burnyourears
Replied by burnyourears on topic Re: Exclude category from user pages
Thanks, but - I have no ideo what to change. Can't code it by myself... :(

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

  • burnyourears
  • burnyourears's Avatar Topic Author
  • Offline
  • Senior Member
More
7 years 9 months ago #159386 by burnyourears
Replied by burnyourears on topic Exclude category from user pages
Ok, still working on that issue ;-)

I think I have found the part I will have to change:
<?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' : ''; ?>">

So I want to exclude all articles in category 115 but I don't have any idea how to code it. Could anyone help me with an idea please?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 9 months ago #159400 by Krikor Boghossian
Replied by Krikor Boghossian on topic Exclude category from user pages
You can create a "User page (blog)" menu item and manually select the categories you want to show.

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

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

  • burnyourears
  • burnyourears's Avatar Topic Author
  • Offline
  • Senior Member
More
7 years 9 months ago #159417 by burnyourears
Replied by burnyourears on topic Exclude category from user pages
Ah, that's a very good hint ... I will try that, thank you very much.

Is it possible to link the authors profile (via the link on the author's name in articles written by him) automatically to that userpage then?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 9 months ago #159425 by Krikor Boghossian
Replied by Krikor Boghossian on topic Exclude category from user pages
Yes, if a menu item exists, then that link will be used.

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