Native way to hide rank title

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
User avatar
durangod
Registered User
Posts: 817
Joined: Tue Nov 03, 2009 1:26 pm
Location: USA East Texas
Name: Dave

Native way to hide rank title

Post by durangod »

When i use ranks i really dont want the title to show, its extra information that is not needed when i have a rank image that says the same thing. If
i have a rank image that says "Site Admin" i dont need the title showing that says "Site Admin".

The title is a required field in the rank form, i tried removing it and got an error.

In the html files there is an IF wrapping the rank title however i do not see any config setting to hide it. So i assume it just looks for the existance of the rank title.

Also the rank title does not have its own dedicated css so i could not just add display:none to the css.

So what i had to do was to modify several html files, that seems to do the trick. But i hate modding core files.

modded prosilver files:

memberlist_view.html approx line 15

Code: Select all

		
<!-- dave mod -->			
			<!-- changed by dave to hide the rank text title and added br -->
			<!-- IF RANK_TITLE --><dd style="text-align: center;"><!-- {RANK_TITLE} --><br /></dd><!-- ENDIF -->
<!-- end dave mod -->


ucp_pm_viewmessage.html approx line 40

Code: Select all

<!-- dave mod -->

        <!-- changed by dave to remove rank title from display and added br  -->		
		
		<!-- IF RANK_TITLE or RANK_IMG --><dd class="profile-rank"> <!-- {RANK_TITLE} --> <br /><!-- IF RANK_TITLE and RANK_IMG --><br /><!-- ENDIF -->{RANK_IMG}</dd><!-- ENDIF -->
		
<!-- end dave mod -->	
viewtopic_body.html approx line 157

Code: Select all

<!-- dave mod  -->

            <!-- changed to hide rank title from display and added br -->
            
			<!-- IF postrow.RANK_TITLE or postrow.RANK_IMG --><dd class="profile-rank"> <!-- {postrow.RANK_TITLE} --> <br /><!-- IF postrow.RANK_TITLE and postrow.RANK_IMG --><br /><!-- ENDIF -->{postrow.RANK_IMG}</dd><!-- ENDIF -->

<!-- end dave mod -->

Is there a native way without modding the files to hide the rank title?
Last edited by Mick on Sat Mar 02, 2024 9:56 am, edited 1 time in total.
Reason: Solved.
Username is short for durango dave
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6429
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: Native way to hide rank title

Post by thecoalman »

There is no way to do this without editing that I'm aware of so I'm moving this to custom coding.

Quick tip, you can comment out template code using <!-- IF 0 -->

Code: Select all

			<!-- IF 0 --> Dave Mod -  hide the rank text title
			<!-- IF RANK_TITLE --><dd style="text-align: center;">{RANK_TITLE}</dd><!-- ENDIF -->
			<!-- ENDIF -->
That will completely remove it from HTML output.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
User avatar
durangod
Registered User
Posts: 817
Joined: Tue Nov 03, 2009 1:26 pm
Location: USA East Texas
Name: Dave

Re: Native way to hide rank title

Post by durangod »

Thanks for sharing :)
Username is short for durango dave

Return to “phpBB Custom Coding”