1

I want to create a new component having the user selected number of records of a collection type named articles . I dont need the user(admin) to select the related articles but only the number of published recent .

i have done this in my json file

{
  "kind": "collectionType",
  "collectionName": "pages",
  "info": {
    "singularName": "page",
    "pluralName": "pages",
    "displayName": "Page",
    "description": ""
  },
  "options": {
    "draftAndPublish": true
  },
  "pluginOptions": {
    "i18n": {
      "localized": true
    }
  },
  "attributes": {
    "title": {
      "type": "string",
      "pluginOptions": {
        "i18n": {
          "localized": true
        }
      },
      "required": true
    },
    "description": {
      "type": "text",
      "pluginOptions": {
        "i18n": {
          "localized": true
        }
      }
    },
    "page_components": {
      "type": "dynamiczone",
      "components": [
        "sections.hero",
        "sections.section-with-buckets",
        "sections.section",
        "sections.section-with-cards",
        "sections.rich-text",
        "sections.section-with-articles"
      ],
      "pluginOptions": {
        "i18n": {
          "localized": true
        }
      }
    },
    "seo": {
      "type": "component",
      "repeatable": false,
      "pluginOptions": {
        "i18n": {
          "localized": true
        }
      },
      "component": "meta.metadata",
      "required": true
    },
    "url": {
      "pluginOptions": {
        "i18n": {
          "localized": false
        }
      },
      "type": "string",
      "regex": "^$|^[a-zA-Z/-]+$"
    }
  }
}

but i want to be able to fetch the n number of recent articles which is another collection type

0 Answers0