Attempting to change style of one forum title.

For support and discussion related to templates, themes, and imagesets in phpBB 3.2.
pawlshepherd
Registered User
Posts: 17
Joined: Sat Oct 26, 2019 12:46 am
Name: Paul Shepherd

Attempting to change style of one forum title.

Post by pawlshepherd »

Pretty much what the title says. There is a single forum that I wish to style the title for on the index page. The forum name field doesn't seem to like HTML/BBCode, so I did some digging and have found the coding guidelines.

Code: Select all

<!-- IF loop.S_ROW_COUNT > 10 -->
		<tr bgcolor="#FF0000">
	<!-- ELSEIF loop.S_ROW_COUNT > 5 -->
		<tr bgcolor="#00FF00">
	<!-- ELSEIF loop.S_ROW_COUNT > 2 -->
		<tr bgcolor="#0000FF">
	<!-- ELSE -->
		<tr bgcolor="#FF00FF">
	<!-- ENDIF -->
While I'm unfamiliar with the format, I can (I think) understand what I'm trying to do, but I don't know the technical details. in the viewforum_body file I have found this;

Code: Select all

<h2 class="forum-title"><!-- EVENT viewforum_forum_name_prepend --><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a><!-- EVENT viewforum_forum_name_append --></h2>
I'm assuming that the easiest way would be for me to add something like <!-- IF FORUM_ID == X --> <span style="X">{FORUM_NAME}</span> <!-- ELSE --> {FORUM_NAME} <!-- ENDIF -->

Whether or not that is the case is there anybody that can give me a little assistance?

Many thanks!
User avatar
Lumpy Burgertushie
Registered User
Posts: 69228
Joined: Mon May 02, 2005 3:11 am

Re: Attempting to change style of one forum title.

Post by Lumpy Burgertushie »

have you tried that to see if it works?
IT looks good to me.

try it. edit the relevant file like you said and save it and upload it back and test.

if it doesn't work, just remove the edits or restore the backup you made before you edited the file.

keep in mind that if you are editing prosilver you will have to redo it each time you update.

robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
pawlshepherd
Registered User
Posts: 17
Joined: Sat Oct 26, 2019 12:46 am
Name: Paul Shepherd

Re: Attempting to change style of one forum title.

Post by pawlshepherd »

Gave it a go, but no luck. A little bit of Googling seems to suggest that FORUM_ID checks the ID of the forum that you are currently on, so the index page would be 0. I don't know how to look for the id of the forum that's about to be displayed in the table though, if what I'm saying makes sense?
Is there a list anywhere explaining all the available functions? (I realise that functions is probably the wrong term, sorry!)


Ed;

If it helps, this is the forum I'm playing with. All I want to do is change the text colour for one of the forum names.
User avatar
Lumpy Burgertushie
Registered User
Posts: 69228
Joined: Mon May 02, 2005 3:11 am

Re: Attempting to change style of one forum title.

Post by Lumpy Burgertushie »

it should work . when you are viewing the index page you are seeing the forumlist_body.html file as well as the index_body.html file
so, the file to edit would be the forumlist_body.html file.

show us exactly how you made the edits that you say did not work.

robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
pawlshepherd
Registered User
Posts: 17
Joined: Sat Oct 26, 2019 12:46 am
Name: Paul Shepherd

Re: Attempting to change style of one forum title.

Post by pawlshepherd »

Aha!

So you pointed me in the right direction, and I was able to get the rest of the way there. I was looking in the wrong file entirely - for some reason I was in viewforum_body and not forumlist_body.

Once I'd moved to the right file (and located what I thought was the right place) I replaced this;

Code: Select all

<a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a>
with this;

Code: Select all

<a href="{forumrow.U_VIEWFORUM}" class="forumtitle"><!-- IF forumrow.FORUM_ID == 6 --><span style="color:#24D330;font-size:140%;"><!-- ENDIF -->{forumrow.FORUM_NAME}<!-- IF forumrow.FORUM_ID == 6 --></span><!-- ENDIF --></a>
It took a little guesswork, because originally I was using FORUM_ID and not forumrow.FORUM_ID, and I'm still not entirely sure how this all works, but I'm getting there!

Thanks for the help Robert! =]
User avatar
Lumpy Burgertushie
Registered User
Posts: 69228
Joined: Mon May 02, 2005 3:11 am

Re: Attempting to change style of one forum title.

Post by Lumpy Burgertushie »

ok, forumlist_body.html
on line 65 you have this:

Code: Select all

<a href="{forumrow.U_VIEWFORUM}" class="forumtitle"><!-- IF forumrow.FORUM_ID == 6 --><span style="color:#24D330;font-size:140%;"><!-- ENDIF -->{forumrow.FORUM_NAME}<!-- IF forumrow.FORUM_ID == 6 --></span><!-- ENDIF --></a>
replace it with this:

Code: Select all

<a href="{forumrow.U_VIEWFORUM}" <!-- IF forumrow.FORUM_ID eq '6' --><span style="color:#24D330;font-size:140%;">{forumrow.FORUM_NAME}</span> <!-- ELSE --> class="forumtitle">{forumrow.FORUM_NAME}</a><!-- ENDIF -->
that should work.
robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
pawlshepherd
Registered User
Posts: 17
Joined: Sat Oct 26, 2019 12:46 am
Name: Paul Shepherd

Re: Attempting to change style of one forum title.

Post by pawlshepherd »

It's looks to me like that's just cleaning up sloppy work? If so then when I'm back at my computer I'll update, but until then things are at least working.
Again, my thanks for your help! =]

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