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

Show section (ID) references in the url schema setting #473

Open
1 task done
stijns96 opened this issue Aug 20, 2024 · 4 comments
Open
1 task done

Show section (ID) references in the url schema setting #473

stijns96 opened this issue Aug 20, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@stijns96
Copy link
Contributor

stijns96 commented Aug 20, 2024

Is your feature request related to a problem? Please describe.
We do have some clients that wants a section with links to certain sections on the page. This is not easily possible at the moment. We have to make a section with blocks where they can add a block and then add an ID to the section they want to link to. I was trying to add a "#" to the url settings and hoped to find a hidden gem. What I hoped is that I could receive a list of the existing sections / id's on that page where I could link to.

Describe the solution you'd like
I Actually already described what I'd like to see. A reference to the existing section / id's on the page. I can imagine that finding ID's will be a bit hard, but section do have their own generated id's that I would like to reference to.

Describe alternatives you've considered
Create a text setting per section where the client can fill in an ID. Also create a setting on the link blocks where they can add the same value (ref to ID). The problem with this, is that this would not be bug-free and consistent enough. It will bloat all sections that don't necessarily need this field.

Checklist

  • I have checked and made sure that the proposal adheres to this plugin's principles
@karreiro
Copy link
Contributor

👋 Hi @stijns96, thanks for the suggestion!

If I'm understanding the proposal correctly, I believe we may close #474 in favor of this one, as we could have something like this:

{% for section in sections %}
  {{ section.id }}
  {{ section.group_id }}
{% endfor %}

Please let me know what you think :)

@karreiro karreiro added the enhancement New feature or request label Aug 26, 2024
@stijns96
Copy link
Contributor Author

Hi @karreiro,

Sure thing!

Not sure if sections on itself is clear enough. You might need to know what group you want to loop through, or if it's just the content_for_layout.

@karreiro
Copy link
Contributor

When I was thinking about the sections, I was thinking about something like this to handle #474:

{% assign header_group_sections = sections | where: 'group_id', 'header-group' %}
{% #                                                             ^-- group identifier %}

{% for section in sections %}
  {{ section.id }}
{% endfor %}

However, one limitation of the example above is that users need to know the group identifier in advance (the current group).

With the section_group object/drop (proposed by #474), sections would always be aware of their parent group (if available), allowing them to iterate over it.

I'm going to bring this context to the team for discussion and will update this issue as soon as we have something new :)

Thanks bringing this up!

@stijns96
Copy link
Contributor Author

Mhhh,

That would be hard indeed. What about something like sections['header-group']? Then we're taking away a bit of logic, but I'm not sure if this is technically possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants