Keyword

Show Author in Tag listing

  • Silence G
  • Silence G's Avatar Topic Author
  • Offline
  • New Member
More
11 years 9 months ago #108252 by Silence G
Show Author in Tag listing was created by Silence G
I have a customized K2 sub template for one of the categories in my site. I would like to show the author in the tag listings. I added the following to tag.php :

<?php if(empty($this->item->created_by_alias)): ?>
<a rel="author" href="<?php echo $this->item->author->link; ?>"><?php echo $this->item->author->name; ?></a>
<?php else: ?>
<?php echo $item->authorName; ?>
<?php endif; ?>

But its not printing the author.

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

More
11 years 8 months ago #108253 by Matt
Replied by Matt on topic Re: Show Author in Tag listing
Same here. Nothing of the following lines work in tag listings:
<?php echo $this->item->author->name; ?>
<?php echo $item->author->name; ?>
<?php echo $this->author->name; ?>
<?php echo $author->name; ?>

Help please.

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

More
11 years 7 months ago #108254 by Steven Johnson
Replied by Steven Johnson on topic Re: Show Author in Tag listing
Has anyone figured out how to do this? I also would like to add the author to my tag pages.

Here is the page I am styling up.

onlinebackupsearch.com/tag/zipcloud.html


Thanks! -- Steven

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

More
10 years 4 months ago #108255 by Nathan
Replied by Nathan on topic Re: Show Author in Tag listing
Hi Steven,

I'm trying to get this working as well without much luck. Just had a look at the link to your site and it seems that you managed to get it displaying at some stage.

Would you mind sharing the code/method for how you did it?

Thanks

Nathan

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

More
10 years 4 months ago #108256 by Nathan
Replied by Nathan on topic Re: Show Author in Tag listing
I'd thought I'd answer my own question in case anyone else is looking for it.

But kudos to Steven, I worked it out from one of your other posts on the forum about how to add Tags themselves to the Tags page.

So, to add the Author to the Tag listing, does require editing a core file which is a shame.

On line 236 the following needs to be added to the collection of views/tasks on which the Author can be displayed:

|| ($task == 'tag')

inside the last closing bracket.

And then use the standard code to add it to tag.php:
Log in  or Create an account to join the conversation.