More than two levels of [details]

Hi @ll,

to categorize things within a single post, I would like to use the [details] tag to create many sub-levels. However, the Discourse code stops interpreting the [details] tag after two sub-levels. Is there any way to work around this or maybe an extra app that can be installed to allow such a functionality?

Thanks for your time!

Cheers
Humper

1
2
3
4

Works fine for me ^

2 Likes

Thomas, these are not separate levels, what I am talking about are indented “levels”.

  • 1
    • 1.1
      • 1.1.1
      • 1.1.2
      • 1.1.3
    • 1.2
    • 1.3
    • 1.4
    • 1.5
    • 1.6

I want to go beyond 1.1.x but that doesnt seem to work here.

  • 1
    • 1.1
      • [details=“1.1.1”]
        • 1.1.1.1
      • 1.1.2
      • 1.1.3
        [/details]
    • 1.2
    • 1.3
    • 1.4
    • 1.5
    • 1.6

Again, works for me:

  • 1
    • 1.1
      • 1.1.1
        • 1.1.1.1
      • 1.1.2
      • 1.1.3
    • 1.2
    • 1.3
    • 1.4
    • 1.5
    • 1.6

You just need to play a little with the alignment. This topic should also be moved to #support.

2 Likes

One trick that I try to teach the users on our site that want to do advanced Markdown or see how some advanced HTML feature was done is to use the raw view of the page.

This is the URL to the preceding post: https://meta.discourse.org/t/more-than-two-levels-of-details/152421/4

This is the URL to the preceding post as raw: https://meta.discourse.org/raw/152421/4


If you look at the columns of the posts table in PostgreSQL you will see there are two columns that hold the text for a post, raw and cooked. raw is the text as entered by a user and typically contains the markdown and HTML as entered by the user.

However when you see the post as normally displayed it has been cooked to some degree and you can not see the raw text, even if you use the Internet browsers ability to reveal the HTML.

Now sometimes one can use the menu items in the edit menu bar to drop some template HTML into place and sometimes you just have to do it by hand.

HTH


EDIT

For all the theme creators.

A theme that adds a button to view the post as raw would be nice. The theme should have a configuration option to limit visibility of button based on trust level or categories.


EDIT

For those wanting to see the Raw post button theme (noted below) working on a more complex page see the SWI-Prolog Discourse page: Post for testing installed component themes and plugins

Note: Since anonymous users can not see the raw button, you will need to simply join.

2 Likes

Another option that you may not know about is the theme DiscoTOC - automatic table of contents.

It is one of the most popular themes because it is just that useful.

2 Likes

I thought this would be a good opportunity for a theme component that explains / serves as an example of how to approach a problem like this one, so I made this.

5 Likes