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

Alchemy essence headline #2060

Merged
merged 3 commits into from
Apr 10, 2021
Merged

Conversation

mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Apr 8, 2021

What is this pull request for?

This introduces an Alchemy::EssenceHeadline. It has the following features:
When used as a preview text, it will show the level of the headline so
that content editors can see what levels they are using. There are is
also an optional level element.

Headlines can be configured through their content settings. One can
restrict the sizes and levels available to an element, by specifying them
like follows:

    - name: MyComponent
      contents:
         - name: my_headline
           type: EssenceHeadline
           settings:
              levels: [3, 4]
              sizes: [3]

If, as in the previous example, sizes only has one option, the select
input in the element editor will not be displayed.

If sizes is unconfigured, the default will be an empty array, and the
essence will have no size class.

Checklist

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

@mamhoff mamhoff force-pushed the alchemy-essence-headline branch from d29208c to ef24726 Compare April 8, 2021 08:07
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice addition. I have some comments. Also we miss the editor partial.

app/models/alchemy/essence_headline.rb Outdated Show resolved Hide resolved
app/models/alchemy/essence_headline.rb Outdated Show resolved Hide resolved
app/views/alchemy/essences/_essence_headline_view.html.erb Outdated Show resolved Hide resolved
@mamhoff mamhoff force-pushed the alchemy-essence-headline branch from ef24726 to f2a83f6 Compare April 9, 2021 09:50
@tvdeyen tvdeyen added this to the 6.0 milestone Apr 9, 2021
mamhoff added 2 commits April 9, 2021 14:31
This adds an Alchemy::EssenceHeadline. It has the following features:
When used as a preview text, it will show the level of the headline so
that content editors can see what levels they are using. There are is
also an optional `level` element.

Headlines can be configured through their content settings. One can
restrict the sizes and levels available to an element, by specifying them
like follows:

```yml
- name: MyComponent
  contents:
     - name: my_headline
       type: EssenceHeadline
       settings:
          levels: [3, 4]
          sizes: [3]
```

If, as in the previous example, `sizes` only has one option, the select
input in the element editor will not be displayed.

If `sizes` is unconfigured, the default will be an empty array, and the
essence will have no size class.
If we do not pass the content when building an essence,
`after_initialize` hooks do not have access to the content definitions.
@mamhoff mamhoff force-pushed the alchemy-essence-headline branch from f2a83f6 to defd7df Compare April 9, 2021 12:31
spec/dummy/.bundle/config Outdated Show resolved Hide resolved
spec/dummy/config/alchemy/elements.yml Show resolved Hide resolved
@mamhoff mamhoff force-pushed the alchemy-essence-headline branch from defd7df to 7672849 Compare April 10, 2021 09:52
This is good to test this essence locally.
@mamhoff mamhoff force-pushed the alchemy-essence-headline branch from 7672849 to 25528c7 Compare April 10, 2021 10:04
@tvdeyen tvdeyen merged commit 8aaad84 into AlchemyCMS:main Apr 10, 2021
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

Successfully merging this pull request may close these issues.

2 participants