Open rafaelbco opened 6 years ago
yes, I knew that when we implemented the feature; now that you have a use case we can start thinking on how to solve this.
before creating a new option on the configlet I would like to find out if there's a canonical way of declaring a public state in Plone. can you help me on that?
another option is to show the viewlet always again; we implemented this change because we had a lot of code being loaded there before (all JS from widgets) and that was making the page rendering slow on unpublished content.
now the only JS code that loads there is Facebook's; we can find out a way to decouple it from the main viewlet.
before creating a new option on the configlet I would like to find out if there's a canonical way of declaring a public state in Plone. can you help me on that?
I don't think such thing exists :disappointed:. Perhaps you can explain the situation on the Plone forum and see what people have to say.
another option is to show the viewlet always again;
Actually I like the idea of being able to restrict sharing only for public items. If the new option "list public states" is implemented then we could make an empty list mean that the viewlet will always be displayed.
For now I monkey patched my way around the limitation, so there's no hurry to implement a fix from my part.
the site Navigation configlet has something that can help us to build the prototype of this new option:
Sometimes a workflow does not have a
published
state. In my case I have something likepublished_external
. The following line checks if the content item is in thepublished
state to determine if the viewlet is enabled:https://github.com/collective/sc.social.like/blob/2e67159bc1e6c9008cf38b5ba2e6b53d4dec646f/sc/social/like/browser/viewlets.py#L53
As a result I cannot use the add-on because my workflow does not have such a state.
I think the best way to solve this is make it configurable in the control panel as a set of workflow states for which the viewlet should be enabled.