Page Publishing

Eine Alternative zur Seitenveröffentlichung – eine weitere Methode besteht darin, CSS zu verwenden, um unerwünschte Elemente in einem regulären Thema-Beitrag zu entfernen, während die gesamte Funktionalität (d. h. Javascripts in installierten Theme-Komponenten und CSS-Styling usw.) erhalten bleibt.

Tags im Komponisten können verwendet werden, um eine bestimmte Formatierung selektiv auf einen bestimmten Thema-Beitrag anzuwenden.

Auf meiner Website erreiche ich dies beispielsweise, indem ich das folgende CSS in das CSS meines Themas im Tab Common einfüge:

/********************** DINGE AUS DEM LAYOUT MIT TAGS ENTFERNEN *************** /

.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;
    }
}

Dann erstelle ich Tags, die ich selektiv auf Thema-Beiträge anwenden kann und die den CSS-Selektoren im obigen Code entsprechen…

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


Hier sind also die beiden verschiedenen Versionen desselben Thema-Beitrags…

Vorher (keine Tags angewendet):

Nachher (alle Tags angewendet) – was ich auch als iFrame in andere Beiträge auf meiner Website einbetten kann :nerd_face::

24 „Gefällt mir“