Page Publishing

ページ公開の代替手段として、CSSを使用して通常のトピック投稿の不要な要素を削除し、すべての機能(インストールされているテーマコンポーネントのJavaScript、CSSスタイルなど)を維持するという別の方法があります。

コンポーザのタグを使用して、特定のトピック投稿にフォーマットを選択的に適用できます。

たとえば、私のサイトでは、テーマのCSSの共通タブに次のCSSを貼り付けることでこれを実現しています。

/********************** タグを使用してレイアウトから要素を削除 *************** /

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

その後、上記のコードのCSSセレクターに一致するタグを作成し、トピック投稿に選択的に適用できます…

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


そして、ここに同じトピック投稿の2つの異なるバージョンがあります…

適用前(タグなし):

適用後(すべてのタグを適用)- これはサイトの他の投稿にiframeとして埋め込むこともできます:nerd_face::

「いいね!」 24