Barra laterale dei tag popolari di Discourse

Questo componente del tema visualizza i tag più popolari di una categoria in una barra laterale fissa su schermi più ampi di 767px (la maggior parte dei tablet e dei dispositivi desktop).

:warning: Devi attivare l’impostazione mostra filtro per tag sul tuo sito affinché questo componente del tema funzioni.

Cosa posso fare con questo componente del tema?

  • Visualizzare da 3 a 30 tag popolari in una barra laterale per ogni categoria

  • Impostare la posizione della barra laterale a sinistra o a destra

  • Prevenire la visualizzazione della barra laterale in determinate categorie

  • Modificare il testo dell’intestazione “Tag popolari”

CSS personalizzato

Ogni barra laterale è racchiusa in una classe che contiene il nome della categoria; ad esempio, per la categoria UX sarebbe .ux-sidebar. Puoi utilizzare queste classi per applicare stili alle singole barre laterali.

Il tag HTML nelle pagine con barre laterali include anche una classe aggiuntiva, così puoi usare html.custom-sidebar per applicare stili a tutte le pagine che hanno una barra laterale.

Installa questo componente del tema

43 Mi Piace

this would make an incredibly powerful navigation tool if it showed the most common in each category and tag-page and it was positioned in a banner, or other item at the top of the page.

3 Mi Piace

Very nice work.

I can see the sidebar only on the page of first category in the list of categories.

How do I enable it for all categories?

1 Mi Piace

The tags sidebar that appear on the parent category include both parent category tags and child category tags. To enable it for all categories and subcategories you need to change the code here discourse-popular-tag-sidebar/desktop/header.html at master · awesomerobot/discourse-popular-tag-sidebar · GitHub.

2 Mi Piace

Right now, it shows only for the first category on categories page

So, which part of code i need to edit and how can i get it for all page.

Please help with details. Sorry and thanks

Can you help with that change? I do not understand the coding that much. Please help

It appears only on first category in category list. Not in any other one. Please help

2 Mi Piace

Is there any way to display it above the topic list instead?

In case you weren’t aware, there is already an optional tag drop-down in vanilla Discourse (shown in the image above) which appears above the topic list.

image

3 Mi Piace

I understand, yet for my purpose I want to display a list or sort of tag cloud instead

3 Mi Piace

Yes, I"m having that problem too. Is there a fix?

I see that it works on Category pages now. But is there away to get it to work on the Latest thread?

Can you describe this problem a little more? The sidebar only appears for one category and no others?

Do all the categories you’re trying have topics with more than 3 tags? the sidebar won’t show if there are less than 3 tags within a specific category.

Yes, I think I can add some support for other pages

1 Mi Piace

Just a question… when i click Tags from Tags Sidebar, the URL is https://www.example.id/tags/c/sub-categoriy/Tags-name

There is no problem when i click directly (same page), but when i right click, open in new tab, there is message “Oops! That page doesn’t exist or is private.

Why the URL format not like normal url tags, https://www.example.id/tags/tag-name

Another question, how to add space between text (tag) not 1 or 1,5 (not sure), but 2.

Thanks a lot

1 Mi Piace

I’ve added a feature to optionally show the tag sidebar on the top menu pages (latest, top, new, etc). It’s disabled by default, you can enable it in the theme component’s settings.

https://github.com/awesomerobot/discourse-popular-tag-sidebar/commit/75b3eacba7d23d76198f6adf1209f66e1da4e4f2

That was my mistake, I didn’t consider subcategories and restructure the URL to fit. It’s fixed now.

That URL shows all the tags across all categories, when you’re within a category and click a tag in the sidebar I wanted to make it so you’re viewing that tag within the context of the current category.

I’m not entirely sure what you mean, can you give me a specific example?

1 Mi Piace

Wow… it works now when i open it in new tab… Thanks a lot…

Sorry for my bad english :grinning:

“Add space” means change line spacing (like in MS Word) to 2, which currently looks like 1 or 1.5, so there is more space between tags

image

Also, can i change the color of tags text ? From blue to gray

Another question, can the popular tags always be seen?

image

When I scroll down, the words Popular tags are not visible, only the list of tags is visible.

image

Once again… Thank you so much for your help

oh ok, you can add some css to your theme (admin > customize > themes) like:

.tag-sidebar a:nth-of-type(2) {
    margin-top: 5px;
}

similar for text color

.tag-sidebar a {
    color: red;
}

This is probably an issue with your current theme, you can adjust the sidebar top position like this:

.topic-list.with-sidebar > .tag-sidebar {
  top: 120px;
}

These are all general CSS changes… if you want to make more style changes like these I suggest following a few CSS tutorials, CSS first steps - Learn web development | MDN is a good free one!

5 Mi Piace

Hi , I have issues on line 31: discourse-popular-tag-sidebar/desktop/header.html at master · awesomerobot/discourse-popular-tag-sidebar · GitHub

Can you help me check this error?

What is the reason for max 30 tags?

hi Kris !
I wonder if the option number_of_tags wasn’t lost with this commit ? :thinking:

2 Mi Piace

would be really cool if the max # of tags was increased to 100 and displayed in a responsive-filled height of a bubble text cloud sorted alphabetically. in other words, the more popular a tag the larger its font size. the “top 100” tags.

also, would be good if it was positioned horizontally above category lists for mobile. i really want this for mobile. :star_struck:

Ciao,

Come posso visualizzare l’elenco dei tag più popolari sotto l’intestazione? Per favore, dammi dei suggerimenti.

Grazie

1 Mi Piace

Sfortunatamente, questo componente è in conflitto con Discourse Tag Sidebars. Quando abilito entrambi, ottengo tutti i tag schiacciati in un’unica riga, così:\n\n

\n\nE le barre laterali dei tag non vengono visualizzate affatto.\n\nQuesto è sfortunato, perché questi dovrebbero essere complementari: l’elenco dei tag per la vista “tutti i tag” (e forse anche “nessun tag”), e la barra laterale per i tag specifici. Infatti, forse potrebbero essere combinati in un unico componente?

1 Mi Piace