mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-05 13:16:40 +02:00
feat: add template name to body class
allows styling pages based on template ie .template-groups-details add allowCoverPicture to all profile routes
This commit is contained in:
@@ -42,6 +42,10 @@ helpers.buildBodyClass = function (req, res, templateData = {}) {
|
||||
parts[index] = index ? `${parts[0]}-${p}` : `page-${p || 'home'}`;
|
||||
});
|
||||
|
||||
if (templateData.template) {
|
||||
parts.push(`template-${templateData.template.name.split('/').join('-')}`);
|
||||
}
|
||||
|
||||
if (templateData.template && templateData.template.topic) {
|
||||
parts.push(`page-topic-category-${templateData.category.cid}`);
|
||||
parts.push(`page-topic-category-${slugify(templateData.category.name)}`);
|
||||
|
||||
Reference in New Issue
Block a user