[TH] Nodes for grid, custom styling, and custom icons

[TH] Nodes for grid, custom styling, and custom icons 1.1.1 Patch Level 1

No permission to download
For those who want to enable node grid styling on specific nodes/categories, I was looking for the same.
I've made some CSS for extra.less that overrules the styling from this mod without affecting the mod itself.
Some things to consider:
1. It'll only affect the categories you add the node class 'default-style' to (in Forums -> Node layout and styling)
2. Set the maximum columns to 1 in Forums -> Node layout and styling -> Default layout and styling -> Grid -> Maximum columns
3. I've set a custom width (46px) for the node icon in order to align things a bit on smaller screens. Could be that you need to adjust it to your node icon.
4. I haven't used background images and I'm using the default style, so you might need some adjustments to make it pixel perfect for your forum. I spent about 15 minutes on this so it might have some flaws.
5. This is hopefully a temporary solution until grids for specific categories will be available.

SCSS:
/* Avoid Themehouse grid styling when default-style is added to category classes*/
.thNodes__nodeList {
    .default-style {
        .node {
            padding: 0;
        }
        .block-header {
            margin-bottom: 0;
        }
        .node-body {
            display: table;
            border: none;
            outline: 1px solid @xf-borderColor;
        }
        .node-stats {
            display: table-cell;
        }
        @media (max-width: 1000px) {
            .node-stats {
                display: none;
            }
        }
        @media (min-width: 1000px) {
            .node-meta {
                display: none;
            }
        }
        @media (max-width: 650px) {
            .node-extra {
                margin-left: 46px; //width of node-icon
            }
        }
    }
    @media (max-width: 650px) {
        .block-container.default-style .node {
            padding-left: 0;
            .node-extra {
                padding-top: 0; 
                width: auto;
            }
        }
    }
}

The result on my forum, with one category as 'default-style' and the other one with the node grid:
Screenshot 2019-10-05 at 12.29.48.png
 
Last edited:
Error while installing Nodes 1.0.7 Patch Level 1

Incorrect integer value: 'LayoutSeparator' for column xf.xf_node_type.node_type_id at row 1 at src/XF/Db/AbstractStatement.php:228

Stack trace

INSERT INTO xf_node_type (node_type_id, entity_identifier, permission_group_id, admin_route, public_route, handler_class) VALUES (?, ?, ?, ?, ?, ?)
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL query err...', 1366, '22007')
#1 src/XF/Db/Mysqli/Statement.php(77): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1366, '22007')
#2 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(218): XF\Db\AbstractAdapter->query('INSERT INTO `x...', Array)
#4 src/XF/Mvc/Entity/Entity.php(1452): XF\Db\AbstractAdapter->insert('xf_node_type', Array, false)
#5 src/XF/Mvc/Entity/Entity.php(1184): XF\Mvc\Entity\Entity->_saveToSource()
#6 src/addons/ThemeHouse/Nodes/Setup.php(70): XF\Mvc\Entity\Entity->save()
#7 src/XF/AddOn/StepRunnerInstallTrait.php(60): ThemeHouse\Nodes\Setup->installStep3(Array)
#8 src/XF/AddOn/StepRunnerInstallTrait.php(27): ThemeHouse\Nodes\Setup->installStepRunner(3, Array)
#9 src/XF/Admin/Controller/AddOn.php(398): ThemeHouse\Nodes\Setup->install(Array)
#10 src/XF/Mvc/Dispatcher.php(350): XF\Admin\Controller\AddOn->actionInstall(Object(XF\Mvc\ParameterBag))
#11 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:AddOn', 'Install', Object(XF\Mvc\RouteMatch), Object(ThemeHouse\InstallAndUpgrade\XF\Admin\Controller\AddOn), NULL)
#12 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(ThemeHouse\InstallAndUpgrade\XF\Admin\Controller\AddOn), NULL)
#13 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#14 src/XF/App.php(2184): XF\Mvc\Dispatcher->run()
#15 src/XF.php(391): XF\App->run()
#16 admin.php(13): XF::runApp('XF\\Admin\\App')
#17 {main}

Request state

array(4) {
["url"] => string(43) "/admin.php?add-ons/ThemeHouse-Nodes/install"
["referrer"] => string(66) "https://my.domain/admin.php?add-ons/ThemeHouse-Nodes/install"
["_GET"] => array(1) {
["add-ons/ThemeHouse-Nodes/install"] => string(0) ""
}
["_POST"] => array(7) {
["_xfProcessing"] => string(1) "1"
["continue"] => string(1) "1"
["confirm"] => string(1) "1"
["params"] => string(2) "[]"
["count"] => string(1) "1"
["finished"] => string(1) "0"
["_xfToken"] => string(8) "****"
}
}
 
Error while installing Nodes 1.0.7 Patch Level 1

Incorrect integer value: 'LayoutSeparator' for column xf.xf_node_type.node_type_id at row 1 at src/XF/Db/AbstractStatement.php:228

Stack trace

