Category and forum list problem

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
halil16
Registered User
Posts: 1448
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil

Category and forum list problem

Post by halil16 »

Hello all,

I wanted to place the category and forum list in phpBB's default dropdown. But for some reason it doesn't work. I tried different methods but I couldn't find the exact problem.

This was done on a test board with 1 forum and 2 categories in the main directory. A forum without a category appears, but <li> content does not appear in the categories. Normally, forums in that category should be listed.

Code: Select all


<div class="cat2list12024">
    <div class="ctapps">
        <!-- BEGIN forumrow -->
        <!-- IF forumrow.S_IS_CAT or forumrow.S_FIRST_ROW  or forumrow.S_NO_CAT  -->
        <div class="dropdown-container cat-{forumrow.FORUM_ID}">
            <a href="#" class="cappclink dropdown-trigger"><!-- IF forumrow.S_IS_CAT --><span class="cappsimg">{% if forumrow.FORUM_IMAGE %}{forumrow.FORUM_IMAGE}{% else %}<img src="./images/123.svg" alt="{forumrow.FORUM_NAME}">{% endif %}</span><span class="cappforumname">{forumrow.FORUM_NAME}</span><!-- ELSE --><span class="cappsimg"><img src="./images/123.svg" alt="{L_FORUM}"></span><span class="cappforumname">{L_FORUM}</span><!-- ENDIF --></a>
            <div class="dropdown">
                <ul class="dropdown-contents">
                    <!-- IF not forumrow.S_IS_CAT -->
                    <li class="r0w<!-- IF forumrow.S_ROW_COUNT is even --> bg1<!-- ELSE --> bg2<!-- ENDIF --> frm-{forumrow.FORUM_ID}">
                        <a href="{forumrow.U_VIEWFORUM}" class="capps-item{% if forumrow.S_UNREAD_FORUM %} unread{% else %} read{% endif %}" title="{% if forumrow.S_IS_LINK %}{{ lang('FORUM_LINK') }}{% else %}{{ forumrow.FORUM_FOLDER_IMG_ALT }}{% endif %}">
                            <span class="caappforumicon">   </span>
                            <span class="cappsfrmnm2">{forumrow.FORUM_NAME}</span>
                            
                        </a>
                    </li>
                    <!-- ENDIF -->
                </ul>
            </div>
        </div>
        <!-- ENDIF -->
        <!-- BEGINELSE -->
        	{L_NO_FORUMS}
        <!-- END forumrow -->
    </div>
</div>

What did I miss?
Buy me a coffee ☕
Hire me for your phpBB board. 🚩
Introducing Mobile Upgrade! *Make your phpBB board like an app! 📱
O BeldeThatTowns*for sale*$2250 🛒
"The day we'll need ideas more than possessions, we'll find the secret to true wealth." - Peyami Safa /peˈjɑːmi saˈfɑː/
User avatar
halil16
Registered User
Posts: 1448
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil

Re: Category and forum list problem

Post by halil16 »

I can also do what I want to do with an alternative method. But I'm curious about the problem here.
Buy me a coffee ☕
Hire me for your phpBB board. 🚩
Introducing Mobile Upgrade! *Make your phpBB board like an app! 📱
O BeldeThatTowns*for sale*$2250 🛒
"The day we'll need ideas more than possessions, we'll find the secret to true wealth." - Peyami Safa /peˈjɑːmi saˈfɑː/
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6423
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: Category and forum list problem

Post by thecoalman »

Can't you just reuse or adapt the jumpbox?
“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
halil16
Registered User
Posts: 1448
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil

Re: Category and forum list problem

Post by halil16 »

But then with one click they will all appear in the same menu. It's like the iOS apps I want to make. When you long click on the applications, the menu opens in iOS. When you click on the icon here, the forum list will open.

As far as I can see, the problem is that this code does not close correctly on the html.
<!-- IF forumrow.S_IS_CAT or forumrow.S_FIRST_ROW or forumrow.S_NO_CAT -->

Maybe I should redo it with a different html structure and additional JS.
Buy me a coffee ☕
Hire me for your phpBB board. 🚩
Introducing Mobile Upgrade! *Make your phpBB board like an app! 📱
O BeldeThatTowns*for sale*$2250 🛒
"The day we'll need ideas more than possessions, we'll find the secret to true wealth." - Peyami Safa /peˈjɑːmi saˈfɑː/
User avatar
GanstaZ
Registered User
Posts: 1221
Joined: Wed Oct 11, 2017 10:29 pm
Location: GZOverse

Re: Category and forum list problem

Post by GanstaZ »

halil16 wrote: Tue Sep 24, 2024 3:23 am <li class="r0w<!-- IF forumrow.S_ROW_COUNT is even --> bg1<!-- ELSE --> bg2<!-- ENDIF --> frm-{forumrow.FORUM_ID}">
Should it be r0w or row?
Last edited by GanstaZ on Tue Sep 24, 2024 12:13 pm, edited 1 time in total.
Usus est magister optimus! phpBB pre-Triton & latest php environment.
When answer lies in the question, question becomes redundant!
User avatar
Mannix_
Registered User
Posts: 2028
Joined: Sun Oct 25, 2015 2:56 pm
Name: Matt

Re: Category and forum list problem

Post by Mannix_ »

You realize this will only work on index page right?

To add to coalman's post there is already extension that puts jumpbox on the index page.

But this code should work

Code: Select all

<div class="dropdown-container">
	<span title="" class="button button-secondary dropdown-trigger">TEST</span>
	<div  class="dropdown dropdown-extended">
		<div class="pointer"><div class="pointer-inner"></div></div>
		<div class="dropdown-contents">
		<!-- BEGIN forumrow -->
			<!-- IF forumrow.S_IS_CAT or forumrow.S_FIRST_ROW  or forumrow.S_NO_CAT  -->
				<!-- IF forumrow.S_IS_CAT --><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a><!-- ELSE -->{L_FORUM}<!-- ENDIF -->
			<!-- ENDIF -->
			<!-- IF not forumrow.S_IS_CAT -->
				<a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a>
			<!-- ENDIF -->					
		<!-- END forumrow -->
		</div>
	</div>
</div>
Screenshot 2024-09-24 at 12-59-19 Index page.png
You do not have the required permissions to view the files attached to this post.
Did I helped You? Consider a donation.
New version of phpBB has been released? My styles aren't validated for it yet? Check my page for the latest downloads!
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6423
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: Category and forum list problem

Post by thecoalman »

halil16 wrote: Tue Sep 24, 2024 10:11 am But then with one click they will all appear in the same menu. It's like the iOS apps I want to make. When you long click on the applications, the menu opens in iOS. When you click on the icon here, the forum list will open.
You are looking for collapsible forums? There is official extension for that.It's in uses here, go to index page and and click the minus icon on left hand side of forum heading.

https://www.phpbb.com/customise/db/exte ... ategories/
“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
halil16
Registered User
Posts: 1448
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil

Re: Category and forum list problem

Post by halil16 »

No. Let me show the code in action, my draft:

appsforumtaslak.jpg

As I said, the others don't have <li>.
You do not have the required permissions to view the files attached to this post.
Buy me a coffee ☕
Hire me for your phpBB board. 🚩
Introducing Mobile Upgrade! *Make your phpBB board like an app! 📱
O BeldeThatTowns*for sale*$2250 🛒
"The day we'll need ideas more than possessions, we'll find the secret to true wealth." - Peyami Safa /peˈjɑːmi saˈfɑː/
User avatar
halil16
Registered User
Posts: 1448
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil

Re: Category and forum list problem

Post by halil16 »

I understood now. This method inspired by forumlist, lists the forums in just one section. This is why it doesn't work. I guess what I should do is let it create a list and...

Maybe. I'm not sure.
Buy me a coffee ☕
Hire me for your phpBB board. 🚩
Introducing Mobile Upgrade! *Make your phpBB board like an app! 📱
O BeldeThatTowns*for sale*$2250 🛒
"The day we'll need ideas more than possessions, we'll find the secret to true wealth." - Peyami Safa /peˈjɑːmi saˈfɑː/
User avatar
halil16
Registered User
Posts: 1448
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil

Re: Category and forum list problem

Post by halil16 »

I did it. The code below should not be ignored.

Code: Select all

	<!-- IF (forumrow.S_IS_CAT and not forumrow.S_FIRST_ROW) or forumrow.S_NO_CAT  -->
			</ul>

			</div>
		</div>
	<!-- ENDIF -->
Buy me a coffee ☕
Hire me for your phpBB board. 🚩
Introducing Mobile Upgrade! *Make your phpBB board like an app! 📱
O BeldeThatTowns*for sale*$2250 🛒
"The day we'll need ideas more than possessions, we'll find the secret to true wealth." - Peyami Safa /peˈjɑːmi saˈfɑː/

Return to “phpBB Custom Coding”