Fork me on GitHub

display authors avatar in news articles  Bottom

  • 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 :)
  • 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
  • If that doesn't work, try:

    Code

    <!--[if @in_array('_YOURAVATAR', $dudarray)]-->
    <img src="images/avatar/<!--[$userinfo._YOURAVATAR|pnvarprepfordisplay]-->" alt="" />
    <!--[/if]-->
    (stolen from the Profile module's view template)
  • 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.
  • And in the future with Zikula 1.3 just one line:

    Code

    {useravatar uid=2}
  • 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 icon_smile 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
  • 0 users

This list is based on users active over the last 60 minutes.