Keyword

K2 author avatar in category view

  • Adam O.
  • Adam O.'s Avatar Topic Author
  • Offline
  • New Member
More
10 years 7 months ago #125018 by Adam O.
K2 author avatar in category view was created by Adam O.
Hi there!

I've got simple question - how to load avatar author of article in category view?

In item view, code is very simple:
<img style="height:16px !important;" src="<?php echo $this->item->author->avatar; ?>" />

But in category view, I can't load the same avatar...

I've tried something like this:

<img src="<?php echo K2HelperUtilities::getAvatar($this->item->author->profile->avatar); ?>"/>

and many other paths but doesn't work :(

please... help.. :-)

best regards!
Adam

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

More
10 years 7 months ago - 10 years 7 months ago #125019 by YannisDr
Replied by YannisDr on topic Re: K2 author avatar in category view
Have you tried the following?

Go to Category tab (in K2) > Category you are interested for (or any category that inherits its options to other categories) > When you are in "Edit Category" window, look on the right for the "Item View options in category listings" > Author --> Turn it to "Show".

Hope this helps.

ps. Of course you must have loaded the avatars for each author from inside the K2 User's system.

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

More
10 years 7 months ago #125020 by YannisDr
Replied by YannisDr on topic Re: K2 author avatar in category view
Warning: Spoiler!

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

  • Adam O.
  • Adam O.'s Avatar Topic Author
  • Offline
  • New Member
More
10 years 7 months ago #125021 by Adam O.
Replied by Adam O. on topic Re: K2 author avatar in category view
I know about it, but it shows me only name of author :-)

I need to show name and avatar of this user....

any idea? :-)

regards!
Adam

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

  • Kannan Naidu Venugopal
  • Kannan Naidu Venugopal's Avatar
  • Offline
  • Platinum Member
  • Aham Brahmasmi
More
10 years 7 months ago #125022 by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Re: K2 author avatar in category view
You can accomplish this by using this code, place it where you want to appear, add css class and style it
					
K2 Rocks \m/

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

  • Adam O.
  • Adam O.'s Avatar Topic Author
  • Offline
  • New Member
More
10 years 7 months ago #125023 by Adam O.
Replied by Adam O. on topic Re: K2 author avatar in category view
so looks more than simply ;-)

many thanks to you!!

best regards
Adam

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

  • Kannan Naidu Venugopal
  • Kannan Naidu Venugopal's Avatar
  • Offline
  • Platinum Member
  • Aham Brahmasmi
More
10 years 7 months ago #125024 by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Re: K2 author avatar in category view
You're welcome :)

K2 Rocks \m/

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


Powered by Kunena Forum