News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

SMF 2.1 RC4: Inconsistent markup - board index vs message index.

Started by Antechinus, September 11, 2021, 06:31:57 PM

Previous topic - Next topic

Antechinus

I'm a little hesistant to call this a bug, but it is an inconsistency and (at the minor cost of having to render two more divs sometimes) having the markup consistent would make theming easier in some cases. I know this because I had an idea for presentation, and was trying it out, and... :D

The thing is, in both templates you are usually going to want the same presentation for categories (BoardIndex) and child boards (MessageIndex) but the .boardindex_table class is effectively doing two different jobs in the two templates, and in MessageIndex does not have the other two divs to back it up. This can make non-standard presentation awkward.

Code ("BoardIndex.template markup") Select
<div id="content_section">                                    <!-- Global wrapper div -->
    <div id="main_content_section">                            <!-- Global wrapper div -->
        <div id="boardindex_table" class="boardindex_table">        <!-- Consistent class to here  -->
            <div class="main_container">                        <!-- Wrapper for all of category -->
                <div class="cat_bar " id="category_10">            <!-- Generic category header -->
                    <h3 class="catbg"></h3>
                </div>
                <div id="category_10_boards">                <!-- Wrapper for all boards in category -->
                    <div id="board_31" class="up_contain ">    <!-- Generic board -->

Code ("MessageIndex.template markup") Select
<div id="content_section">                                    <!-- Global wrapper div -->
    <div id="main_content_section">                            <!-- Global wrapper div -->
        <div id="board_20_childboards" class="boardindex_table">    <!-- Consistent class to here  -->
                                                        <!-- NO wrapper for all of category -->
            <div class="cat_bar">                            <!-- Generic category header -->
                <h3 class="catbg"></h3>
            </div>
                                                        <!-- NO wrapper for all boards in category -->
            <div id="board_132" class="up_contain ">            <!-- Generic board -->

The logical way of dealing with it would seem to be this:
Code ("BoardIndex.template proposal") Select
<div id="content_section">                                    <!-- Global wrapper div -->
    <div id="main_content_section">                            <!-- Global wrapper div -->
        <div id="boardindex_table" class="boardindex_table">        <!-- Consistent class to here  -->
            <div class="main_container">                        <!-- Wrapper for all of category -->
                <div class="cat_bar " id="category_10">            <!-- Generic category header -->
                    <h3 class="catbg"></h3>
                </div>
                <div id="category_10_boards" class="category_boards">    <!-- NEW class added -->
                    <div id="board_31" class="up_contain ">            <!-- Generic board -->


Code ("MessageIndex.template proposal") Select
<div id="content_section">                                    <!-- Global wrapper div -->
    <div id="main_content_section">                            <!-- Global wrapper div -->
        <div id="board_20_childboards" class="boardindex_table">    <!-- Consistent class to here  -->
            <div class="main_container">                        <!-- NEW wrapper for all of category -->
                <div class="cat_bar">                        <!-- Generic category header -->
                    <h3 class="catbg"></h3>
                </div>
                <div class="category_boards">                <!-- NEW wrapper for all boards -->
                    <div id="board_132" class="up_contain ">    <!-- Generic board -->

I can't see this causing any issues, and I can see it being useful sometimes. :)

Advertisement: