Adding HTML tags to Folder description

I want to be able to add HTML tags to a folder description to allow better formatting.

I am using EAA Faceted Navigation on this folder, so I can't just change it to a page, nor is the option of changing the default view of the folder an option.

So, I am stuck with folder description. I tried:

  1. just adding HTML code to folder description. It simply presented the HTML as text
  2. I found: http://docs.plone.org/develop/plone/misc/html.html gave quick attempt, but I am not a programmer and no ideas what to do with this.

Is it possible to do what I am looking for?

Thanks for any help.

collective.richdescription is what you're looking for.

repo: https://github.com/collective/collective.richdescription
pypi: https://pypi.python.org/pypi/collective.richdescription

In my opinion this should be just an option in Plone and not an addon.

The problem with "Description" is, its an Dublin Core Metadata field.

But hey, we have transforms! So exposing Description as text/plain when requested as Dublin Core should not be a major problem.

3 Likes

If I remember right, drupal deals with this in an interesting way. They just highlight the text they want to be the description in the visual editor. That gives you a lot more flexibility.

I did a "reply via email" yesterday, but now it looks like it was never posted. Repeating here:

Here is what you could do entirely TTW:

First, you need to create a "classic portlet", which you can do in the ZMI:

  • Go to portal_skins

  • Go into the custom folder

  • Add a page template (from the dropdown menu, top right)

  • Give it a simple name

  • Paste in
    the following code:

     <html>
     <body>
        <div metal:define-macro="portlet">
            <h1>Foo Bar!</h1>
        </div>
     </body>
     </html>
    

Now, go back to the site:

  • In faceted navigation, go to the Faceted Criteria tab
  • In the Top widgets section, click the + button
  • In the Add widget dialog, select the Plone portlet type
  • Give it a friendly title (but this will only be shown to you, not the end user)
  • Under portlet macro, enter: your_portlet_id/macros/portlet, replacing your_portlet_id with the name you chose in portal_skins/custom
  • Now you can go back in the ZMI portal_skins/custom, and use any HTML you want.

At this point, you can also clear out your description field.

(Posted at https://solitonconsulting.com/blog/how-to-add-portlet-widgets-to-eea-facetednavigation)

Depending on what kind of tags you want to add it's possible to use JavaScript to inject HTML into parts (or maybe all) of the description, eg making URLs clickable.

But I agree with @jensens that it's time description fields were made HTML. So many users have asked me why they can't do this it's clearly expected.

at least one client, where i have collective.richdescription installed, regulary confuses the description with the text field and fills in very long texts. a full blown tinymce is too much here, a stipped down version would be what we need. should be possible with mockup, as we can configure the widget on a per field basis.

Here is what you could do entirely TTW:

First, you need to create a "classic portlet", which you can do in the ZMI:

  • Go to portal_skins
  • Go into the custom folder
  • Add a page template (from the dropdown menu, top right)
  • Give it a simple name
  • Paste in the following code:

Foo Bar!

Now, go back to the site:

  • In faceted navigation, go to the Faceted Criteria tab
  • In the Top widgets section, click the + button
  • In the Add widget dialog, select the Plone portlet type
  • Give it a friendly title (but this will only be shown to you, not the
    end user)
  • Under portlet macro, enter: your_portlet_id/macros/portlet, replacing
    your_portlet_id with the name you chose in portal_skins/custom

Now you can go back in the ZMI portal_skins/custom, and use any HTML you
want.
At this point, you can also clear out your description field.

On Thu, Jun 4, 2015 at 2:17 PM, Johannes Raggam community@plone.org wrote:

I think having description be extracted from the main text via a block or
style is much more flexible.