Fork me on GitHub

List members in a certain group in a block  Bottom

  • Is there anything out there like this?
  • No need for a specific block to do this..... pnRender template magic can provide you exactly what your after in a far more configurable way.

    1) create a new block of type pnRender/custom pnRender block

    2) Set the module name and template name (e.g. Blocks and ourstaff.htm)

    3) create the template defined in the previous step (e.g. modules/Blocks/pntemplates/ourstaff.htm)

    4) add the following, sample, HTML into the template. Substitute the value gid in the first line to match your chosen group ID.

    Code

    <!--[pnmodapifunc modname=Groups func=get gid=2 assign=ourstaff]-->
    <ul>
    <!--[foreach from=$ourstaff.members item=member]-->
    <!--[pnusergetvar name=uname uid=$member assign=uname]-->
    <li><a href="user.php?op=userinfo&amp;uname=<!--[$uname|pnvarprepfordisplay]-->">
    <!--[$uname|pnvarprepfordisplay]--></a></li>
    <!--[/foreach]-->
    </ul>


    The sample template i've posted simply puts the users names (with a link to the profile) into an unordered list that can be styled with CSS. Obviously you can change the markup as required.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • thank you so much!
  • Mark (or others)

    I spent about an hour looking for code like this (probably due to my own ineptness) and finally found it here by hitting upon just the right terms. But I've had to do this before.

    Is there a nice concise list of standard template variables and functions available somewhere?
  • There's no definitive list perse since modules can provide thier own tags and, via the pnmodfunc and pnmodapifunc tags, you can access any module GUI or API function. Saying that take a look at



    -Mark

    --
    Visit My homepage and Zikula themes.

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