Skip to content

Deprecate Content Areas #620

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

Closed
Tracked by #617
BlakeWilliams opened this issue Feb 14, 2021 · 4 comments
Closed
Tracked by #617

Deprecate Content Areas #620

BlakeWilliams opened this issue Feb 14, 2021 · 4 comments

Comments

@BlakeWilliams
Copy link
Contributor

Before the 3.0 release we should deprecate content areas suggesting that existing usage is migrated to Slots V2. This will give users of the library time to migrate to slots before the V3 release, which will remove content areas.

part of #617

@dvantuyl
Copy link

Apologies if I'm misunderstanding Slots V2 usage, but it doesn't seem to cover the basic use case where Content Areas allowed multiple named slots:

with_content_areas :header, :body

This doesn't work since the second arg of renders_one is expecting a class:

renders_one :header, :body

This also doesn't work as the content in :body is ignored:

renders_one :header
renders_one :body

Is this a bug? Or is there another way to use renders_one that isn't explained in the documents.

@BlakeWilliams
Copy link
Contributor Author

@dvantuyl The last example should work similar to how content areas work. I think we have test coverage around it via the SlotsV2Component in the test suite.

If it's not working, could you open a PR with a failing test?

@dvantuyl
Copy link

Thank you @BlakeWilliams. After testing around my issue, SlotsV2Component are working for the most part with multiple renders_one. SlotsV2Component only breaks when the parent template containing the view_component is in HAML. ERB parent templates are working as expected.

I've converted my parent templates to ERB for now and will work on PR with failing HAML tests.

@joelhawksley
Copy link
Member

Closed by #763

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

3 participants