Page Publishing

Un’alternativa al Page Publishing: un altro metodo consiste nell’utilizzare i CSS per rimuovere gli elementi indesiderati da un normale Topic Post, preservando al contempo tutte le funzionalità (ad esempio, Javascript nei componenti del tema installati, stile CSS, ecc.)

I tag nell’editor possono essere utilizzati per applicare selettivamente la formattazione a un Topic Post specifico.

Ad esempio, sul mio sito ottengo questo incollando i seguenti CSS nel CSS del mio tema nella scheda Common:

/********************** RIMUOVERE ELEMENTI DAL LAYOUT UTILIZZANDO I TAG *************** /

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

Quindi creo dei Tag che posso applicare selettivamente ai Topic Post, corrispondenti ai selettori CSS nel codice sopra…

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


Quindi ecco le due diverse versioni dello stesso Topic Post…

Prima (nessun Tag applicato):

Dopo (tutti i Tag applicati) - che posso anche incorporare come iFrame in altri Post sul mio sito :nerd_face::

24 Mi Piace