Skip navigation

Insert tweets into content (example)

Embedding content inside rich text is a matter of defining the structure for your content and then providing specific content based on that structure. See how it all works on the example of tweets inside articles.

Table of contents

    Create a content type for the tweet

    The first step is to create a content type that will define the basic elements of the tweet.

    1. From the app menu, choose .
    2. Click Create new.
    3. Type Tweet in Content type name.
    4. Add a Text element for the tweet link.
      1. Name it Link.
      2. Make it required.
    5. Add a Multiple choice element for the display options.
      1. Add two options named Hide thread and Hide media.
      2. Set the element to show as Checkboxes.
    6. (Optional) Add another Multiple choice element for selecting a theme.
      1. Add two options named Dark and Light.
      2. Set the element to show as Radio buttons.
    7. Click Save changes.

    The finished Tweet content type can look similar to what you see in the picture.

    A screenshot of a Tweet content type.

    Insert a tweet

    Once you have the tweet defined, you can insert it as component in a rich text element of an article, for example.

    1. From the app menu, choose .
    2. Using the filters on the left, select the Article content type to view only articles.
    3. Open an article for editing.
    4. In a rich text element, place the cursor to where you want to add the tweet.
    5. In the editor toolbar, click  and then .
    6. Choose Tweet from the list of types.
    7. Fill in the elements. 

    You now have a tweet that exists only within the article as a component.

    From single-use to re-use

    If you later find another use for the content in your component, you can always convert it to a content item by clicking . This conversion cannot be undone. If done by accident, you can archive the new item and recreate your component.

    After you finish, you can continue editing the article. Changes made to the tweet are saved automatically.

    A screenshot of a tweet component in a content item.

    This is what the final result looks like in one of our Kontent sample apps.

    A screenshot of a tweet embedded in the article on a website.

    You can also use this approach for other types of content like videos or embedded content.

    What's next?