Hi,
thank you for this great module.
Is jquery dependencies removal planned?
Issue fork faqfield-3229219
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
mlncn commentedPossible to do this only with CSS. Would other people using this module be interested in that?
Comment #3
tgoeg commentedDefinitely. JS seems unnecessary when pure CSS can achieve the same. In fact, I'm searching for a CSS-only solution and haven't installed this module just because it needs JS :-)
See this CSS-only example that works nicely:
https://codepen.io/jonyablonski/pen/DBXPzm
Might also be better for a11y this way.
Comment #4
redseujacYes, surely I am, especially now Drupal 10 is coming!
Comment #5
heddn@redseujac @tgoeg happy to remove the dependency if someone wants to move the example into a patch or merge request.
Comment #6
nelo_drup commented#5 I think the configuration from the module would be optional if you want to use jquery, but as they say, it is best to use only css, besides, I have the following problem when installing with composer:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires drupal/faqfield ^7.1 -> satisfiable by drupal/faqfield[7.1.0].
- drupal/faqfield 7.1.0 requires drupal/jquery_ui_accordion ^2.0 -> found drupal/jquery_ui_accordion[2.0.0] but the package is fixed to 1.1.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
Comment #7
avpadernoComment #10
pfrenssenI have done a first pass at this. I am in the same position as @tgoeg, I need a FAQ solution and this module fits my requirements but if it comes with jQuery baggage I don't want to install it.
I have adapted the codepen example so it looks quite closely to the default theming of jQuery accordion. I also provided an update hook to transform the view mode configuration.
Obviously we are losing some functionality that comes with jQuery UI, we can now no longer trigger JS events, choose the animation style etc. For me personally this is not a loss, but existing users might want to keep it. Maybe a solution could be to offer a submodule that still integrates with jQuery UI for our existing projects?
Comment #11
pfrenssenComment #12
stolzenhain commentedThanks @pfrenssen for this great patch. It currently needs the dev version to work + fails on the
8.0.1release.Totally agree that
1. this module best satisfies the need for a simple multifield + editor
2. it's always easier to not mangle UI settings and JS injection on the base module
A proposition to this approach would be to not only pass the original UI settings in a submodule but even this HTML-only template, as not everybody needs the accordion function.
So people could choose to simply use this module for storing fields and running their own templating or activating your prepared simple template or the JS solution via an included submodule.
Comment #13
heddnLet's go w/ a new major and this simplified version. We don't need accordion.
This removes the jQuery UI dependency. The accordion formatter now uses native elements with CSS only.
- Update required: run drush updb. It removes the old height, collapsible, event and animation settings from saved displays.
- Theme overrides: the accordion template and theme hook are renamed from faqfield-jquery-accordion-formatter to faqfield-accordion-formatter, so override the new name.
- Browser support: only one question stays open at a time in browsers that support (Chrome 120, Safari 17.2, Firefox 130); while older browsers may behave differently.
Comment #15
heddnComment #17
pfrenssenThanks very much @heddn!