Creating a content type for the tweet

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

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

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

Inserting a tweet into the Rich text element

Once you have the content type for the tweet created, you can insert it as component into the Rich text element of the Coffee beverages explained article. To do this, follow these steps:

  1. From the app menu, choose Content & Assets.
  2. Using the filters on the left, select the Article content type to view only articles.
  3. Open the Coffee beverages explained article for editing.
  4. In the rich-text editor, position the cursor to where you want to add the tweet.
  5. In the toolbar, click Insert... > Insert new component.
  6. Choose Tweet from the list of the content types.

You're now creating a specific component based on the Tweet content type. Make sure to name the item, insert the tweet link and select from the options in the Multiple choice elements.

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

Tip: To change the position of the tweet within the Rich text element, drag & drop the component as needed.

In the Coffee beverages explained article, a tile representing the included component will appear, showing its contents. There are no restrictions on the type of components you can include in the Rich text element.

The final result, as implemented on our Kentico Cloud sample site.

What's next?

  • Learn when it's best to use components instead of content items in rich text.
  • Add code snippets to your blog post using components.
  • Learn how to use Linked items elements to create the Related articles section.
  • And just to give you some more ideas, the described scenario can also be applied when, for example, inserting a YouTube video to the blog post.
Did this answer your question?