DiscPage: a plugin to create static pages and insert discussion balloons in the text

So far so good !
my 2 cents:

  • humble opinion about the header, I’d rather keep it centered, i feel it integrates the static pages of the plugin more seamlessly in a globally “normal” discourse.
  • fringe case: it might be interesting to specify a balloon category per static category, in case multiple static categories have different read/write rights.
  • am I missing something or does the [dpgb id=titre] [/dpgb] (which are cooked into balloons I believe) are to be set by hand? I candidly (and unsuccessfully!) tried the quote button of the composer, doh :sweat_smile: . It’s probably required as the tag slug is to be set :thinking:
  • could the discpage hide tags setting become hide discpage tags instead ? I don’t really apprehend the difficulty of hidding only the dpg-**** tags but I think they might clog a bit the suggested list when creating a topic

next step, the user engagement test !

Thanks @Benjamin_D, your feedback is most welcome.

The header alignment must fit:

  1. Normal Discourse pages (max-width = 1110px),
  2. DiscPage static pages (max-width = 782px, because 1110px is too wide for a static page where you cannot put side bars/widgets/pictures),
  3. DiscPage split layout, with a static page on the left and topics on the right (max-width = 100%).

I did many tests, with both fixed header alignment and layout-dependant header alignment, and came to the conclusion that a permanent left alignment was the way to go.

However, I will gladly check any idea you can come up with. Be sure to address the three above cases.

It’s already supported, see this paragraph in the doc:

In fact, you can set multiple categories in here. Let's call PageCat the category of the static page the balloon belongs to. If there are more than one balloon category in this field, DiscPage will take the first one which is either a sibling of PageCat (same immediate parent) or the immediate parent of PageCat. If no such category is found, DiscPage will take the first category of the list. This feature allows to pair [static page category, balloon category], which is useful, for example, for multilingual forums or to set up static pages with different group permissions.

I agree this is not easy to grasp. Any idea on how to improve the phrasing is welcome.

Yes, the balloons are to be inserted by hand using a text syntax.
When you first tried the plugin, why did you feel the quote button would be of any help? (I’m interested in your mental state at that moment)

The hide discpage tags feature is already implemented: DiscPage tags are hidden by default in all Discourse pages and widgets. In other words, if you can see a DiscPage tag anywhere (when DiscPage is enabled), that’s a bug.

The discpage hide tags setting is very different: it allows people who don’t want to enable tags in their Discourse instance, but who were forced to do so in order to use DiscPage, to simulate an instance without tags.

1 Like

:thinking: Actually, it’s more the max-width = 1110px that i’d keep, even if, in split screen, the static page under the header takes 100%. I commented out the html.dpg header.d-header .wrap block and it doesn’t feel too bad having a little white around the header above the static split page (even if the edit title and page buttons seem a bit lost up there, non split layout).

Silly me, RTFM :sweat_smile: (in my defense I probably did last year, and forgot :smile: )
I didn’t remember that discpage hid the balloon category (having just tested it as an admin) but that’s a great feature.

So if I understand correctly, in case of multiple {static page category, users rights}, one should make an associated balloon category a sub-category of the static one (which makes sense from the rights POV), or should have both categories as sub-categories of the same third parent one. Not important, but would it also work if the static one is a sub-category of the balloon one?

Probably just the balloon shape of the icon, in conjunction with the fact that I’ve probably never used the quote button of the composer, and maybe I thought, Hey, was that there before? So I tried :crazy_face:
I don’t care having to write a few strings of “code” but I can hear my users howling from here. Maybe they just won’t set themselves the static pages for now. Sometime I feel every stoke on the keyboard can be the last straw… :roll_eyes:

Of course, sorry… I’m gonna put this on my slight fever, I don’t know why I thought that they weren’t hidden, maybe I saw the glimpse of one in the tag drop-down box in the balloon part of the split screen ? I now understand the trailing comma I saw trying everything I could, even tagging the balloon topics!

Would it be possible to let users create and edit (their) static posts? The admin restriction could then only be achieved with the category security settings.

edit:
maybe not, modifying a tag_groups seems StaffConstraint :disappointed_relieved:

I can let a TL4 user set a balloon with changing a = User.current()) && a.admin into User.current()) && a.trust_level >= 4 but the tag won’t be created until an admin edit the static page… :thinking:
Something would be great : a category moderator that would be able to change the tag group of its category :smile:

BTW, I’ve found that the plugin checklist seems to interfere with discpage (something about getmodel() )

I prefer the current layout. However, there should be an easy way to customize this. I will think about it.

No, this combination is not supported.

As you already figured, creating static pages is not limited to admins, but inserting balloons is. The reason is that there is no straightforward way to create tags in Discourse (see this thread). To do so, I chose to use the tag group API, which is restricted to admins. There were alternate solutions, but coming with their own drawbacks.

You mean this plugin? What’s wrong?

Indeed, with the two plugins enabled, refreshing a static page, well kind of switch off discpage (return a normal layout) and the console throws an error:

Uncaught (in promise) TypeError: postModel is undefined
checklistSyntax javascripts/discourse/initializers/checklist:29

Both plugins works fine separately

Thanks @Benjamin_D. The issue has been filed here:
https://github.com/sylque/discpage/issues/19

EDIT: this has been fixed in the latest version (1.0.38).

2 Likes

Hi @syl , hate to be the bearer of bad news :sweat_smile:, I’ve found another compatibility issue, a bit more problematic, with discpage enabled an invite link leads to a blank page (instead of the register page).
browser console says:

  r.site.categories is undefined

disabling the plugin makes the invite link works as usual.

1 Like

Thanks a lot for reporting this, @Benjamin_D . This is yet another bug with the “login required” mode, so I’ve reopened the previous GitHub issue. Until this is fixed, a workaround is to disable the “login required” mode.

EDIT: this has been fixed in the latest version (1.0.38)

2 Likes

Hi @syl !
I think the recent tag routes change
https://github.com/discourse/discourse/commit/3c51647872b4118c5f6139c375fd8e4079bc7252
has broken something :thinking:
a minima the link in the bubbles should now points toward /tag/dpg-xxx and not /tags/dpg-xxx

2 Likes

Thanks @Benjamin_D, this has been fixed in v1.0.38.

2 Likes

Hi Syl,
not sure if it’s always been there and/or on purpose but I’ve just noticed that the new topic button of the parent category of any discpage category is disabled, I assume there:
https://github.com/sylque/discpage/blob/b6da51a6d706d9b52864017ebffe25e13c7894fd/assets/javascripts/discourse/lib/lib.js.es6#L53-L54

Is it intended? It doesn’t seem to be the case on castafiore.org (I’m on ( 2aac657da7 ) and latest of discpage). Weirdly I don’t remember the balloon categories ever been hidden (but the new topic button is also disabled). I have two couples discpage/balloons categories, each couple in it’s own category.

Thanks @Benjamin_D.

Looks like a bug, I will investigate this more.

DiscPage does its best to prevent users from using the balloon category manually. The reason is that the balloon category is supposed to be applied automatically by DiscPage, when the user creates a new topic in a balloon.

To enforce this rule:

  1. DiscPage hides the balloon category from the category combo box in the “New Topic” dialog.
  2. DiscPage disables the “New Topic” button on the balloon category page.

Do you confirm this is what you see?

:+1: I do
And I can also confirm that the parent category is not hidden in the combo box in the new topic dialog

The issue has been fixed in v1.0.46 (more information here).

1 Like

I am confused and am seeking some guidance. We have a Standard account and I am wondering if this plugin can be installed at that account level. I am not seeing it listed on the page where our plugins options are.

What am I missing?
Do we need to upgrade to Business account to have it available to us?

I look forward to hearing. Thanks
Neil

Hi Neil,
I don’t know much about Discourse hosting plans, so maybe you should contact the Discourse team about that.
From what I can read here, I don’t think you can use DiscPage with a Standard hosting plan. My understanding is that you need an Entreprise hosting plan (or a self-hosted Discourse instance) if you want to be allowed to install any plugin.
Best,

1 Like

I found the Usage Instructions on Github for Adding Discussion Balloons to be a bit misleading…

The Readme says this… (and following these instructions, I could not get any balloons to appear)…

To add a balloon, add [dpgb id=myBalloonId][/dpgb] to your topic text.

For example:

## Introduction [dpgb id=intro][/dpgb]

The balloon id must contain only [a-zA-z_].

However I’ve discovered the following, and now the balloons do appear…

To add a balloon, in the Topic editor, the format should instead be…

[dpgb id=myballoonid] The section you want to highlight when the balloon is clicked, for your users to comment on, goes here in between these tags [/dpgb]

For example:

[dpgb id=intro] Introduction [/dpgb]

Also the id must contain only [a-z] (lowercase letters only).

You might also notice in my example below that extra spaces before and after the [dpgb=id] and [/dpgb] are not problematic.


So here is a sample of what I put in the Topic editor in my Discourse…

And here is how the resulting page looks…

Hmm… when I click the orange balloons the page does slides in to halves, but when I click the + New Topic button in the Right panel…

… the Topic editor slides up from the bottom, so I use that to write my Topic …

… but then after I save it, it’s not connected to the Page Topic, and still there is no Topic list in the Right panel…

Anyone have thoughts about What is happening (or not happening that is supposed to happen) here?

Here is the live page: