Skip to content
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

Allowing multiple portal-content's for one id #3

Open
knownasilya opened this issue Jan 4, 2016 · 4 comments
Open

Allowing multiple portal-content's for one id #3

knownasilya opened this issue Jan 4, 2016 · 4 comments

Comments

@knownasilya
Copy link

See my example here https://github.com/knownasilya/ember-yielded-portals

In the drawbacks section I mention that the last use of the same portal will be the only one rendered. Is there a way we could append additional ones instead of replacing?

@rlivsey
Copy link
Member

rlivsey commented Jan 4, 2016

Currently a portal's content is rendered if it's the last item in the stack:

This is determined here in the component and the if is here in the template.

Showing all items would be as simple as removing the if in the template, so could potentially be configurable on a per-portal basis.

Maybe something like:

{{portal-for name="foo" show="all"}}

vs (default) of

{{portal-for name="foo" show="last"}}

I'm not sure if there would ever be a use-case for only ever showing the first item in the stack:

{{portal-for name="foo" show="first"}}

@knownasilya
Copy link
Author

It might be nice to toggle, so you sort by date, and show newest, oldest or all.

@knownasilya
Copy link
Author

Technically you could just override the CP with {{#portal-content for='footer' showingPortalItem=true}} or am I wrong?


Yes, setting showingPortalItem=true allows appending them in order.

@knownasilya
Copy link
Author

Seems like that option should be on the portal-for though, like your suggestion.

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

No branches or pull requests

2 participants