Page Publishing

An alternative to Page Publishing - another method is to use CSS to remove the unwanted elements on a regular Topic Post, while preserving all of the functionality (i.e. Javascripts in installed Theme Components, and CSS styling, etc.)

Tags in the composer can be used to selectively apply formatting to a specific Topic Post.

For example, on my site I achieve this by pasting the following CSS into my theme’s CSS in the Common tab:

/********************** REMOVE THINGS FROM LAYOUT USING TAGS ***************/

.tag-no-header {
    .d-header {
        display: none !important;
    }
    #post_1 nav.post-controls .actions button.edit {
    top: 0px !important;
    }
    .topic-body h1 {
        padding-top: 0 !important;
    }
}

.tag-no-sidebars {
    aside.sidebar {
        display: none !important;
    }
}

.tag-no-category {
    .topic-category {
        display: none !important;
    }
}

.tag-no-timeline {
    .topic-navigation {
        display:none !important;
    }
    .container.posts {
        grid-template-columns: 100% !important;
    }
    .topic-body {
    width: 100% !important;
    }
}

.tag-no-post-links {
    .post-links-container {
        display:none !important;
    }
}

.tag-no-box-shadow {
    .topic-body {
        width: 100% !important;
        border-top: none !important;
        box-shadow: none !important;
        background-color: unset !important;
    }
}

.tag-no-topic-meta-data {
    .topic-meta-data {
        display:none !important;
    }
}

.tag-no-side-margins {
    .wrap {
        max-width: unset !important;
        padding: 0 10px !important;
    }
    .content-wrapper {
        display: block !important;
    }
    #main-outlet-wrapper {
        width: 100% !important;
    }
    .topic-body {
        width: 100% !important;
    }
}

.tag-no-footer-buttons {
    #topic-footer-buttons {
        display: none !important;
    }
}

Then I create Tags that I can selectively apply to Topic Posts, matching the CSS selectors in the code above…

no-header
no-sidebars
no-category
no-timeline
no-post-links
no-box-shadow
no-topic-meta-data
no-side-margins
no-footer-buttons


So here are the two different versions of the same Topic Post…

Before (no Tags applied):

After (All Tags applied) - which I can also embed as an iFrame into other Posts on my site :nerd_face::

22 Likes