verbb / vizy

A flexible visual editor for Craft CMS
Other
44 stars 8 forks source link

Duplicate names or handles creates issue #40

Closed letisanchez closed 2 years ago

letisanchez commented 3 years ago

Description If you use the same handle for the field, as well as for the vizy group block handle, it will not output the content. Doesn't give any kind of error either, just leaves the section blank on the browser for that particular item.

Steps to reproduce

  1. Create 'Heading' field with handle 'heading'.
  2. Create Vizy field.
  3. In vizy field, add a group labeled the same as the field created in step 1. Group name: Heading, block name: "Heading", handle: heading.
  4. Assign your template and save.
  5. Use <h1>{{ heading }}</h1> on twig template file.
  6. Check browser - it outputs nothing for the heading.

Additional info

Additional context I repeatedly changed the names between the heading field and the heading group in the vizy field. Changing the group name to 'headline text' seems to have fixed the issue, or a combination of altering the field names. Couldn't find anything in the documentation that mentioned having to use a unique name from the field, but something to maybe include in the documentation?

engram-design commented 3 years ago

There shouldn't be any sort of restrictions like that, so that seems quite odd.

Here's my setup which is working. Let me know if I've missed anything from your setup.

image

image

image

_entry.html

<p><strong>{{ entry.type.name }}</strong></p>

{{ entry.vizyHeading.renderHtml() }}

_blocks/heading.html

<h1>{{ heading }}</h1>