INSERT INTO xf_node_type (node_type_id, entity_identifier, permission_group_id, admin_route, public_route, handler_class) VALUES (?, ?, ?, ?, ?, ?)
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL query err...', 1366, '22007')
#1 src/XF/Db/Mysqli/Statement.php(77): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1366, '22007')
#2 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(218): XF\Db\AbstractAdapter->query('INSERT INTO `x...', Array)
#4 src/XF/Mvc/Entity/Entity.php(1452): XF\Db\AbstractAdapter->insert('xf_node_type', Array, false)
#5 src/XF/Mvc/Entity/Entity.php(1184): XF\Mvc\Entity\Entity->_saveToSource()
#6 src/addons/ThemeHouse/Nodes/Setup.php(70): XF\Mvc\Entity\Entity->save()
#7 src/XF/AddOn/StepRunnerInstallTrait.php(60): ThemeHouse\Nodes\Setup->installStep3(Array)
#8 src/XF/AddOn/StepRunnerInstallTrait.php(27): ThemeHouse\Nodes\Setup->installStepRunner(3, Array)
#9 src/XF/Admin/Controller/AddOn.php(398): ThemeHouse\Nodes\Setup->install(Array)
#10 src/XF/Mvc/Dispatcher.php(350): XF\Admin\Controller\AddOn->actionInstall(Object(XF\Mvc\ParameterBag))
#11 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:AddOn', 'Install', Object(XF\Mvc\RouteMatch), Object(ThemeHouse\InstallAndUpgrade\XF\Admin\Controller\AddOn), NULL)
#12 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(ThemeHouse\InstallAndUpgrade\XF\Admin\Controller\AddOn), NULL)
#13 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#14 src/XF/App.php(2184): XF\Mvc\Dispatcher->run()
#15 src/XF.php(391): XF\App->run()
#16 admin.php(13): XF::runApp('XF\\Admin\\App')
#17 {main}

Request state

array(4) {
["url"] => string(43) "/admin.php?add-ons/ThemeHouse-Nodes/install"
["referrer"] => string(66) "https://my.domain/admin.php?add-ons/ThemeHouse-Nodes/install"
["_GET"] => array(1) {
["add-ons/ThemeHouse-Nodes/install"] => string(0) ""
}
["_POST"] => array(7) {
["_xfProcessing"] => string(1) "1"
["continue"] => string(1) "1"
["confirm"] => string(1) "1"
["params"] => string(2) "[]"
["count"] => string(1) "1"
["finished"] => string(1) "0"
["_xfToken"] => string(8) "****"
}
}
Please do create a ticket on this on our support portal so that our developers can take a closer look at this error.
 
For those who want to enable node grid styling on specific nodes/categories, I was looking for the same.
I've made some CSS for extra.less that overrules the styling from this mod without affecting the mod itself.
Some things to consider:
1. It'll only affect the categories you add the node class 'default-style' to (in Forums -> Node layout and styling)
2. Set the maximum columns to 1 in Forums -> Node layout and styling -> Default layout and styling -> Grid -> Maximum columns
3. I've set a custom width (46px) for the node icon in order to align things a bit on smaller screens. Could be that you need to adjust it to your node icon.
4. I haven't used background images and I'm using the default style, so you might need some adjustments to make it pixel perfect for your forum. I spent about 15 minutes on this so it might have some flaws.
5. This is hopefully a temporary solution until grids for specific categories will be available.

SCSS:
/* Avoid Themehouse grid styling when default-style is added to category classes*/
.thNodes__nodeList {
    .default-style {
        .node {
            padding: 0;
        }
        .block-header {
            margin-bottom: 0;
        }
        .node-body {
            display: table;
            border: none;
            outline: 1px solid @xf-borderColor;
        }
        .node-stats {
            display: table-cell;
        }
        @media (max-width: 1000px) {
            .node-stats {
                display: none;
            }
        }
        @media (min-width: 1000px) {
            .node-meta {
                display: none;
            }
        }
        @media (max-width: 650px) {
            .node-extra {
                margin-left: 46px; //width of node-icon
            }
        }
    }
    @media (max-width: 650px) {
        .block-container.default-style .node {
            padding-left: 0;
            .node-extra {
                padding-top: 0;
                width: auto;
            }
        }
    }
}

The result on my forum, with one category as 'default-style' and the other one with the node grid:
View attachment 211588

Good job... sadly it didn't make any difference when I tried this though. I'm using uix theme maybe that's the problem
 
I found there's a Template Modification conflict with XenPorta 2 Featured Threads, when wrapping the forum_list macro with TH classes:

Template: forum_list
Modifcation Key: th_node_list_wrapper_nodes

As XenPorta also wraps the macro and fires at priority 10, the modification fails. Lowering the XenPorta event to 9 or raising TH event to 11 solves the issue. Leaving this note for consideration at both addon pages.
 
Last edited:
Problem is resolved when I disable node icon tweak. I don't want to disable the plug-in
maybe this addon does not add conflicts:


(I suppose it does quite the same job)
 
maybe this addon does not add conflicts:


(I suppose it does quite the same job)
I do not want to change the plugin
 
Top Bottom