Indenting Sub-Forums and Sub-Sub-Forums

For support and discussion related to templates and themes in phpBB 3.3.
Post Reply
man_o_man
Registered User
Posts: 100
Joined: Sun Mar 22, 2020 1:53 am

Indenting Sub-Forums and Sub-Sub-Forums

Post by man_o_man »

Being very new to phpBB, i just noticed that sub-forums and sub-sub-forums are not indented, thus making it not very easy, or somewhat difficult, for members, especially new members, determine which one is the main forum, and which ones are the sub-forums, and which ones are sub-forums of the sub-forums. So I am requesting an update that will automatically indent what needs to be indented. In fact, I actually thought that the theme I am using had a bug because of lack of indentation, but no bug as it turns out.

For example, this is how the site should look to anyone viewing the site, absent any extensions of course.
CATEGORY
-----Forum 1
----------Sub-Forum
---------------Sub-Sub-Forum
-----Forum 2
----------Sub-Forum
---------------Sub-Forum

So if an update can be done, it would help a lot.

Thanks
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52305
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Indenting Sub-Forums and Sub-Sub-Forums

Post by Brf »

That would take some sort of Extension, not just a style change. The current forumlist only splits out one level of forum, so you are seeing Category and one-level of Forum, then all of the levels of subforum are listed in a line below each forum. The Jumpbox, on the other hand, shows the levels of subforums indented.
man_o_man
Registered User
Posts: 100
Joined: Sun Mar 22, 2020 1:53 am

Re: Indenting Sub-Forums and Sub-Sub-Forums

Post by man_o_man »

what and where is the jumpbox? Never heard of it before.
User avatar
ssl
Registered User
Posts: 585
Joined: Sat Feb 08, 2020 2:15 pm
Location: France
Name: Fred
Contact:

Re: Indenting Sub-Forums and Sub-Sub-Forums

Post by ssl »

Hi
The jumpbox is that

Image
Sorry for my English ... I do my best!

phpBB version: 3.3.3
php version: 8.0.2
User avatar
PlanetStyles.net
Former Team Member
Posts: 4747
Joined: Wed Nov 04, 2009 11:16 pm
Location: UK
Name: Christian
Contact:

Re: Indenting Sub-Forums and Sub-Sub-Forums

Post by PlanetStyles.net »

Hi :)

You can achieve this (to some extent) using front-end edits only.

