Skip to content

Conversation

@nameelza
Copy link

Updated data handling to support flexible field definition in HTML templates. Initially, fields were expected within the mt-fields tag:

<!-- SCHEMA -->
<mt-fields id="artist-fields">
NAME
IMG
LINK
</mt-fields>

Now, added support for embedding fieldnames at the top of data within mt-records:

<!-- RECORDSET -->
<mt-records id="artists-recs">
NAME
IMG
LINK

Elisa Sassi
elisa-sassi-bike-crop.jpg
https://elisasassi.com
...
</mt-records>

This update handles both scenarios: using mt-fields for fieldnames if mt-fields attribute is present and detecting embedded fieldnames in mt-records if mt-fields attribute is absent.

Refactored code to use let and const for scoped variables to improve code reliability by explicitly defining variable scopes, reducing the risk of unintended redeclarations, side effects and conflicts.
Minor styling changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant