Jump to content
DevFuse Forums

Primary Group and Group Icon in Staff Page


Description

add staff names under profile

invision power board fail to implement this in the staff section but you can hard code with this tutorial

 

Primary Group in Staff Page

This will display the primary group of the user instead of the member title on the forum team page

Go to: ACP > Customization > Themes > YourTheme (Edit HTML/CSS) - find: core > front > staffdirectory > layout_blocks and click for edit

REPLACE ALL CONTENT WITH:

{{$count=0;}}
{{foreach $users as $user}}
	{{if $count%4 == 0}}
		<div class='ipsGrid ipsGrid_collapsePhone cStaffDirectory_blocks'>
	{{endif}}
		<div class='ipsGrid_span3 ipsType_center ipsAreaBackground_light ipsPad'>
			{template="userPhoto" app="core" group="global" params="$user->member(), 'small'"}
			<h3 class='ipsType_sectionHead'>
				{{if \IPS\Member::loggedIn()->language()->checkKeyExists( "core_staff_directory_name_{$user->id}" ) }}
					{{if member.canAccessModule( \IPS\Application\Module::get( 'core', 'members' ) )}}
						<a href='{$user->member()->url()}'>{lang="core_staff_directory_name_{$user->id}" escape="true"}</a>
					{{else}}
						{lang="core_staff_directory_name_{$user->id}" escape="true"}
					{{endif}}
				{{else}}
					{$user->member()->link()|raw}
				{{endif}}
			</h3>
			<p class='ipsType_reset ipsType_normal ipsType_light'>
				{{if \IPS\Member::loggedIn()->language()->checkKeyExists( "core_staff_directory_title_{$user->id}" )}}
					{lang="core_staff_directory_title_{$user->id}" escape="true"}
				{{else}}
					{expression="\IPS\Member\Group::load( $user->member()->member_group_id )->formattedName" raw="true"}
				{{endif}}
			</p>
			{{if !member.members_disable_pm AND !$user->member()->members_disable_pm AND \IPS\Member::loggedIn()->member_id AND \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'messaging' ) )}}
				<br>
				<a href='{url="app=core&module=messaging&controller=messenger&do=compose&to={$user->member()->member_id}" seoTemplate="messenger_compose"}' data-ipsDialog data-ipsDialog-title='{lang="compose_new"}' data-ipsDialog-forceReload data-ipsDialog-remoteSubmit data-ipsDialog-flashMessage="{lang="message_sent"}"><i class='fa fa-envelope'></i> {lang="message_send"}</a>
			{{endif}}
		</div>
	{{$count++;}}
	{{if $count%4 == 0}}
		</div>
		<br>
	{{endif}}
{{endforeach}}
{{if $count%4 != 0}}
	</div>
	<br>
{{endif}}

staffdir.png.45b7b5170cb0cb281845340e79e7132f.thumb.png.fdb81e0f83f2db4370b8db18ee51b43c.png

GROUP ICON IMAGE ON STAFF PAGE

This will show the group's image / icon (if any), defined in ACP> Members> Groups> GroupName> Group Icon

GO TO: ACP > Customization > Themes > YourTheme (Edit HTML/CSS) - find core > front > staffdirectory > layout_blocks

REPLACE ALL CONTENT WITH:

{{$count=0;}}
{{foreach $users as $user}}
	{{if $count%4 == 0}}
		<div class='ipsGrid ipsGrid_collapsePhone cStaffDirectory_blocks'>
	{{endif}}
		<div class='ipsGrid_span3 ipsType_center ipsAreaBackground_light ipsPad'>
			{template="userPhoto" app="core" group="global" params="$user->member(), 'small'"}
			<h3 class='ipsType_sectionHead'>
				{{if \IPS\Member::loggedIn()->language()->checkKeyExists( "core_staff_directory_name_{$user->id}" ) }}
					{{if member.canAccessModule( \IPS\Application\Module::get( 'core', 'members' ) )}}
						<a href='{$user->member()->url()}'>{lang="core_staff_directory_name_{$user->id}" escape="true"}</a>
					{{else}}
						{lang="core_staff_directory_name_{$user->id}" escape="true"}
					{{endif}}
				{{else}}
					{$user->member()->link()|raw}
				{{endif}}
			</h3>
			<p class='ipsType_reset ipsType_normal ipsType_light'>
				{{if \IPS\Member::loggedIn()->language()->checkKeyExists( "core_staff_directory_title_{$user->id}" )}}
					{lang="core_staff_directory_title_{$user->id}" escape="true"}
				{{else}}
					{expression="\IPS\Member\Group::load( $user->member()->member_group_id )->formattedName" raw="true"}
					{{if \IPS\Member\Group::load( $user->member()->member_group_id )->g_icon }}
						<li style="list-style:none" class='ipsResponsive_hidePhone'><img src='{file="$user->member()->group['g_icon']" extension="core_Theme"}' alt='' class='cAuthorGroupIcon'></li>
					{{endif}}
				{{endif}}
			</p>
			{{if !member.members_disable_pm AND !$user->member()->members_disable_pm AND \IPS\Member::loggedIn()->member_id AND \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'messaging' ) )}}
				<br>
				<a href='{url="app=core&module=messaging&controller=messenger&do=compose&to={$user->member()->member_id}" seoTemplate="messenger_compose"}' data-ipsDialog data-ipsDialog-title='{lang="compose_new"}' data-ipsDialog-forceReload data-ipsDialog-remoteSubmit data-ipsDialog-flashMessage="{lang="message_sent"}"><i class='fa fa-envelope'></i> {lang="message_send"}</a>
			{{endif}}
		</div>
	{{$count++;}}
	{{if $count%4 == 0}}
		</div>
		<br>
	{{endif}}
{{endforeach}}
{{if $count%4 != 0}}
	</div>
	<br>
{{endif}}

In spoiler, is the code for the other layouts of the directory staff. (You can choose 3 layouts in ACP settings and all have to be changed for group primary to be displayed)

VERTICAL LAYOUT (layout full):

GO TO: ACP > Customization > Themes > YourTheme (Edit HTML/CSS) - find core > front > staffdirectory > layout_full

REPLACE ALL CONTENT WITH:

{{foreach $users as $user}}
	<div class='ipsAreaBackground_light ipsPad ipsPhotoPanel ipsPhotoPanel_small ipsSpacer_bottom ipsSpacer_half cStaffDirectory_full'>
		{template="userPhoto" app="core" group="global" params="$user->member(), 'small'"}
		<div>
			<h3 class='ipsType_sectionHead'>
				{{if \IPS\Member::loggedIn()->language()->checkKeyExists( "core_staff_directory_name_{$user->id}" ) }}
					{{if member.canAccessModule( \IPS\Application\Module::get( 'core', 'members' ) )}}
						<a href='{$user->member()->url()}'>{lang="core_staff_directory_name_{$user->id}" escape="true"}</a>
					{{else}}
						{lang="core_staff_directory_name_{$user->id}" escape="true"}
					{{endif}}
				{{else}}
					{$user->member()->link()|raw}
				{{endif}}
			</h3>
			<p class='ipsType_reset ipsType_normal ipsType_light'>
				{{if \IPS\Member::loggedIn()->language()->checkKeyExists( "core_staff_directory_title_{$user->id}" )}}
					{lang="core_staff_directory_title_{$user->id}" escape="true"}
				{{else}}
					{expression="\IPS\Member\Group::load( $user->member()->member_group_id )->formattedName" raw="true"}
				{{endif}}
			</p>
			{{if \IPS\Member::loggedIn()->language()->checkKeyExists( "core_staff_directory_bio_{$user->id}" )}}
				<br>
				<div class='ipsType_richText ipsType_normal' data-ipsTruncate data-ipsTruncate-size="4 lines" data-ipsTruncate-type="hide">{lang="core_staff_directory_bio_{$user->id}"}</div>
			{{endif}}			
			{{if !member.members_disable_pm AND !$user->member()->members_disable_pm AND \IPS\Member::loggedIn()->member_id AND \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'messaging' ) )}}
				<br>
			<a href='{url="app=core&module=messaging&controller=messenger&do=compose&to={$user->member()->member_id}" seoTemplate="messenger_compose"}' data-ipsDialog data-ipsDialog-title='{lang="compose_new"}' data-ipsDialog-forceReload data-ipsDialog-remoteSubmit data-ipsDialog-flashMessage="{lang="message_sent"}"><i class='fa fa-envelope'></i> {lang="message_send"}</a>
			{{endif}}
		</div>
	</div>
{{endforeach}}

