Publicación de página

:bookmark: Esta guía cubre cómo usar la función de Publicación de Páginas (Page Publishing) en Discourse. Esta función permite a los usuarios del Staff convertir un tema en una página estática independiente con un estilo personalizado. Ejemplos incluyen las páginas de Términos de Servicio y Política de Privacidad.

:person_raising_hand: Nivel de usuario requerido: Staff

Publicación de páginas estáticas en Discourse

La Publicación de Páginas permite a los usuarios del Staff crear páginas estáticas independientes a partir de temas. Esto es similar al proceso para crear páginas de Términos de Servicio o Política de Privacidad.

Resumen

Esta documentación cubrirá:

  • Habilitar la Publicación de Páginas
  • Publicar un tema como página
  • Despublicar un tema
  • Problemas comunes y soluciones
  • Preguntas frecuentes (FAQs)
  • Recursos adicionales

Habilitar la Publicación de Páginas

  1. Navega a Admin > Settings (Ajustes).
  2. Activa la configuración enable page publishing (habilitar publicación de páginas).
    Enable Page Publishing

Habilitar la publicación de páginas cuando se requiere iniciar sesión

Para permitir que las páginas publicadas sean visibles incluso cuando un usuario no ha iniciado sesión:

  1. Activa la configuración show_published_pages_login_required en Admin > Settings (Ajustes).
    Show Published Pages

Publicar un Tema

  1. Ve a la primera publicación de un tema público y selecciona el icono de elipsis (...).
    Ellipsis Menu

  2. Selecciona el icono de llave inglesa.
    Wrench Icon

  3. Elige la opción “Page Publishing” (Publicación de Páginas).

  4. Aparecerá un cuadro de diálogo modal, que te permitirá confirmar el slug (que se puede rellenar previamente con el título de la publicación) y previsualizar la URL de la página publicada.

:warning: Para permitir la publicación de páginas, es necesario desactivar la configuración del sitio secure upload.

:information_source: Para sitios alojados, las cargas seguras están limitadas al plan Enterprise.

Tema Publicado

Página Publicada

Despublicar un Tema

  1. Selecciona Publishing Settings (Configuración de Publicación) debajo del aviso.

  2. Haz clic en Unpublish (Despublicar)

  3. El tema se despublica.

Problemas comunes y soluciones

No se pueden ver las páginas publicadas al cerrar sesión

Asegúrate de que la configuración show_published_pages_login_required esté activada en Admin > Settings (Ajustes).

Añadir una cabecera de Discourse a las páginas publicadas

Actualmente, las páginas estáticas están pensadas para ser mínimas y no incluyen la cabecera y el pie de página típicos de Discourse.

Preguntas frecuentes (FAQs)

¿Puedo hacer pública una página de Preguntas Frecuentes o Acerca de?

Puedes crear un tema nuevo con el contenido deseado y publicarlo como una página. Cambia los enlaces en la configuración del sitio para que apunten a estas nuevas páginas.

¿Cómo puedo personalizar la apariencia de una página publicada?

Utiliza la estructura del documento HTML y los selectores CSS correspondientes para aplicar estilos personalizados en Admin > Customize (Personalizar) > Themes (Temas) > CSS.

Recursos adicionales

118 Me gusta
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?
Open (anon) interaction with a forum
Discourse + CMS, which one?
Integrating webpage to current forum
Is there an upper limit to how many pages can be published?
Host HTML page on Discourse install
How do I redirect urls or create new ones?
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
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
Static pages for things like guidelines?
Can you create a custom landing page?
Can I use secure media and page publishing simultaneously in Discourse?
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 Me gusta

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 Me gusta

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

15 Me gusta

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 Me gusta

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 Me gusta

GTM not loaded on published pages? Would be nice.

2 Me gusta

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 Me gusta

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

7 Me gusta

That would be great.

1 me gusta

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 Me gusta

+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 Me gusta

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 Me gusta

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 Me gusta

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 Me gusta

I have a problem with a published page - the button to copy the content of the code block is not visible on a published page. Screenshot: Screenshot by Lightshot. I move the mouse over the block, but the button doesn’t appear. When logged in - everything works as usual - ok.

Can anybody repeat the problem? Any solution?

2 Me gusta

Thank you @riking !

It indeed seems that “regular” text/javascript is executing on published pages when it’s in the header or footer of a theme component.

8 Me gusta

Ha! So it seems that there’s a hacky way to make some theme components work with page publishing.

I’m looking into adding some header/footer to the published pages, and theme components seem to be the way to go. But it seems bad to go on and implement something that would potentially break in the near future.

@riking, it looks like the text/javacript type in header or footer working on published pages was unintented. Is it going to be fixed or used to extend published pages?

@syl, author of DiscPage, mentioned the possibility to re-implement the DiscPage plugin using Page Publishing functionality. Do you still have this in mind, @syl? What do you think would be the path of least resistance to integrate both functionality @riking?

7 Me gusta

Unfortunately, the “Page Publishing” feature doesn’t meet my needs. For me to use it, I would need published pages:

  1. to be displayed within the normal Discourse layout, i.e. with the standard Discourse header (just like the Terms of Service and the Privacy Policy), and
  2. to be rendered like normal (decorated) topics, i.e. supporting bbcode and plugins.
15 Me gusta

In the meantime I used the default Discourse customization facility:

  1. Identify the added element, e.g., with a published-page-footer-links CSS class.
  2. Customize CSS to hide this element by default and show it only for published pages
  3. Add the element in the Footer space

2. In CSS, add:

/* Only show footer links on published pages */
.published-page-footer-links { display: none; }
.published-page .published-page-footer-links { display: block;}

3. in Footer, add:

<nav class="published-page-footer-links">
Hi there! This is the footer for published pages!
</nav>
8 Me gusta