Skip to content

[3.0] Theme split (wave 4, part 23) — give the two indexes one copy of the board list loop - #9451

Merged
live627 merged 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/theme-shared-board-list
Aug 10, 2026
Merged

[3.0] Theme split (wave 4, part 23) — give the two indexes one copy of the board list loop#9451
live627 merged 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/theme-shared-board-list

Conversation

@albertlast

Copy link
Copy Markdown
Collaborator

Description

BoardIndex.template.php and MessageIndex.template.php each carried their own copy of the loop that draws a list of boards — the one calling the template_bi_* helpers for the icon, info, stats, last post and children.

The two were identical. 32 lines apiece, and once leading whitespace is ignored the only difference is the array they walk:

$ diff -w bi_loop.txt mi_loop.txt
1c1
< 		foreach ($category['boards'] as $board) {
---
> 		foreach (Utils::$context['boards'] as $board) {

It becomes template_bi_board_list(), living beside the helpers it calls. MessageIndex::setupTemplate() already loads BoardIndex for those helpers, so there is nothing new to load. #9403 shared the helpers; this shares the loop that calls them.

Markup is untouched

The theme branch renames these classes on the way past — up_containboard_container, infoboard_info, lastpostboard_lastpost — and wraps the whole thing differently. That needs its index.css slice to come with it, so this keeps exactly what is on release-3.0 today and moves nothing but the loop.

Verification

Rendered output of the board index (#boardindex_table) and of the child board list on a board that has children (?board=1.0), captured before and after and compared as normalised HTML:

region result
#boardindex_table identical, 1639 chars
#board_1_childboards identical, 647 chars

Whitespace is collapsed for that comparison, because the two copies indented their output differently and the shared one has to pick a single indentation. The DOM is the same; only the literal indentation inside the message index's copy shifts.

The template_bi_redirect_* branch is moved verbatim but not exercised — there is no redirect board on the test install.

Issues References (Fixes|Related|Closes)

Related: #9403, #7933

@jdarwood007 jdarwood007 added this to the 3.0 Alpha 5 milestone Aug 9, 2026
BoardIndex.template.php and MessageIndex.template.php each carried their own
copy of the loop that draws a list of boards - the one calling the
template_bi_* helpers for the icon, info, stats, last post and children. The
two were identical, 32 lines apiece, differing only in the array they walked
and in how deeply the emitted HTML was indented.

It becomes template_bi_board_list(), living beside the helpers it calls.
MessageIndex already loads BoardIndex for those helpers, so there is nothing
new to load; SimpleMachines#9403 shared the helpers, this shares the loop that calls them.

Markup is untouched. The theme branch renames these classes - up_contain to
board_container, info to board_info, lastpost to board_lastpost - but that
needs its index.css slice to come with it, so this keeps what is there.

Board index and the child board list on a board with children both render
identically, compared as normalised HTML.

Signed-off-by: Mathias Albert <mathiaspapealbert@hotmail.com>
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
@albertlast
albertlast force-pushed the 3.0/theme-shared-board-list branch from 1faa2a6 to fffe000 Compare August 9, 2026 14:56
@albertlast albertlast mentioned this pull request Aug 9, 2026
@live627
live627 merged commit e29c7ce into SimpleMachines:release-3.0 Aug 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants