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

Add an option to insert attributes #322

Merged
merged 2 commits into from
Feb 2, 2025

Conversation

elchininet
Copy link
Owner

@elchininet elchininet commented Feb 2, 2025

This pull request implements a new order item property that will add custom attributes to a sidebar item.

Order Items Properties

Property Type Required Description
attributes String or Object no If it is an object it defines a group of attributes
that will be applied to the sidebar item.
If it is a string, then it makes reference
to an object defined in js_variables

Attributes as an object

order:
  - item: 'settings'
    attributes:
      data-my-prop: 'some-prop'
      data-test: 'test-attribute'
      

Attributes as a string (they make reference to a variable in js_variables)

js_variables:
  my_attributes:
    data-my-prop: 'some-prop'
    data-test: 'test-attribute'
order:
  - item: 'settings'
    attributes: 'my_attributes'
      

@elchininet elchininet added documentation Improvements or additions to documentation enhancement New feature or request tests labels Feb 2, 2025
@elchininet elchininet merged commit c2e832b into master Feb 2, 2025
3 checks passed
@elchininet elchininet deleted the add_an_option_to_insert_attributes branch February 2, 2025 01:27
@coveralls
Copy link

Coverage Status

coverage: 100.0%. remained the same
when pulling 2120e59 on add_an_option_to_insert_attributes
into f399f39 on master.

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

Successfully merging this pull request may close these issues.

2 participants