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

Allow to add anchors to ingredients #2395

Merged
merged 10 commits into from
Dec 16, 2022
Merged

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Dec 12, 2022

What is this pull request for?

Allow to set anchors on headline and text ingredients

It is common to add so called anchors (technically they are dom_ids) and link to them from the same page as jump marks or from posts and mails.

In order to use this for Headline and Text ingredients you need to enable this in the ingredients settings:

- name: some-element
  ingredients:
    - name: headline
      type: Headline
      settings:
        anchor: true # or a "fixed value" or `from_value` for automatic anchors

Screenshots

anchor-lnks

headline-automatic-anchor

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

@tvdeyen tvdeyen force-pushed the add-anchors branch 4 times, most recently from 5fbff21 to 15e8bf1 Compare December 15, 2022 09:32
We have a essence picture edit view spec, but not one for the ingredient.
This allows to be able to link to the ingredient with an anchor.
@tvdeyen tvdeyen force-pushed the add-anchors branch 2 times, most recently from 7035ed4 to ec06e5b Compare December 15, 2022 13:45
@tvdeyen tvdeyen marked this pull request as ready for review December 15, 2022 13:47
@tvdeyen tvdeyen changed the title WIP Add anchors feature for ingredients Allow to add anchors to ingredients Dec 15, 2022
Text ingredients are often used as headlines or section
headings. Those should be linkable with anchor links.

You need to enable this in the ingredients settings

    - name: headline
      type: Text
      settings:
        anchor: true
Headlines are often linked to with anchor links.

You need to enable this in the ingredients settings

    - name: headline
      type: Headline
      settings:
        anchor: true
Will be used by admins only to load ingredients for the DOM ID
select in the link dialog.
We now have ingredients that have dom_id stored that we can use
as anchor in the link dialog.
There might be data attributes on ingredient classes,
that do not have corosponding attributes on the
essence class.
@tvdeyen tvdeyen enabled auto-merge December 16, 2022 06:00
@tvdeyen tvdeyen merged commit 8b4da49 into AlchemyCMS:main Dec 16, 2022
@tvdeyen tvdeyen deleted the add-anchors branch December 16, 2022 06:08
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