-
-
Notifications
You must be signed in to change notification settings - Fork 315
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
Remove local options from essence editors #1638
Conversation
014c7e2
to
f575b22
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay for the simplification, this is great I think. However, I believe a deprecation warning makes sense if the functionality is still there but to be removed in the future. As we're removing the functionality in this PR, I think it's more appropriate to raise instead.
Yeah, absolutely for - have never used that. |
2214120
to
477287f
Compare
And the default value set correctly on the newly build essence object.
Read the crop and size settings from one canonical source the content settings defined in the elements.yml This reduces complexity and prevents hard to track down errors.
Rely only on the content settings for sizing and cropping settings.
All settings a content might have are set on the contents definition settings key.
This was only done because we supported to have local options in the element editor and essence editor partials. We do not support this anymore and expect to use static content.settings instead.
Passing options as locals to essence editors is not possible anymore. Static values should be set on the content settings on the contents defintion in elements.yml instead. For dynamic values please use a custom essence class.
477287f
to
f0ed7a0
Compare
What is this pull request for?
Why? Passing around
options
hashes from the element editor views into the essence editor views and even in the params is error prone and not necessary in most of the time. We already have thesettings
key on the contents definition in theelements.yml
.Notable changes
This removes the local
options
andhtml_options
hashes passed to the essence editor partials. Stop passing localoptions
from all element editor partials into essence editors.Please set all options you have passed into the essence editor on the content definition itself.
Example
will become
Q: But what about dynamic options?
Sometimes you want to pass dynamic instead of static options into the essence editor. Like for a selection of pages you want to let chose an editor from.
A: Create an essence for this
Using an essence for multiple purposes is often not the best way of implementing those use cases. Imagine a event select for instance.
Instead of storing the
Event#id
in a string column of theEssenceText
orEssenceSelect
you should add your own custom essence (sayEssenceEvent
) and add aevent_id
foreign key and set theevent
asingredient_column
.Another good example is the Alchemy Solidus extension. It provides
EssenceSpreeProduct
andEssenceSpreeTaxon
essences to work with.This is a much more reliable approach of using dynamic values in your Alchemy instance.
B: Use
EssencePage
to reference pagesIf you want to reference a page you can use the newly introduced
EssencePage
.