lat9 / ZCA-Bootstrap-Template

A Bootstrap-4 template for Zen Cart versions 1.5.8 through 2.1.0. Forked from https://github.com/zcadditions/ZCA-Bootstrap-Template-for-1.5.6-v2.0.0c. See the demo site, below, for additional information.
https://zc158.vinosdefrutastropicales.com/zc158/index.php?main_page=index
GNU General Public License v3.0
4 stars 14 forks source link

make parameters more consistent... #189

Open proseLA opened 1 year ago

proseLA commented 1 year ago

i'm not a fan of including the space here in the params key of the array:

# grepp params.....\'.class includes/modules/bootstrap/
includes/modules/bootstrap/centerboxes/new_products.php:87:            'params' => ' class="centerBoxContentsNew centerBoxContents card mb-3 p-3 text-center"',
includes/modules/bootstrap/centerboxes/specials_index.php:93:            'params' => ' class="centerBoxContentsSpecials centerBoxContents card mb-3 p-3 text-center"',
includes/modules/bootstrap/centerboxes/featured_products.php:87:            'params' => ' class="centerBoxContentsFeatured centerBoxContents card mb-3 p-3 text-center"',

these are the only 3 places where it is done.

i think it should be done in the writing out of the html similar to other elements.

in addition, these lines here: https://github.com/lat9/ZCA-Bootstrap-Template/blob/d61074344d1c2c6d4b7bb2ea3111f4a5a57a2ed4/includes/templates/bootstrap/common/tpl_columnar_display.php#L46-L50

might be improved to:

        if (isset($col['text'])) {
            echo '<div ' . $col['params'] ?? '' . '>' . $col['text'] .  '</div>';
        }

whether $col['params'] needs to be cast to a string, i have not investigated, but i think it should be unnecessary as well.

lat9 commented 1 year ago

The issue, IMO, in what you've proposed is that you'd wind up with a <div > tag, noting the extra, invalid, space after div if the parameters were empty.

proseLA commented 1 year ago

just re-looking at this for the fun of it. what makes you think the space after <div > is invalid html?

i looked at the validator here, and this code validated fine:

<!doctype html>
<html dir="ltr" lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Admin:  Index</title>
    <link rel="stylesheet" href="includes/css/bootstrap.min.css">
    <link rel="stylesheet" href="includes/css/font-awesome.min.css">
</head>
<body >
<div >
    <div >
        <i class="fa fa-2x fa-info-circle"></i> WARNING: ALL emails will be sent to projects@mxworks.cc (as defined in &quot;DEVELOPER_OVERRIDE_EMAIL_ADDRESS&quot;).
    </div >
</div>
</body>
</html>