collective / sc.social.like

Social: Like Actions is a Plone package (add-on) providing simple Google+, Twitter and Facebook integration for Plone Content Types.
7 stars 23 forks source link

Add a way to extend default metadata #147

Open erral opened 6 years ago

erral commented 6 years ago

I needed a way to extend the default metadata provided by the product, and implemented it using adapters.

To extend the default metadata, you need to provide an adapter for the given content type and return a dict with the extended metadata.

You can also override preexisting metadata (if you want to change for instance og:title or any other.

This idea of using an adapter comes from collective.opengraph a preexisting product that provides just opengraph metadata support.

Any comments are welcomed, of course!

hvelarde commented 6 years ago

@rodfersou Twitter meta tags use the standard name attribute of HTML5, OG protocol uses the RDFa extension and that's why they use the property attribute instead; the scope of this PR is to be able to add/override OG metadata only. we can think later on how to do the same for Twitter.

BTW, @erral I would like to find a way to be able to dynamically add tabs to the control panel configlet (for third-party plugins, for instance); do you have any suggestion?

rodfersou commented 6 years ago

BTW, @erral I would like to find a way to be able to dynamically add tabs to the control panel configlet (for third-party plugins, for instance); do you have any suggestion?

@hvelarde we can show or hide the tabs dynamically with some lines of javascript code.

erral commented 6 years ago

Would it be acceptable to allow lists to be values of the dict and then when rendering the template check the type of the value and if it is a list, render it properly?

hvelarde commented 6 years ago

@erral sound doable, but we will need to make the documentation a little bit more explicit then.

@rodfersou I think that's not needed right now; what we need is a way to add dynamically tabs to the configlet.

erral commented 6 years ago

@rodfersou I think that's not needed right now; what we need is a way to add dynamically tabs to the configlet.

collective.plonetruegallery has a similar usecase: plugins can have configuration and if enabled it is shown in the control panel config.

hvelarde commented 6 years ago

@erral IMO that's way to complicated; we only need to do the same thing is done in behaviors to extend the configuration form.