Entity Ref Bootstrap Accordion / Tab Formatter:
Simple Bootstrap Accordion / Tab Field formatter for field types "entity_reference , entity_reference_revisions".
So it will be available Paragraphs module as well.
It's a fork to https://www.drupal.org/project/entity_ref_tab_formatter
Library used except Bootstrap :
Bootstrap Responsive Tabs : https://openam.github.io/bootstrap-responsive-tabs/
Use of 3 fields including a type field that has as possible value:
- accordion | Accordion with first open
- accordion_closed | Accordion closed
- tab | Tabs
Project link
https://www.drupal.org/project/entity_bs_accordion_tab_formatter
Git instructions
git clone --branch 8.x-1.x https://git.drupalcode.org/project/entity_bs_accordion_tab_formatter.git
PAReview checklist
https://pareview.sh/pareview/https-git.drupal.org-project-entity_bs_acco...
Comments
Comment #2
netsliverComment #3
rksyraviHi @netsliver,
Thank you for contribution!!!
Give us time for manual testing.
Comment #4
vuilThank you for the contribution!
Please fix the following issues:
1. Please update your
js/bootstrap-responsive-tabs/README.mdfile - each row can not be exceeds 80 chars per line.More info: Drupal Coding Standard
2. ESLint has been found some issues related to Javascript coding standard:
3. Please remove
implements ContainerFactoryPluginInterfacebecause it exists in the extendedFormatterBase.The class declaration above is in
Drupal\entity_bs_accordion_tab_formatter\Plugin\Field\FieldFormatter\EntityBSAccordionTabFormatter.4. Please add the two parameters (
$entity_type_id,$bundle) in the PHPDoc (annotation) because they are missing:5. You can simply use (in
public function settingsSummary()):instead of:
until you decide the future solution.
6. It is better to handle all possible exceptions which will be raised (eventually) in method
viewElements.7. Please don't use deprecated classes / interfaces as
Drupal\Core\Entity\EntityManagerInterfacewhich is deprecated in Drupal 8.0 and is removed from Drupal 9.0.Please see https://www.drupal.org/node/2549139
8. Please replace your parameter $plugin_definitions to be a parameter:
\Drupal\Core\Field\FieldDefinitionInterface $field_definitioninstead of
FieldConfig $field_definition.All points from 3. to 8. are in plugin class
EntityBSAccordionTabFormatter.Comment #5
netsliverHi,
I made the changes:
1 - 2 : I have moved the library to libraries folder
3 : I have removed the implements
4 : I have changed the PHPDoc
5 : I have Simply used your example
6 : try ... catch all the function with logger exception
7 : I have changed the class
8 : I have change the prototype
Comment #6
ankush_03Fix below issue also :
ankushgautam@GGN-199732-C02ZT1F1MD6V contrib % drupal-check -ad entity_bs_accordion_tab_formatter
4/4 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
------ -------------------------------------------
Line entity_bs_accordion_tab_formatter.install
------ -------------------------------------------
17 Function libraries_get_path not found.
------ -------------------------------------------
------ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Line src/Plugin/Field/FieldFormatter/EntityBSAccordionTabFormatter.php
------ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
76 Unsafe usage of new static().
💡 Consider making the class or the constructor final.
179 Method Drupal\entity_bs_accordion_tab_formatter\Plugin\Field\FieldFormatter\EntityBSAccordionTabFormatter::viewElements() should return array but return statement is missing.
201 Call to an undefined method Drupal\Core\Entity\EntityInterface::get().
207 Call to an undefined method Drupal\Core\Entity\EntityInterface::get().
212 Call to an undefined method Drupal\Core\Entity\EntityInterface::get().
214 Variable $style might not be defined.
224 Variable $style might not be defined.
225 Variable $style might not be defined.
237 Variable $style might not be defined.
238 Variable $style might not be defined.
244 Variable $style might not be defined.
254 Variable $style might not be defined.
256 Variable $component_id might not be defined.
257 Variable $style might not be defined.
260 Variable $style might not be defined.
265 Variable $style might not be defined.
266 Variable $component_id might not be defined.
269 Variable $style might not be defined.
270 Variable $style might not be defined.
273 Variable $style might not be defined.
275 Variable $style might not be defined.
281 Variable $style might not be defined.
291 Variable $style might not be defined.
301 Variable $delta might not be defined.
305 Variable $component_id might not be defined.
308 Variable $style might not be defined.
309 Variable $delta might not be defined.
310 Variable $delta might not be defined.
------ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[ERROR] Found 29 errors
Comment #7
netsliverEverything is ok except Call to an undefined method Drupal\Core\Entity\EntityInterface::get() which I don't understand because the code works.
Comment #8
avpadernoThere was already an application opened using the same project. I am closing this as duplicate, and re-opening the other one.