Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a showcase of the content type snippets #55

Closed
2 tasks
JanLenoch opened this issue Nov 23, 2017 · 2 comments
Closed
2 tasks

Add a showcase of the content type snippets #55

JanLenoch opened this issue Nov 23, 2017 · 2 comments
Labels
enhancement groomed The issue has been groomed and should be in a good shape. hacktoberfest help wanted up-for-grabs

Comments

@JanLenoch
Copy link

JanLenoch commented Nov 23, 2017

Kentico Cloud now supports so called content type snippets. These are sets of content elements that can be added to multiple content types to enrich their structure but still be managed from a single place.

The Delivery API responses contain both the elements originating from snippets alongside their own elements. The only difference is that snippets have code names prefixed with the code name of the respective snippet. The format of code names is [code name of snippet]__[code name of element].

A shortened example of a content item:

{
    "item": {
        "system": {
            // ...
            "type": "brewer",
	// ...
        },
        "elements": {
	// ...
            "product_name": {
                "type": "text",
                "name": "Product name",
                "value": "AeroPress"
            },
	// ...
            "metadata__meta_title": {
                "type": "text",
                "name": "Meta title",
                "value": null
            },
	// ...
        }
    },
    "modular_content": {}
}

The goal of this task is to implement support for rendering content items of content types that utilize a content snippet. For that scenario, we've prepared a sample content snippet that enriches other content types with SEO-related data, such as og:title, og:description, etc. which are then rendered in the <head> of the page.

Suggested approach:

  • use the model generator to regenerate the models (in order for them to have the desired og-related properties)
  • adjust the code of the sample application so that it renders the SEO metadata in the <head> of the page
@kontent-ai kontent-ai deleted a comment from JanLenoch Aug 20, 2018
@kontent-ai kontent-ai deleted a comment from Simply007 Aug 20, 2018
@petrsvihlik petrsvihlik added groomed The issue has been groomed and should be in a good shape. hacktoberfest labels Aug 20, 2018
@petrsvihlik petrsvihlik changed the title Add support for content type snippets Add a showcase of the content type snippets Aug 20, 2018
@liamgold
Copy link
Contributor

liamgold commented Sep 1, 2018

I've given this a go, used react-helmet for the handling of adding/removing and inheriting the metadata.

While testing I also noticed an issue with the brewer links were broken - so fixed those too. Will do a PR now.

@petrsvihlik
Copy link
Contributor

implemented in #94

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement groomed The issue has been groomed and should be in a good shape. hacktoberfest help wanted up-for-grabs
Projects
None yet
Development

No branches or pull requests

3 participants