Open: /styles/*/template/forumlist_body.html

Find:

Code: Select all

						<!-- IF .forumrow.subforum and forumrow.S_LIST_SUBFORUMS -->
							<!-- EVENT forumlist_body_subforums_before -->
							<br /><strong>{forumrow.L_SUBFORUM_STR}{L_COLON}</strong>
							<!-- BEGIN subforum -->
								<!-- EVENT forumlist_body_subforum_link_prepend --><a href="{forumrow.subforum.U_SUBFORUM}" class="subforum<!-- IF forumrow.subforum.S_UNREAD --> unread<!-- ELSE --> read<!-- ENDIF -->" title="<!-- IF forumrow.subforum.S_UNREAD -->{L_UNREAD_POSTS}<!-- ELSE -->{L_NO_UNREAD_POSTS}<!-- ENDIF -->">
									<i class="icon <!-- IF forumrow.subforum.IS_LINK -->fa-external-link<!-- ELSE -->fa-file-o<!-- ENDIF --> fa-fw <!-- IF forumrow.subforum.S_UNREAD --> icon-red<!-- ELSE --> icon-blue<!-- ENDIF --> icon-md" aria-hidden="true"></i>{forumrow.subforum.SUBFORUM_NAME}</a><!-- IF not forumrow.subforum.S_LAST_ROW -->{L_COMMA_SEPARATOR}<!-- ENDIF --><!-- EVENT forumlist_body_subforum_link_append -->
							<!-- END subforum -->
							<!-- EVENT forumlist_body_subforums_after -->
						<!-- ENDIF -->
We need to add a container. Replace the above with:

Code: Select all

						<!-- IF .forumrow.subforum and forumrow.S_LIST_SUBFORUMS -->
							<!-- EVENT forumlist_body_subforums_before -->
							<span class="subforum_container">
							<br /><strong>{forumrow.L_SUBFORUM_STR}{L_COLON}</strong>
							<!-- BEGIN subforum -->
								<!-- EVENT forumlist_body_subforum_link_prepend --><a href="{forumrow.subforum.U_SUBFORUM}" class="subforum<!-- IF forumrow.subforum.S_UNREAD --> unread<!-- ELSE --> read<!-- ENDIF -->" title="<!-- IF forumrow.subforum.S_UNREAD -->{L_UNREAD_POSTS}<!-- ELSE -->{L_NO_UNREAD_POSTS}<!-- ENDIF -->">
									<i class="icon <!-- IF forumrow.subforum.IS_LINK -->fa-external-link<!-- ELSE -->fa-file-o<!-- ENDIF --> fa-fw <!-- IF forumrow.subforum.S_UNREAD --> icon-red<!-- ELSE --> icon-blue<!-- ENDIF --> icon-md" aria-hidden="true"></i>{forumrow.subforum.SUBFORUM_NAME}</a><!-- IF not forumrow.subforum.S_LAST_ROW -->{L_COMMA_SEPARATOR}<!-- ENDIF --><!-- EVENT forumlist_body_subforum_link_append -->
							<!-- END subforum -->
							</span>
							<!-- EVENT forumlist_body_subforums_after -->
						<!-- ENDIF -->
Then in overall_footer.html, find:

Code: Select all

{$SCRIPTS}
After, add:

Code: Select all

<!-- Indented subforums on forumlist -->
<script>
	if ($(".forabg").length) {

		jQuery.fn.reverse = [].reverse;

		$("a.subforum").reverse().each(function() {
			var subforum_link = $(this).wrap('<span class="subforum_wrapper"/>').parent().html();

			$(this).parents("li.row").after("\
			<li class='row subforum_row'>\
				<dl>\
					<dt>\
						<div class='list-inner'>"+subforum_link+"</div>\
					</dt>\
				</dl>\
			</li>\
			");
		});

		// Cleanup
		$(".subforum_container").hide();

		$(".subforum_row .list-inner").prepend("&angrt;").css({
			'padding-left' : '75px',
			'margin-right' : '0',
		});			

		// Override responsive max-width value on subforums
		$(".subforum_row a").addClass("forumtitle").css({
			'max-width' : '9999px'
		});	

	}
</script>
This will create:
list.png
You can adjust the left padding (indent) by adjusting this line:

Code: Select all

			'padding-left' : '75px',
Anything more advanced will need an extension.
User avatar
Siguza
Registered User
Posts: 315
Joined: Wed Apr 22, 2020 10:59 am
Location: Melbourne, Australia
Contact:

Re: Indenting Sub-Forums and Sub-Sub-Forums

Post by Siguza »

to be honest I think this should maybe be in the core
Formerly known as qcz When replying directly to me please quote me so I get notified. Thanks.

I am now inactive. I might read posts from time to time, however I will very rarely create or reply to a topic.
User avatar
david63
Registered User
Posts: 19067
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Contact:

Re: Indenting Sub-Forums and Sub-Sub-Forums

Post by david63 »

qcz wrote:
Mon Aug 31, 2020 11:49 am
to be honest I think this should maybe be in the core
But only as an option. It is not something that I would want, or use.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored
User avatar
KevC
Support Team Member
Support Team Member
Posts: 70438
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Indenting Sub-Forums and Sub-Sub-Forums

Post by KevC »

It also makes me wonder if the basic set up of the forum is right. If you need sub-sub and sub-sub-sub forums then the navigation becomes really confusing for people and maybe that isn't the right way to be structuring the set up. We do see a lot of people who subdivide forums way too much but it is subject dependant. Or maybe even a forum isn't the right software to be doing it on.
-:|:- Support Request Template -:|:-
Image
Cheap UK Hosting
"In the land of the blind the little green bloke with no pupils is king - init!"
Post Reply

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