decaporg / decaporg/decap-cms

Help Needed With Using Anchor Fields.

Open
#1,079 2 comments 0 reactions 0 assignees View on GitHub
pinned
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

**- Do you want to request a *feature* or report a *bug*?**

Support

**- What is the current behavior?**

I'm working with a YAML Frontmatter File which has Elements that are anchored to another elements. The title value of Array Elements in pricing-head.pricing-head-prices is anchored in pricing.body as a boolean. I hardwrote anchor tags such as &title1 , &title2 etc. How can I make this more flexible such that when the user adds more array elements it automatically creates corresponding elements in pricing.body Is this something that is possible in Netlify? Also is there documentation available on how to add anchor fields?

```yaml
----
layout: pricing
title: SEO Packages
pricing-head:
pricing-head-title:
title: Select the package that best suits your needs
desc: Pay once and save big on subscription costs
pricing-head-prices:
- title: &title1 basic
price: 5999
button:
text: Select
url: '#'
highlight: false
- title: &title2 premium
price: 7999
button:
text: Select
url: '#'
highlight: true
- title: &title3 ultimate
price: 12999
button:
text: Select
url: '#'
highlight: false
pricing-body:
- title: On Page Optimization
fa: fas fa-globe
desc: Optimization done directly within website to improve search rankings
*title1: true
*title2: true
*title3: true
- title: Link Building
fa: fas fa-link
desc: Links are a signal to Google that your site is a quality resource worthy of citation
*title1: true
*title2: true
*title3: true
- title: Keyword Research
fa: fas fa-search
desc: 'Our Professionals Research & Find Keywords that people Search for'
*title1: false
*title2: true
*title3: true

---
```

**- If the current behavior is a bug, please provide the steps to reproduce.**

**- What is the expected behavior?**

**- Please mention your CMS, node.js, and operating system version.**

**- Please link or paste your `config.yml` below if applicable.**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.