Quantcast
Channel: phpBB.com
Viewing all articles
Browse latest Browse all 1676

phpBB Custom Coding • UCP menu logic issue.

$
0
0
I'm in the process of revamping the default MCP and UCP menus (ie: #tabs and #navigation) into a more cohesive whole. IMO a simple sidebar is cleaner and more versatile than the default setup: easier to find things at a glance, and can easily be turned into a flyout/overlay/accordion/whatever on smaller screens.

So, this is no issue for the MCP. I already have that working. Code is this:

Code:

<div id="cp-menu" class="cp-menu"><div id="navigation" class="navigation" role="navigation"><ul><!-- BEGIN l_block1 --><li<!-- IF l_block1.S_SELECTED -->  class="activetab"<!-- ENDIF -->><a href="{l_block1.U_TITLE}" class="button">{l_block1.L_TITLE}</a><ul><!-- BEGIN l_block2 --><li<!-- IF l_block1.l_block2.S_SELECTED --> id="active-subsection" class="active-subsection"<!-- ENDIF -->><a href="{l_block1.l_block2.U_TITLE}"><span>{l_block1.l_block2.L_TITLE}<!-- IF l_block1.l_block2.ADD_ITEM --> ({l_block1.l_block2.ADD_ITEM})<!-- ENDIF --></span></a></li><!-- END l_block2 --></ul></li><!-- END l_block1 --></ul></div></div>

And it looks like this:
Menu_MCP_working.jpg

The UCP menu is not being so co-operative, and I have not been able to figure out why. Code is this (taking the simplest case of not S_PRIVMSGS):

Code:

<div id="cp-menu" class="cp-menu"><div id="navigation" class="navigation" role="navigation"><ul id="t_block1"><!-- BEGIN t_block1 --><li<!-- IF t_block1.S_SELECTED --> class="activetab"<!-- ENDIF -->><a href="{t_block1.U_TITLE}" class="button">{t_block1.L_TITLE}</a><!-- IF S_PRIVMSGS --><!-- ENDIF --><ul class="t_block2"><!-- BEGIN t_block2 --><!-- IF (S_PRIVMSGS and t_block2.S_LAST_ROW) or not S_PRIVMSGS --><!-- IF t_block2.S_SELECTED --><li id="active-subsection" class="active-subsection"><a href="{t_block2.U_TITLE}">{t_block2.L_TITLE}</a></li><!-- ELSE --><li><a href="{t_block2.U_TITLE}">{t_block2.L_TITLE}</a></li><!-- ENDIF --><!-- ENDIF --><!-- END t_block2 --></ul></li><!-- END t_block1 --></ul></div>

The result looks like this:
Menu_UCP_borked.jpg

Essentially what is happening is that anything within <!-- BEGIN t_block2 --> <!-- END t_block2 --> is not being echoed to the browser (this also applies within the PM sections). Do note that the logic there is exactly the same as default. I have changed the indentation to make things clearer, but nothing else. It's all default code.

This currently has me stumped, because the whole kaboodle is set up the same way as the revamped MCP menu, which works perfectly. <!-- BEGIN l_block2 --> <!-- END l_block2 --> causes no issues for the MCP menu, but for some reason <!-- BEGIN t_block2 --> <!-- END t_block2 --> is not working in the UCP menu.

Any ideas?

Statistics: Posted by Gumboots — Sun Sep 15, 2024 1:00 am



Viewing all articles
Browse latest Browse all 1676

Trending Articles