Pubblicazione Pagina

:bookmark: Questa guida illustra come utilizzare la funzione di pubblicazione delle pagine su Discourse. Questa funzione consente agli utenti Staff di convertire un argomento in una pagina statica autonoma con stile personalizzato. Esempi includono le pagine Termini di servizio e Informativa sulla privacy.

:person_raising_hand: Livello utente richiesto: Staff

Pubblicazione di pagine statiche su Discourse

La pubblicazione di pagine consente agli utenti Staff di creare pagine statiche autonome a partire da argomenti. Questo è simile al processo per la creazione di pagine Termini di servizio o Informativa sulla privacy.

Sommario

Questa documentazione coprirĂ :

  • Abilitare la pubblicazione delle pagine
  • Pubblicare un argomento come pagina
  • Depubblicare un argomento
  • Problemi comuni e soluzioni
  • FAQ
  • Risorse aggiuntive

Abilitare la pubblicazione delle pagine

  1. Navigare su Admin > Settings.
  2. Attivare l’impostazione enable page publishing.
    Enable Page Publishing

Abilitare la pubblicazione delle pagine quando l’accesso è richiesto

Per consentire la visualizzazione delle pagine pubblicate anche quando un utente non ha effettuato l’accesso:

  1. Attivare l’impostazione show_published_pages_login_required su Admin > Settings.
    Show Published Pages

Pubblicare un argomento

  1. Andare al primo post di un argomento pubblico e selezionare l’icona dei puntini di sospensione (...).
    Ellipsis Menu

  2. Selezionare l’icona della chiave inglese.
    Wrench Icon

  3. Scegliere l’opzione “Page Publishing” (Pubblicazione pagina).

  4. Apparirà una finestra di dialogo modale, che consente di confermare lo slug (che può essere precompilato dal titolo del post) e di visualizzare in anteprima l’URL della pagina pubblicata.

:warning: Per consentire la pubblicazione delle pagine, è necessario disattivare le impostazioni del sito relative agli upload sicuri.

:information_source: Per i siti ospitati, gli upload sicuri sono limitati al piano Enterprise. (secure uploads are limited to the Enterprise plan.)

Argomento pubblicato

Pagina pubblicata

Depubblicare un argomento

  1. Selezionare Publishing Settings (Impostazioni di pubblicazione) sotto la notifica.

  2. Cliccare su Unpublish (Depubblica)

  3. La pagina è stata depubblicata.

Problemi comuni e soluzioni

Impossibile visualizzare le pagine pubblicate quando non si è connessi

Assicurarsi che l’impostazione show_published_pages_login_required sia attiva su Admin > Settings.

Aggiungere un’intestazione di Discourse alle pagine pubblicate

Attualmente, le pagine statiche sono pensate per essere minimali e non includono l’intestazione e il piè di pagina tipici di Discourse.

FAQ

Posso rendere pubblica una pagina FAQ o Informazioni?

È possibile creare un nuovo argomento con il contenuto desiderato e pubblicarlo come pagina. Modificare i link nelle impostazioni del sito per puntare a queste nuove pagine.

Come posso personalizzare l’aspetto di una pagina pubblicata?

Utilizzare la struttura del documento HTML e i corrispondenti selettori CSS per applicare stili personalizzati in Admin > Customize > Themes > CSS.

Risorse aggiuntive

