XF 2.1 View moderators and moderators in the forum such as VB

Radhi

Active member
Hi
What is the code to show the forum moderators and moderators?
Example
204375
or
204376

I want to help
I want the code
Thank you in advance
 
  • Like
Reactions: JCP
You can do it by following these steps

open node_list_forum template and look for

HTML:
<xf:else />
                    <span class="node-extra-placeholder">{{ phrase('none') }}</span>
                </xf:if>
            </div>

and add below it this code:

HTML:
<xf:if is="$node.Moderators is not empty">
                <div class="node-extra-moderator">
                    <span><xf:fa icon="fa-users-cog" data-xf-init="tooltip" title="{{ phrase('moderators')}}" />
                        <ul class="moderator-menu">
                    <xf:foreach loop="$node.Moderators" value="$moderator">
                            <li><xf:username user="{$moderator.User}" defaultname="{$moderator.User.username}" /></li>
                    </xf:foreach>
                    </ul>
                        </span>
                </div>
            </xf:if>

and open node_list_category and repeat above two steps then add below code to extra.less template

CSS:
.node-extra-moderator{
    display: table-cell;
    vertical-align: middle;
    padding: 10px;
    font-size: 13px;
    position: relative;
    width: 50px;
    span{
            i{
                font-size: 12pt;
                color:@xf-linkColor;
                cursor: pointer;
            }

        &:hover .moderator-menu{
            display: block;
        }
   
   
            .moderator-menu{
                display: none;
                position: absolute;
                top:21px;
                background-color: #f9f9f9;
                min-width: 160px;
                box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
                padding: 7px 16px;
                z-index: 1;
                list-style: none;
                transition: all .5s ease 0s;
                -webkit-transition: all .5s ease 0s;
                -moz-transition: all .5s ease 0s;
                -o-transition: all .5s ease 0s;

                    li{
                        padding: 5px 0;
                      }
            }

    }
}

Best Regards
shqawe
 
Top Bottom