LAYOUT HALF

GO TO: ACP > Customization > Theme > YourTheme (EDIT HTML/CSS) - find - core > front > staffdirectory > layout_half

REPLACE ALL CONTENT WITH :

{{$count=0;}}
{{foreach $users as $user}}
	{{if $count%2 == 0}}
		<div class='ipsGrid ipsGrid_collapsePhone ipsSpacer_bottom cStaffDirectory_half'>
	{{endif}}
			<div class='ipsGrid_span6 ipsPhotoPanel ipsPhotoPanel_small ipsAreaBackground_light ipsPad'>
				{template="userPhoto" app="core" group="global" params="$user->member(), 'small'"}
				<div>
					<h3 class='ipsType_sectionHead'>
						{{if \IPS\Member::loggedIn()->language()->checkKeyExists( "core_staff_directory_name_{$user->id}" ) }}
							{{if member.canAccessModule( \IPS\Application\Module::get( 'core', 'members' ) )}}
								<a href='{$user->member()->url()}'>{lang="core_staff_directory_name_{$user->id}" escape="true"}</a>
							{{else}}
								{lang="core_staff_directory_name_{$user->id}" escape="true"}
							{{endif}}
						{{else}}
							{$user->member()->link()|raw}
						{{endif}}
					</h3>
					<p class='ipsType_light ipsType_normal ipsType_reset'>
						{{if \IPS\Member::loggedIn()->language()->checkKeyExists( "core_staff_directory_title_{$user->id}" ) }}
							{lang="core_staff_directory_title_{$user->id}" escape="true"}
						{{else}}
							{expression="\IPS\Member\Group::load( $user->member()->member_group_id )->formattedName" raw="true"}
						{{endif}}
					</p>
					{{if \IPS\Member::loggedIn()->language()->checkKeyExists( "core_staff_directory_bio_{$user->id}" )}}
						<br>
						<div class='ipsType_richText ipsType_normal' data-ipsTruncate data-ipsTruncate-size="4 lines" data-ipsTruncate-type="hide">{lang="core_staff_directory_bio_{$user->id}"}</div>
					{{endif}}			
					{{if !member.members_disable_pm AND !$user->member()->members_disable_pm AND \IPS\Member::loggedIn()->member_id AND \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'messaging' ) )}}
						<br>
						<a href='{url="app=core&module=messaging&controller=messenger&do=compose&to={$user->member()->member_id}" seoTemplate="messenger_compose"}' data-ipsDialog data-ipsDialog-title='{lang="compose_new"}' data-ipsDialog-forceReload data-ipsDialog-remoteSubmit data-ipsDialog-flashMessage="{lang="message_sent"}"><i class='fa fa-envelope'></i> {lang="message_send"}</a>
					{{endif}}
				</div>
			</div>
	{{$count++;}}
	{{if $count%2 == 0}}
		</div>
	{{endif}}
{{endforeach}}
{{if $count%2 != 0}}
	</div>
{{endif}}

your done



Recommended Comments

There are no comments to display.

×