HI!
I need advice to build simple solution of a landing page.
In this landing page I Have 3 parts which refer to the same source (skills list), 2 parts of them are in the same page (file collection), the last part is a sort of blog post (folder collection).
I want that every single part take informations about skill from the same source (in about section). I thought at relation widget but it not works (selection list when i try to add skills in blog post is blank).
I have to create new file collection with skills or is there a better solution to avoid new file collection and keep only “about collection” and “blog collection”?
i hope i have explained myself well
the code:
backend:
name: git-gateway
branch: master
media_folder: static/img
public_folder: /img
publish_mode: editorial_workflow
collections:
- label: "Pages"
name: "pages"
files:
- file: "src/pages/index.md"
label: "Landing Page"
name: "index"
editor:
preview: false
fields:
- {label: "Title", name: "title", widget: "string"}
- {label: "Greeting", name: "greeting", widget: "string" }
- {label: "Name", name: "name", widget: "string"}
- {label: "Heading", name: "heading", widget: "string"}
- {label: "Description", name: "description", widget: "text"}
- {
label: "Cv",
name: "cv",
widget: "file",
default: "/uploads/cv.pdf",
}
- {label: "Linkedin", name: "linkedin", widget: "string", pattern: ['[(https:\/\/www\.linkedin.com)]{20}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/=]*)+', "Must be Linkedin URL"]}
- {label: "Github", name: "github", widget: "string", pattern: ['(https?://github.com/[a-zA-Z0-9-]*/?)', "Must be Github URL"]}
- {label: "Skills Section Heading", name: "skillsSectionHeading", widget: "string"}
- label: "Skillset"
name: "skillset"
widget: "list"
fields:
- {label: "Skillset Head", name: "skillsetHead", widget: "string"}
- label: "Skills"
name: "skills"
widget: "list"
fields:
- {label: "Skill", name: "skill", widget: "string"}
- label: "Icons"
name: "icons"
widget: "list"
min: 1
max: 4
fields:
- {label: "Icon", name: "icon", widget: "image"}
- {label: "Image Alt", name: "imageAlt", widget: "string"}
- {label: "Image Title", name: "imageTitle", widget: "string"}
- {label: "Works Heading", name: "worksHeading", widget: "string"}
- label: work
name: work
widget: relation
required: false
multiple: true
collection: fullWorks
search_fields: ["name"]
display_fields: ["name"]
value_field: "*"
- {label: Contact Heading, name: contactHeading, widget: string}
- {label: contactEmail, name: contactEmail, widget: string, pattern: [ "[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", "Enter valid email address"]}
- name: 'fullWorks'
label: 'Full Works'
folder: "src/pages/fullWorks"
create: true
editor:
preview: false
slug: 'index'
media_folder: ''
public_folder: ''
path: '{{name}}/index'
fields:
- { label: name, name: name, widget: string}
- {label: "type", name: "type", widget: "select", options: ["featured", "personal"]}
- {label: "status", name: "status", widget: "select", options: ["online", "offline"]}
- label: Stack
name: stack
widget: relation
multiple: true
collection: pages
file: index
search_fields: ["skillset.skills.*"]
value_field: "skillset.skills.*"
display_fields: ["skillset.skills.*"]
- {label: Link, name: link, required: false, widget: string, pattern: ["[-a-zA-Z0-9@:%_\\+.~#?&//=]{2,256}\\.[a-z]{2,4}\\b(\\/[-a-zA-Z0-9@:%_\\+.~#?&//=]*)?", "Must be and URL"]}
- {label: Github Repository, name: githubRepository, required: false, widget: string, pattern: ["(https?://github.com/[a-zA-Z0-9-]*/[^!@#$%^&*()_+-={}\\[\\];:'\",<.>/?`~]+/?)", "Must be Github Repo URL"]}
- {label: Preview Image, name: previewImage, widget: image, allow_multiple: false}
- {label: Preview Description, name: previewDescription, widget: text}
- {label: description, name: description, widget: string}
- label: Top Columns
name: topColumns
widget: list
fields:
- {label: Column Heading, name: columnHeading, widget: string}
- label: Column List
name: columnList
widget: list
fields:
- {label: Item, name: item, widget: string}
- label: icons
name: icons
required: false
widget: list
fileds:
- {label: Icon, name: icon, widget: image}
- {label: Alt, name: iconAlt, widget: string}
- {label: Title, name: iconTitle, widget: string}
- {label: Paragraphs, name: paragraphs, widget: markdown}
- name: 'blog'
label: 'Blog'
folder: 'src/pages/blog'
create: true
slug: 'index'
media_folder: ''
public_folder: ''
path: '{{title}}/index'
editor:
preview: false
fields:
- { label: 'Title', name: 'title', widget: 'string' }
- { label: 'Publish Date', name: 'date', widget: 'datetime' }
- { label: 'Description', name: 'description', widget: 'string' }
- { label: 'Body', name: 'body', widget: 'markdown' }