I am trying to configure my site to display the author of news articles to display their avatar.
Unfortunately, there are no settings that I could find. Perhaps there is a template tag that will allow me to do this?
Thanks :)
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- internetking created topic »password problem« 25. May
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- ehdwma created topic »Hide "Register new account" and change template to 3 col« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
- mdee created topic »How to implement returnpage ?« 25. May
- nestormateo responded to »Fillters in Clip« 24. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
display authors avatar in news articles
-
- Rank: Registered User
- Registered: Feb 24, 2006
- Last visit: Oct 21, 2009
- Posts: 24
-
**unknown user**
- Rank: Helper
- Registered: Mar 16, 2002
- Last visit: May 18, 2010
- Posts: 985
I never use the core News module, but maybe this:
Code
<!--[pnusergetvar name=_YOURAVATAR uname=$info.informant assign=avatar]-->
<!--[if $avatar != ""]--><img src="images/avatar/<!--[$avatar|pnvarprepfordisplay]-->" alt="<!--[$info.informant]-->'s Avatar" /><!--[/if]-->
can help you...
- Igor -
**unknown user**
- Rank: Expert
- Registered: Mar 16, 2002
- Last visit: Apr 02, 2010
- Posts: 1208
If that doesn't work, try:
(stolen from the Profile module's view template)Code
<!--[if @in_array('_YOURAVATAR', $dudarray)]-->
<img src="images/avatar/<!--[$userinfo._YOURAVATAR|pnvarprepfordisplay]-->" alt="" />
<!--[/if]--> -
- Rank: Registered User
- Registered: Feb 24, 2006
- Last visit: Oct 21, 2009
- Posts: 24
videokid
Code
<!--[pnusergetvar name=_YOURAVATAR uname=$info.informant assign=avatar]-->
<!--[if $avatar != ""]--><img src="images/avatar/<!--[$avatar|pnvarprepfordisplay]-->" alt="<!--[$info.informant]-->'s Avatar" /><!--[/if]-->
This works perfectly. Thanks. -
- Rank: Team Member
- Registered: Jul 15, 2004
- Last visit: May 27, 2010
- Posts: 277
And in the future with Zikula 1.3 just one line:
Code
{useravatar uid=2} -
- Rank: Developer
- Registered: Aug 23, 2003
- Last visit: May 31, 2010
- Posts: 1428
If you like you can add a ticket to the News project (code.zikula.org/news) for this parameter to be more easily available. So to have like $info.informant a $info.informantavatar
They $info.informant needs a new name as well
the author of an article is called contributor throughout the News code, but this parameter still has the legacy name. For the full zikula 1.3 update of News a cleanup should be done.
News is now in the making to be compatible with zikula 1.3, but it does not take advantage of the new object oriented stuff yet. In that way zikula 12x users can also benefit from the new version.
--
campertoday.nl, Module development, Dutch Zikula Community
- Moderated by:
- Support
Users on-line
- 0 users
This list is based on users active over the last 60 minutes.
