Search

5 answers to the most common Contentful questions from content authors

Here are my answers to the 5 most common questions I hear content authors ask:


1. Is there a way to add default values for fields?

Having default fields in Contentful is a helpful way to speed up a content author's workflow, ensure certain fields aren't left empty and provide a starting place for them to build their content off of.

Adding a default value for a Contentful field is now possible from your content model settings:

  1. Go to the Contentful dashboard.

  2. Click Content Model.

  3. Click the content type that has the field you would like to add a default for.

  4. Within that field, click "settings."

  5. Click the "Default Value" tab.

  6. Enter the desired default value.

Now, when your content authors edit this field, it will be pre-filled with the content you specify.



2. How can I embed videos from YouTube or Vimeo in a Contentful component?

Embedding videos hosted on YouTube or Vimeo in Contentful isn't as obvious as doing something like adding an image or basic text field to a page. But the method for achieving this isn't as difficult as it may seem.

The best way to add videos hosted on YouTube or Vimeo is by creating a content item to hold the hosted video's ID. The video ID is provided when you click the Share button on a YouTube or Vimeo video; it's the characters after the slash:

https://youtu.be/_4kHxtiuML0 < this is the id https://vimeo.com/606811537

Your content model can be designed to have a few fields, namely:

YouTubeID: Short Text VimeoID: Short Text

You can then build upon this model to allow content authors to adjust the video's thumbnail or start time.

Then, you can have your front end set up to render a video from the ID provided.



3. "Contentful updates the URL for the asset every time you update the asset itself. So what should I do for PDFs that change over time?"

Linking directly to a PDF in the Contentful Media Library is easy if the PDF won't change:

  1. Add a PDF to the Contentful media library.

  2. Once the PDF is uploaded to Contentful, publish the entry.

  3. Click the ⬇️ download icon, which will open the PDF in a new tab.

  4. Copy the URL in the address bar.

  5. Done 🎉

If your PDF changes over time, however, this URL will not automatically update to show the new PDF. So, if you sent that PDF link out and later find a typo, you'd have to send a completely new link to the updated PDF.


You can get around this issue with some content modeling:

  1. Create a content type.

  2. Title it 📄 PDF Component.

  3. Add one Media field with the title "PDF File."

  4. Add one short text field with the title "Slug."

What we're doing is creating a page to host your PDF on, and specifying the URL the PDF should live at with the slug field. This way, the PDF will update whenever you change the file in the PDF File field, but the URL will stay the same.

Developer note: you can find code snippets to help implement this solution on the front end here.



4. How can I break text into two lines in non-rich text fields?

Having the right amount of characters on each line of text is key to optimizing readability, so it makes sense why authors would want to customize text fields in this way.

To add line breaks to text fields, you can have your front end set up to add line breaks whenever an author adds a <br> element to a text field.


For content authors, the experience would look something like this:


That text would render as:


This is what it will look like

at this point


Developer note: To learn more about how to implement this from a technical perspective, take a look at our guide here.



5. "I can’t seem to figure out how to add a jump link. I want to be able to specify different points throughout my site pages to link to specifically."

Jump links are used when you want to send someone to a specific position on a page.


To create a system to specify jump link positions on your site, you can follow these steps:

  1. Create a content type and title it 🦘 Jump Link Component.

  2. Add a short text field titled Component Name.

  3. Add a short text field titled Identifier.

  4. Click on the Identifier field settings and then the validation tab.

  5. Select Prohibit a specific pattern and add /^\S+$/ to the regex input field. This will prevent users from being able to type spaces into this field (if spaces are added here, you cannot generate the proper jump link)


Now, as an example, let's say you wanted to link to the About Us section of your homepage:

  1. You would navigate to the page component for your homepage (not sure how to model a basic page component? More on that here).

  2. Then, find your About Us section on that page.

  3. Create a new 🦘 Jump Link Component and reference it above the About Us section.

  4. Create links to this section combining the page link with the identifier set in the 🦘 Jump Link Component. In the example of the About Us section, the link would look something like www.yoursite.com/#about-us-section

Developer note: you will need to configure your front end to add a <div> with an id that matches the identifier wherever a 🦘 Jump Link Component is added.


Content authors have been through a lot


Working with a traditional CMS is tough, and using a headless CMS promises a better way. Making the switch to a headless CMS is an opportunity to make a CMS work for you specifically.


There's a process you can follow to make Contentful work for your team specifically


It's called the Waterfall method.


Teams I've worked with that follow this process were far more likely to set up a successful Contentful project than those who didn't.


Why? Because the process uses your current challenges to inform a vision their entire team can work towards, and make Contentful the tool to pull it all together.


Grab our free guide below on the step-by-step process successful Contentful users follow.


You'll also get sample questions to ask your content editors as you develop requirements with them.