Forum Rules Heading not on every Post ?

For support and discussion related to templates, themes, and imagesets in phpBB 3.2.
Post Reply
mrix2000
Registered User
Posts: 616
Joined: Sun Dec 03, 2006 2:23 pm

Forum Rules Heading not on every Post ?

Post by mrix2000 » Thu Mar 07, 2019 12:27 pm

Hello all, I was wondering if its possible only to have the Forum rules heading, only heading the over sub forum and not every topic made withing that forum?
Thanks for any feedback

User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 3175
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Forum Rules Heading not on every Post ?

Post by thecoalman » Thu Mar 07, 2019 4:12 pm

If you open styles/prosilver/template/viewtopic_body.html you'll find this at the top.

Code: Select all

<!-- IF S_FORUM_RULES -->
	<div class="rules<!-- IF U_FORUM_RULES --> rules-link<!-- ENDIF -->">
		<div class="inner">

		<!-- IF U_FORUM_RULES -->
			<a href="{U_FORUM_RULES}">{L_FORUM_RULES}</a>
		<!-- ELSE -->
			<strong>{L_FORUM_RULES}</strong><br />
			{FORUM_RULES}
		<!-- ENDIF -->

		</div>
	</div>
<!-- ENDIF -->
You can either remove it or comment it out, leaving comment is preferable. To comment out something in template you would do it like this:

Code: Select all

<!-- IF 0 -->Removed this because of blah, blah, blah....
// Template code to remove
<!-- ENDIF -->
Example for your case:

Code: Select all

<!-- IF 0 -->Removed this because of blah, blah, blah....
<!-- IF S_FORUM_RULES -->
	<div class="rules<!-- IF U_FORUM_RULES --> rules-link<!-- ENDIF -->">
		<div class="inner">

		<!-- IF U_FORUM_RULES -->
			<a href="{U_FORUM_RULES}">{L_FORUM_RULES}</a>
		<!-- ELSE -->
			<strong>{L_FORUM_RULES}</strong><br />
			{FORUM_RULES}
		<!-- ENDIF -->

		</div>
	</div>
<!-- ENDIF -->
<!-- ENDIF -->
Keep a list of any file you edit, your edits will need to be merged into new files when you update.

User avatar
Lumpy Burgertushie
Registered User
Posts: 66268
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Forum Rules Heading not on every Post ?

Post by Lumpy Burgertushie » Thu Mar 07, 2019 4:38 pm

what is this: <!-- IF 0 -->

I have always used <!-- remove this --> and I just checked , it still works.


rob ert
I am going to be out of town and off line for a week . see ya when I get back.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 50422
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Forum Rules Heading not on every Post ?

Post by stevemaury » Thu Mar 07, 2019 4:45 pm

<!-- fubar --> works too.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

User avatar
Lumpy Burgertushie
Registered User
Posts: 66268
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Forum Rules Heading not on every Post ?

Post by Lumpy Burgertushie » Thu Mar 07, 2019 4:50 pm

my question was really where did this come from: <!-- IF 0 -->
that turns the commenting out into an IF statement.
I have never seen it until recently.


robert
I am going to be out of town and off line for a week . see ya when I get back.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 3175
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Forum Rules Heading not on every Post ?

Post by thecoalman » Thu Mar 07, 2019 9:34 pm

Lumpy Burgertushie wrote:
Thu Mar 07, 2019 4:50 pm
my question was really where did this come from: <!-- IF 0 -->
That comes from way back in the day Lumpy, no idea where I picked it up. 0 is false and cannot be true. :)

This doesn't comment out HTML code in the parsed document, it removes it. When I'm merging an update it's quite helpful because I know what is supposed to be there for file comparisons. I don't have be guessing if it's new code.

Even if you wanted to leave comment like you would in php file:

Code: Select all

<!-- IF 0 -->Changed the following line because of blah, blah, blah<!-- ENDIF -->

User avatar
3Di
Former Team Member
Posts: 13684
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Forum Rules Heading not on every Post ?

Post by 3Di » Fri Mar 08, 2019 3:45 am

https://wiki.phpbb.com/Tutorial.Templat ... x#Comments

Twig:
{# Changed the following line because of blah, blah, blah #}
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

User avatar
Lumpy Burgertushie
Registered User
Posts: 66268
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Forum Rules Heading not on every Post ?

Post by Lumpy Burgertushie » Fri Mar 08, 2019 5:29 am

I haven't even looked at twig yet. I guess I am just getting too old to start learning a whole new system for styles etc.


roberrt
I am going to be out of town and off line for a week . see ya when I get back.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
3Di
Former Team Member
Posts: 13684
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Forum Rules Heading not on every Post ?

Post by 3Di » Fri Mar 08, 2019 6:01 am

Using the above twig way to write comments in the HTML has a property: isn't parsed in "view source", it's invisible.

If instead you want to comment out parts of code.. Ie.:

Code: Select all

{# Removed this because of blah, blah, blah....
<fieldset>
	<legend>Legend title</legend>
</fieldset>
#}
Only

Code: Select all

<!-- <fieldset>
	<legend>Legend title</legend>
</fieldset> -->
will be rendered in view source, as commented code.

And only 4 chars to digit on purpose.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

Post Reply

Return to “[3.2.x] Styles Support & Discussion”