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", // bourgeoisiename: "body",label: "Body",isBody: true,required: true,},{type: "image", // paints a thousand wordsname: "beautifulImage",label: "Beautiful Image",required: false,}
2. Modify our 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.
Ā© TinaCMS 2019ā2025