118 Mi Piace
Best landing page solution
ProCourse Static Pages
Using Discourse as a News Blog and Forum - Any Known Good Examples?
How to add a new page into the community? (Login isolated page)
Blog Post Styling
Is anyone here using their Discourse instance as their entire website?
How do I redirect urls or create new ones?
Discourse + CMS, which one?
Is there an upper limit to how many pages can be published?
Host HTML page on Discourse install
Integrating webpage to current forum
Open (anon) interaction with a forum
Shared Drafts: Allow staff to collaborate on posts before publishing
Is there any way to listen User login event using Theme component
How to share only few posts to public as links?
Open (anon) interaction with a forum
Create a "Docs" page like discource meta's
Invite people to reply to a topic without them needing to create an account
Allow anonymous users to view a topic?
What's the usage of "show published pages login required" setting?
How to add contact us page?
Embed my Discourse Forum as IFrame
Is there any way to restrict posting in a topic to members of a group, but allow all users to read the topic?
Order posts by Title
Edit Code
Published page not visible?
Inline Tooltips
Making the About and FAQ visible to anon
Allow published pages to be visible to anon
Customize login page
7 myths why a blog isn't needed in the discourse core
Landing Page
Customizing FAQs and Guidelines
ProCourse Static Pages
Can I use secure media and page publishing simultaneously in Discourse?
Publishing - how deep/good is fine-grained permisson control?
Publish Direct Messages
500 character ‘Reject Reason’ is too small a limit
How do I create a blank page within Discourse
How-to use Discourse for managing a collaborative newsletter?
Customize Login pop-up box?
Building a custom html page in discourse
Page for not-logged in users with a single topic displayed
Duplicate Terms of Service/Privacy Policy
Paid Groups
Help custom page?
Should Discourse make an effort to become the next best "CMS"
Is It Possible to Create Custom Pages in Discourse?
How to Enable Terms of Service and Privacy Policy Pages in Discourse?
Is It Possible to Create Custom Pages in Discourse?
Blank Pages Related Help
How do root level links work?
Creating custom pages like "About" and "FAQ"
Multi-factor authentication enforcement lock in without help
Can you create a custom landing page?
Static pages for things like guidelines?
Create a new text page option?
Change topic visibility in an admin category to public
Create a custom page with theme cli?
DiscoTOC - automatic table of contents
Adding a static web page
[Urgent] privacy policy page
How to make a website with Discourse
Generate static file in discourse
Discourse for Teams is here!
Category Previews
Public Static pages and Private Forums - possible?
Filter view for muted categories
Category Previews
How to hide a single topic from showing up in "latest"?
ProCourse Static Pages
Control the visibility of /faq and /about
[Question/Request] Featured image url for post
Custom Homepage for Groups
Embedding private discussions on a wordpress site
Table of Contents not working on Published Pages

I still need to try this out first hand so the following may not be grounded in reality, but:

It strikes me that this permission model sets up a scenario where you always see two copies of the pages’ content – one in the relevant Discourse category, and one in the published pages themselves. This of course seems duplicative if you’re wanting to publish pages for the general population that is similar to, or identical to, your Discourse user base.

OTOH, if pages had the “world readable” flag available, you could then restrict who can see/edit them to a small group, and the only place the content would be available to other Discourse users would be in the published links themselves.

(I’m thinking of a use case of a “documentation site” here.)

Otherwise, I’m pretty excited to test things out!

8 Mi Piace

Awesome stuff, and thanks again for listening to your users. I love the ‘lets make this better for us all’ vibe that Discourse has! We’ll make heavy use of this.

When discussing one use (patching up an install that went a bit awry), another user pointed out a remaining bit of icing that could do with going on the cake:

Hey, is there any way to include the ability to make /faq and /about public as well, as they are currently hidden in Login Required sites. We can of course use the existing functionality that you’ve just released for /faq by making our own, changing the link in settings, and explicitly linking to it. However, this is not pretty and the existing navigation to it remains hidden. We can’t do that at all for /about of course.

9 Mi Piace

Something that would go nice with this feature is to make publications onebox-compatible such that people could easily share the content.

15 Mi Piace

Please excuse my ignorance, as I am very much a beginner in the HTML/CSS space… however, how would we go about applying our theme colour choices to published pages. At its simplest, I’d like to use the dark background/white text to give the published pages the same darkmode experience as accessing our forums.

Is this already in the product, or do I need to play with HTML/CSS? If the latter, could anyone give me some pointers in the right direction? Thanks!

4 Mi Piace

Can you make this a separate feature request please? This is not related to page publishing, as in I wouldn’t have to change anything related to page publishing to make it possible. I do agree it would be better if all these “static” pages could have more or less the same behaviour, but there are multiple solutions here (do nothing? add site settings? migrate these to page publishing?), so we might want to have a dedicated topic for this.

8 Mi Piace

GTM not loaded on published pages? Would be nice.

2 Mi Piace

Hmm that is a really good point.

Just trying to think of a solution here… would it work if type="text/javascript" and type="text/discourse-plugin" were treated differently? The API needs the latter, right?

5 Mi Piace

Yes I think we already support having a text/javascript in the theme fields, so there are certainly solutions in this area.

7 Mi Piace

That would be great.

1 Mi Piace

So it’s currently impossible to have responsive published pages, and this site particularly wants

  1. images made available when sharing to public media, and
  2. responsive/resizing images displayed, especially on mobile–oh, mobile could just resize the image with CSS–that should work, right?
6 Mi Piace

+1 for having the Discourse header in published pages. I’m missing my website logo, custom header links and beloved hamburger menu :slight_smile:

Another oddity: in posts, my lightboxed images open in a nice popup, whereas in published pages, they open in a new tab…

7 Mi Piace

I think what’s needed is a set of theme components that add such. The last client I had to use this wanted the topic creator removed. I think it’s hard to guess what will meet people’s needs for this!

6 Mi Piace

Are there currently any ongoing efforts for adding “simple” (non-API) Javascript support to published pages? Or should we forget about this near- to mid-term ?

9 Mi Piace

Can i display external non-Discourse JSON on this page? Because we can’t use php code here and discourse strip most of html so i do not know how to do it…

2 Mi Piace

Ho un problema con una pagina pubblicata: il pulsante per copiare il contenuto del blocco di codice non è visibile sulla pagina pubblicata. Screenshot: Screenshot by Lightshot. Muovo il mouse sopra il blocco, ma il pulsante non appare. Quando sono loggato, invece, tutto funziona come al solito.

Qualcuno può replicare il problema? Esiste una soluzione?

2 Mi Piace

Grazie @riking!

Sembra infatti che il text/javascript “normale” venga eseguito sulle pagine pubblicate quando si trova nell’header o nel footer di un componente del tema.

8 Mi Piace

Ehi! Sembra quindi che esista un modo un po’ ‘hacky’ per far funzionare alcuni componenti del tema con la pubblicazione delle pagine.

Sto valutando l’idea di aggiungere un header/footer alle pagine pubblicate, e i componenti del tema sembrano la strada da seguire. Tuttavia, mi sembra poco saggio implementare qualcosa che potrebbe rompersi nel prossimo futuro.

@riking, sembra che il tipo text/javascript nell’header o nel footer che funziona sulle pagine pubblicate fosse involontario. Intendete correggerlo o utilizzarlo per estendere le pagine pubblicate?

@syl, l’autore di DiscPage, ha menzionato la possibilità di riimplementare il plugin DiscPage utilizzando le funzionalità di Page Publishing. È ancora un’ipotesi che avete in mente, @syl? Secondo voi, qual è la strada di minor resistenza per integrare entrambe le funzionalità, @riking?

7 Mi Piace

Purtroppo, la funzionalità “Page Publishing” non soddisfa le mie esigenze. Per poterla utilizzare, avrei bisogno che le pagine pubblicate:

  1. vengano visualizzate all’interno del layout normale di Discourse, cioè con l’intestazione standard di Discourse (proprio come i Termini di servizio e l’Informativa sulla privacy), e
  2. vengano renderizzate come normali argomenti (decorati), ovvero supportando bbcode e plugin.
15 Mi Piace

Nel frattempo ho utilizzato lo strumento di personalizzazione predefinito di Discourse:

  1. Identificare l’elemento aggiunto, ad esempio con una classe CSS published-page-footer-links.
  2. Personalizzare il CSS per nascondere questo elemento per impostazione predefinita e mostrarlo solo per le pagine pubblicate
  3. Aggiungere l’elemento nello spazio Footer

2. In CSS, aggiungere:

/* Mostra i link nel piè di pagina solo nelle pagine pubblicate */
.published-page-footer-links { display: none; }
.published-page .published-page-footer-links { display: block;}

3. In Footer, aggiungere:

<nav class="published-page-footer-links">
Ciao! Questo è il piè di pagina per le pagine pubblicate!
</nav>
8 Mi Piace