question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue: Only 1 dimension allowed in contentTypes

See original GitHub issue

Describe the bug In case a Frontmatter subentry has to be taken as name of a custom contentType, it won’t work. For example:

FrontMatter

---
title: xxx
subtitle: yyy
photo:
  file: my-photo.jpg
  name: My Photo
---

Setting

"frontMatter.taxonomy.contentTypes": [
	"name": "default",
    "previewPath": "/static/photos/",
	"fields": [
		...
        {
          "title": "Article preview",
          "name": "photo.file",
          "type": "image"
        }
	]
]

Expected behavior Subentries should be noted if they are separated by a period.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
zivbk1commented, Jan 11, 2022

This is excellent!

1reaction
estruyfcommented, Jan 12, 2022

The first integration of the multi-dimensional content-type field support has been added.

In the content type, you can now define it as follows:

{
  "frontMatter.taxonomy.contentTypes": [
    {
      "name": "multi-dimensional",
      "pageBundle": false,
      "fields": [
        ...
        {
          "title": "Photo",
          "type": "fields",
          "name": "photo",
          "fields": [
            {
              "title": "Title",
              "name": "title",
              "type": "string",
              "default": "default title"
            },
            {
              "title": "URL",
              "name": "url",
              "type": "string"
            }
          ]
        }
      ]
    }
  ]
}

When creating the content, it will automatically include the defined fields. From the metadata section in the Front Matter panel, you can perform changes to your article its front matter.

image

Feel free to test it out in the latest beta version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The contenttypes framework | Django documentation
Each ContentType instance has methods that allow you to get from a ContentType instance to the model it represents, or to retrieve objects...
Read more >
Content-Type - HTTP - MDN Web Docs - Mozilla
The directive consists of 1 to 70 characters from a set of characters (and not ending with white space) known to be very...
Read more >
Turn on support for multiple content types in a list or library
Learn how to allow a list or library to accept multiple content types. ... libraries or lists that store different types of documents...
Read more >
What are all the possible values for HTTP "Content-Type ...
You can find every content types here: http://www.iana.org/assignments/media-types/media-types.xhtml. The most common types are: Type application:
Read more >
HTTP headers | Content-Type - GeeksforGeeks
Read; Discuss(1); Courses; Practice; Video. Improve Article. Save Article. The Content-Type header is used to indicate the media type of the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found