Docs

Learn

v.Latest
Documentation
A Thousand Words...

Before we move on, let's add an image to our page. Everyone loves images!

1. Add another property to our schema:

fields: [
{
type: "string",
name: "title",
label: "Title",
isTitle: true,
required: true,
},
{
type: "rich-text", // bourgeoisie
name: "body",
label: "Body",
isBody: true,
required: true,
},
{
type: "image", // paints a thousand words
name: "beautifulImage",
label: "Beautiful Image",
required: false,
}

2. Modify the app/awesome-content.tsx component to render our beautiful image.

const beautifulImage = pageData.data.my_first_collection.beautifulImage;
...
return (
<>
<h1>{amazingTitle}</h1>
<img src={beautifulImage ? beautifulImage : null} />
<TinaMarkdown content={incredibleBody} />
</>
);

3. Go into the Visual editor (http://localhost:3000/admin/index.html) and marvel at the new input for uploading an image! šŸ–¼ļø

4. Pick a beautiful image to go with our amazing title and incredible body (bonus points for a llama pic)

By default, TinaCMS uses an image store from your repository.

You can also configure this to use external media providers instead.
Last Edited: March 28, 2025

Join the Herd!

Become part of our coding comunity and stay updated with the latest tips and news.