Custom fields in Amplify layouts
Custom fields let you render article metadata that Marfeel does not extract by default, such as subtitles, author photos, or sponsor logos, directly in your Amplify layouts and post templates. Configure Custom Fields to sync to Amplify, and the extracted values become available for social media images and personalized post text.
Access custom fields in layout templates
Section titled “Access custom fields in layout templates”Custom fields synced to Amplify are delivered inside each article’s data under the customProperties key. Access them in your HTML and CSS templates with dot notation:
{{customProperties.yourFieldName}}Custom properties are available alongside the standard article properties (title, description, img, url, sections, authors). The same customProperties key is also available in Recommender layouts when you sync a field to both destinations.
Example: add a subtitle to the social image
Section titled “Example: add a subtitle to the social image”Many articles include a subtitle or subheadline in their HTML that Marfeel does not extract by default. Extract it with a custom field and render it below the headline on your social image.
Custom Field configuration:
| Setting | Value |
|---|---|
| Expression | //h2[contains(@class,"subtitle")] |
| Extract | Text Content |
| Save as | Custom field: subtitle |
| Sync to | Amplify |
HTML template:
<article data-mrf-amplify-id="subtitle-layout" class="amplify-wrapper"> {{#each content.posts}} <div class="mrf-amplify-image-container"> <img class="mrf-amplify-image" data-mrf-amplify="image" src="{{img}}" alt="{{title}}" /> <div class="mrf-amplify-backdrop"></div> </div> <div class="mrf-amplify-title-container"> <h2 class="mrf-amplify-title" data-mrf-amplify="title" contenteditable="plaintext-only">{{title}}</h2> {{#customProperties.subtitle}} <p class="mrf-amplify-subtitle">{{customProperties.subtitle}}</p> {{/customProperties.subtitle}} </div> {{/each}}</article>The {{#customProperties.subtitle}} block conditionally renders the subtitle. Articles without one display the headline only.
Example: display the author’s photo
Section titled “Example: display the author’s photo”Extract the author’s profile image from your article’s structured data and overlay it on the social image.
Custom Field configuration:
| Setting | Value |
|---|---|
| Expression | $.@graph[?(@.@type=="Person")].image.url |
| Extract | — |
| Save as | Custom field: authorImage |
| Sync to | Amplify |
HTML template:
<article data-mrf-amplify-id="author-layout" class="amplify-wrapper"> {{#each content.posts}} <div class="mrf-amplify-image-container"> <img class="mrf-amplify-image" data-mrf-amplify="image" src="{{img}}" alt="{{title}}" /> <div class="mrf-amplify-backdrop"></div> {{#customProperties.authorImage}} <img class="mrf-amplify-author-photo" src="{{customProperties.authorImage}}" alt="{{authors.[0]}}" /> {{/customProperties.authorImage}} </div> <div class="mrf-amplify-title-container"> <h2 class="mrf-amplify-title" data-mrf-amplify="title" contenteditable="plaintext-only">{{title}}</h2> </div> {{/each}}</article>The {{#customProperties.authorImage}} block only renders when an author image exists, so articles without one display cleanly.
Going Deeper
Section titled “Going Deeper”- Custom Fields — Configure extraction rules and sync destinations
- Amplify Layouts — Full layout structure, templating, and interactive elements
How do I access custom fields in an Amplify layout template?
Custom fields synced to Amplify are delivered under the customProperties key in each article’s data. Access them in your HTML and CSS templates with dot notation: {{customProperties.yourFieldName}}.
What happens when a custom field value is missing for an article?
Use Handlebars block syntax like {{#customProperties.fieldName}} to conditionally render the element. Articles without the field display cleanly because the block is skipped entirely.
Can I use custom fields alongside standard article properties?
Yes. Custom properties are available alongside the standard article properties such as title, description, img, url, sections, and authors.