1

I have created in Craft 2 CMS, under the profile of users (ex. parents), new tab for (children), where parents can fill in there children information.

The data is saved in a database under the craft_content

How can I use the dropdown in a Twig file, data for child to be shown?

Can anyone help with the code?

I have installed Neo plugin in Craft CMS

  • Hi Sven, it's hard to tell exactly what you're looking for here. Are you building a front-end entry form, and you need to add a dropdown menu? – Lindsey D Jan 17 at 17:35
  • I have all ready created form, for parents profile that has child info. On website i need to add dropdown menu, in which is information of there children, so parents when is log on website, don't need to fill out information for children, they can choose from dropdown. – Sven Pomykalo Jan 18 at 9:01
1

I have all ready created form, for parents profile that has child info. On website i need to add dropdown menu, in which is information of there children, so parents when is log on website, don't need to fill out information for children, they can choose from dropdown.

It sounds like you want to loop through the children (Entries?) and output the data as a dropdown menu...

{% set children = craft.entries.section('children').all() %}

<select name="fields[children]">
    {% for child in children %}
        <option value="{{ child.id }}">{{ child.title }}</option>
    {% endfor %}
</select>

For more information, see this thread...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.