Keyword

Extra Fields on Author Pages

  • Nathan
  • Nathan's Avatar Topic Author
  • Offline
  • Junior Member
More
2 years 1 week ago #179991 by Nathan
Extra Fields on Author Pages was created by Nathan
Hi there,

I've noticed that there's no option for displaying Extra Fields on the Author pages (user.php) like there is for the Tag pages.

Is there some code I can add to that file so that I can display individual extra fields on their items?

Thanks

Nathan

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

More
2 years 6 days ago #180002 by JoomlaWorks
Replied by JoomlaWorks on topic Extra Fields on Author Pages
The foreach loop from tag.php should work if I recall correctly: github.com/getk2/k2/blob/master/components/com_k2/templates/default/tag.php#L90

The settings for all item lists will be streamlined on the next major update of K2, e.g. if there's an option to toggle tag display on/off in the tags, then it's gonna be added in the author blogs (user pages) too.

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

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

  • Nathan
  • Nathan's Avatar Topic Author
  • Offline
  • Junior Member
More
2 years 6 days ago #180008 by Nathan
Replied by Nathan on topic Extra Fields on Author Pages
Hi Fotis,

I've tried copying the foreach loop in to the Item are but it just generates the empty UL tags wrapped around it.

I found this other post from a while ago that suggests the extra fields may not be available in this file by default - www.joomlaworks.net/forum/k2-en/41072-how-to-access-extra-fields-in-author-view#143072

I've added that code and will print the array of extra fields listed by their field id, but that's not exactly what I was after.

I'm trying to build a more complex layout using some queries on my extra fields such as:
<?php if(isset($item->extraFields->productionCompany->value)): ?>
                    <div class="abr-home-production-company"><?php echo $item->extraFields->productionCompany->value; ?></div>
                <?php endif; ?>

Is that possible or will I have to query the fields by ID?

Thanks

Nathan

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


Powered by Kunena Forum