New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple fields #6

Open
walidvb opened this Issue Sep 20, 2018 · 7 comments

Comments

Projects
None yet
3 participants
@walidvb
Copy link

walidvb commented Sep 20, 2018

Wondering how to add multiple images to a single section?
Pointers to where that should be changed are appreciated, would love to take a look when i find a moment if it's not a priority! From what I quickly gathered:

  • update BaseDirective.input to allow an 'Add more' button
  • update BaseDirective.serialize to return an array of values if multiple inputs

awesome job on the rest, and awesome idea, thanks!

@srobbin

This comment has been minimized.

Copy link
Contributor

srobbin commented Oct 5, 2018

@walidvb: I can see how this would be useful, but there are some feature requests that might resolve to a different solution, and a temporary workflow to handle the existing need.

Regarding a temporary workflow, it's possible to use a second section to handle multiple images/fields. For example:

{{#section about}}
  <h2>About Us</h2>
  {{#section about_slideshow multiple=true}}
    {{photo type=image}}
  {{/section
{{/section}}

In terms of related feature requests, here are a few proposals being discussed:

Nested Sections (#12)
The ability to nest "Slideshow" under "About Us" in the nav.

Custom Directives (#57)
Allowing custom directives should give you the ability to extend Vapid, and create a multi-image plugin. I'll address the comment you've made in that thread there, directly, but for readability's sake I'll summarize here: I think it's fine if people decide to make presentational directives. I agree that they don't have a place in core; custom directives would give people the freedom to move in any direction that suits their needs, regardless of how it fits into Vapid's ethos.

Content alias / reference (#60)
If I understand this one correctly, they'd like to be able to reference one section from another. e.g., {{#section blog_posts}} can reference {{#section categories}}.

@walidvb

This comment has been minimized.

Copy link
Author

walidvb commented Oct 5, 2018

I see the work around. Multiple fields sounds pretty basic functionality(no less than other mentions). Curious to hear other opinions, and guess this decision will be left to #57

@walidvb

This comment has been minimized.

Copy link
Author

walidvb commented Nov 15, 2018

Just want to repeat the suggestion made by @martonlente in #94, which actually allows multiple/repeated fieldsets, rather than mutiple/repeated field

{{#section about}}
<div>
  <h2>{{title}}</h2>
  <ul>
    {{#repeat}}
      <li>
        <h5>{{school}}</h5>
        {{city}}, {{state}}
      </li>
    {{/repeat}}
  </ul>
</div>
{{/section}}
@martonlente

This comment has been minimized.

Copy link

martonlente commented Nov 15, 2018

Thanks @walidvb for confirming this. I think it could be a simple, but good solution for many ideas of #57 too.

@walidvb

This comment has been minimized.

Copy link
Author

walidvb commented Nov 16, 2018

Come to think of it, fieldsets are more relevant to nested sections in #12, I think.
Multiplicating one unique field also requires a much different UI rendering, I imagine.

@martonlente

This comment has been minimized.

Copy link

martonlente commented Nov 17, 2018

I think it's really worth having a look on how it's implemented in Perch CMS, even if Vapid is a completely different product, as it's so close to how sections actually work: https://youtu.be/QWm_gjcGSFo. Craft CMS has a similar feature too, so it's a feature not specific to a certain CMS.

@stale

This comment has been minimized.

Copy link

stale bot commented Feb 15, 2019

This issue has been automatically marked as stale after 90 days of inactivity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Feb 15, 2019

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