ILIAS icon indicating copy to clipboard operation
ILIAS copied to clipboard

Proposal for `<meta>` tags in the Kitchensink

Open thibsy opened this issue 3 years ago • 0 comments

As discussed with @klees I have implemented (a proposal for ILIAS 9) to add support of <meta> tags to the Kitchensink.

The reason behind this is a feature-request which will rely on meta-tags. Currently the metadata is managed via GlobalScreen, but only supports key => value pairs. These pairs will then be rendered like <meta name="key" content="value" /> in the Page component. There is no flexibility in regard of the attribute-type (by attribute-type I mean e.g. the name= part of the tag). The feature will rely on whats called the open-graph-protocol (https://ogp.me) which uses property= instead of name=. Therefore we have to improve how metadata is currently handled so we can define what kind of attribute-type should be used. Possible options (except property) can be found at mozilla.org. The property-attribute is an exception, but must be used according to the OGP to ensure support of different platforms, therefore we'd have to support it as well.

Now why the Kitchensink? Well the kind of metadata we are talking about here is the one stored in an HTMLs <head> tag. This sort of data is required when creating a Page object (currently an associative array). With this proposal the Page would be able to require an array of meta-components and could delegate the rendering process. To be able to represent the data we must validate in our DTO (even if not in the Kitchensink) if the attribute-type is supported/known and whether it allows to have content, because there are two kinds of attribute-types: ones that allow content, and ones that don't. Now since the validation is solely based on the HTML-representation, it makes sense to implement it in the UI component. IMO it also makes sense to treat the implementation as a component, because like all other components it represents an HTML-tag and would be considered an entity (according to the Component interface).

Kind regards!

thibsy avatar Jun 24 '22 10:06 thibsy