Para criar navegação de Tópico para Tópico (e inserir automaticamente botões Voltar/Anterior e Avançar/Próximo em cada Tópico da sequência), estou fazendo desta forma…
Estou reutilizando o “Responder como Tópico Vinculado” e depois estilizando os links com CSS da seguinte forma…
E adicionando algum CSS nas Configurações do Tema…
CSS MÍNIMO APENAS PARA OS BOTÕES
.post-links-container {
margin-left: var(--topic-body-width-padding);
position: absolute;
top: 37px;
right: 30px;
}
.post-links-container ul li .d-icon {
display: none;
}
.post-links-container .post-links {
margin-top: 0;
padding-top: 0;
border-top: 0;
}
.post-links-container .post-links li:last-of-type {
margin-bottom: 0;
}
.post-links-container ul li a[href] {
align-items: center;
border: 1px solid var(--primary-low-mid);
background: var(--primary-very-low);
border-bottom-width: 2px;
border-radius: 3px;
box-sizing: border-box;
color: #009a49;
display: inline-flex;
font-family: monospace, monospace;
font-size: var(--font-down-1);
justify-content: center;
line-height: var(--line-height-large);
margin: 0 0.15em;
min-width: 24px;
padding: 0.15em 0.6em;
}
.post-links-container ul li a::after {
content: " ->>";
padding-left: 0.15em;
}
kbd {
align-items: center;
border: 1px solid var(--primary-low-mid);
background: var(--primary-very-low);
border-bottom-width: 2px;
border-radius: 3px;
box-sizing: border-box;
color: var(--primary);
display: inline-flex;
font-family: monospace, monospace;
font-size: var(--font-down-1);
justify-content: center;
line-height: var(--line-height-large);
margin: 0 0.15em;
min-width: 24px;
padding: 0.15em 0.6em;
}
kbd a {
padding: 0;
}
kbd a::before {
content: "<<-";
padding-right: 0.15em;
}
INSTRUÇÕES E O CSS COMPLETO QUE ESTOU USANDO
/** Botões Anterior e Próximo para Livros ou outras Sequências de Tópicos - este recurso é construído reutilizando **/**
/** a seleção nativa do Discourse "Responder como Tópico Vinculado" no compositor (canto superior esquerdo). **/**
/** PARA CONFIGURAR ISSO NO SEU DISCOURSE **/**
/** Cole <kbd>%{postLink}</kbd> em /admin/customize/site_texts/js.post.continue_discussion. **/**
/** Em seguida, crie 2 categorias: LIVROS (para sequências de tópicos no estilo Blog) e HISTÓRIAS (para sequências de tópicos no estilo Tópico Regular). **/**
/** Instale o componente de tema https://meta.discourse.org/t/blog-post-styling/110841 **/**
/** Nas Configurações do Componente de Tema de Estilo de Postagem de Blog, atribua a Categoria LIVROS (mas não HISTÓRIAS) como uma Categoria de Blog. **/**
/** Em seguida, crie uma tag: LIVRO e atribua-a como uma Tag de Blog nas Configurações do Componente de Tema de Estilo de Postagem de Blog. **/**
/** Em seguida, não se esqueça de colar o CSS abaixo! Ele vai no Cabeçalho do seu Tema. **/**
/** Claro que o CSS aqui precisará de ajustes para funcionar corretamente em outros temas. **/**
/** Agora você pode criar sequências de Tópicos na Categoria HISTÓRIAS que terão os botões de navegação, **/**
/** mas esses Tópicos aparecerão de outra forma no Estilo de Tópico Regular). **/**
/** Se você puder adicionar o Estilo de Blog a esses Tópicos da Categoria HISTÓRIAS simplesmente adicionando a tag LIVRO. **/**
/** Um novo Tópico que você compuser na CATEGORIA LIVROS usando "Responder como Tópico Vinculado" já terá os botões de navegação **/**
/** bem como o Estilo de Blog. **/**
/** Veja uma demonstração em https://meta.discourse.org/t/is-pagination-impossible-or-just-hard/231838/16 **/**
.tag-book,
.category-books {
aside.sidebar,
.topic-meta-data,
.tag-book .topic-category .badge-wrapper,
.category-books .topic-category .badge-wrapper {
display:none !important;
}
}
.tag-book .container.posts,
.category-books .container.posts {
justify-content: unset;
justify-items: unset;
padding-left: 0;
display: block;
}
.tag-book .container.posts .topic-post .row,
.category-books .container.posts .topic-post .row {
display: block;
justify-content: center;
}
.tag-book #topic-title .title-wrapper,
.category-books #topic-title .title-wrapper {
display: block;
margin: 0 auto;
}
.tag-book #topic-title,
.category-books #topic-title {
display: block;
margin: 0 auto;
}
.tag-book #topic-title h1,
.category-books #topic-title h1 {
font-size: 2em;
padding-right: 20px;
}
.tag-book #post_1 .topic-body,
.category-books #post_1 .topic-body {
padding-top: 1em;
border-top: none;
max-width: 100%;
}
.tag-book #post_1 .topic-body .contents,
.category-books #post_1 .topic-body .contents {
border-top: none;
margin-left: 0;
padding: 0;
}
.tag-book p,
.category-books p {
/* coloque estilos aqui para o texto principal nas páginas do Livro */
}
/* Posiciona o botão Avançar no canto superior direito da página */
.tag-book .post-links-container,
.category-books .post-links-container {
margin-left: var(--topic-body-width-padding);
position: absolute;
top: 1em;
right: 30px;
}
/* Posiciona o botão Voltar no canto superior esquerdo da página */
.category-stories .post-links-container {
margin-left: var(--topic-body-width-padding);
position: absolute;
top: 2.5em;
right: 30px;
}
/* Remove o símbolo de link do botão Avançar */
.tag-book .post-links-container ul li .d-icon,
.category-books .post-links-container ul li .d-icon,
.category-stories .post-links-container ul li .d-icon {
display: none;
}
.tag-book .post-links-container .post-links,
.category-books .post-links-container .post-links,
.category-stories .post-links-container .post-links {
margin-top: 0;
padding-top: 0;
border-top: 0;
}
.tag-book .post-links-container .post-links li:last-of-type,
.category-books .post-links-container .post-links li:last-of-type,
.category-stories .post-links-container .post-links li:last-of-type {
margin-bottom: 0;
}
/* Estiliza o botão Próximo/Avançar */
.tag-book .post-links-container ul li a[href],
.category-books .post-links-container ul li a[href],
.category-stories .post-links-container ul li a[href] {
align-items: center;
border: 1px solid var(--primary-low-mid);
background: var(--primary-very-low);
border-bottom-width: 2px;
border-radius: 3px;
box-sizing: border-box;
color: #009a49;
display: inline-flex;
font-family: monospace, monospace;
font-size: var(--font-down-1);
justify-content: center;
line-height: var(--line-height-large);
margin: 0 0.15em;
min-width: 24px;
padding: 0.15em 0.6em;
}
/* Adiciona setas apontando para a direita no botão Avançar */
.tag-book .post-links-container ul li a::after,
.category-books .post-links-container ul li a::after,
.category-stories .post-links-container ul li a::after {
content: " ->>";
padding-left: 0.15em;
}
/* Alternativamente Use uma Imagem para a Seta Direita */
/*
.tag-book .post-links-container::after,
.category-books .post-links-container::after,
.category-stories .post-links-container::after {
content: url('../../media/arrow-right.svg');
display: inline-block;
width: 12px;
height: 12px;
}
*/
/* Estiliza o botão Voltar/Anterior*/
.tag-book kbd,
.category-books kbd,
.category-stories kbd {
align-items: center;
border: 1px solid var(--primary-low-mid);
background: var(--primary-very-low);
border-bottom-width: 2px;
border-radius: 3px;
box-sizing: border-box;
color: var(--primary);
display: inline-flex;
font-size: var(--font-down-1);
justify-content: center;
line-height: var(--line-height-large);
margin: 0;
min-width: 24px;
padding: 0.15em 0.6em;
}
.tag-book kbd a,
.category-books kbd a,
.category-stories kbd a {
padding: 0;
}
/* Adiciona setas ao botão Voltar */
.tag-book kbd a::before,
.category-books kbd a::before,
.category-stories kbd a::before {
content: "<<-";
padding-right: 0.15em;
}
/* Alternativamente Use uma Imagem para a Seta Esquerda */
/*
.tag-book kbd a::before,
.category-books kbd a::before,
.category-stories kbd a::before {
content: url('../../media/arrow-left.svg');
display: inline-block;
width: 12px;
height: 12px;
}
*/
Aqui está o resultado…
Você pode testar ao vivo aqui…



