Views Nested Accordion is extension to Views Accordion which helps in creating Nested Accordions. View Accordion creates single level accordion in which the accordion functionality is triggered only by the inner most header. Views Nested Accordion helps in implementing the accordion on the group header as well.

Requirements
Features
- Extends the basic functionality of Views Accordion on the grouped field.
- When the accordion is grouped by multiple fields then Views Nested Accordion will implement Accordion functionality on each grouped header.
Installation
- Install as usual, see https://drupal.org/documentation/install/modules-themes/modules-7 for further information.
- Enable Views Nested Accordion on the Module list page.


Sandbox Link
https://www.drupal.org/sandbox/anil280988/2303527
Git Clone
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/anil280988/2303527.git views_nested_accordion
Manual reviews of other projects
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | node_revision.png | 35.07 KB | howto |
| #11 | nestedaccordion.png | 93.69 KB | howto |
Comments
Comment #1
anil280988 commentedComment #2
anil280988 commentedComment #3
anil280988 commentedComment #4
anil280988 commentedComment #5
anil280988 commentedComment #6
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxanil2809882303527git
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #7
anil280988 commentedComment #8
anil280988 commentedYes I have checked these error. These error cannot be removed as the module is dependent on the Views Accordion module, which itself have these errors. As I have extended the Views Acccordion class so the error in naming convention will be inherited from it.
Comment #9
howto commentedManual review
Line 10, file views_nested_accordion_style_plugin.inc
Your class name should be views_nested_accordion_style_plugin to match with parent class name.
Line 11, file views_nested_accordion.module, function views_nested_accordion_views_api()
Your views api path should be drupal_get_path('module', 'views_nested_accordion') . '/views'
Line 32, file views_nested_accordion_style_plugin.inc, function options_form()
You shoud use single quote in function t() (like the previous one)
Line 39, file views_nested_accordion_style_plugin.inc, function pre_render()
You should remove this method because it does nothing.
Comment #10
anil280988 commented1. I have followed the coding standards as suggested by automated review tools. Classname should always start with the Capital Letter. If not then automated review tools will show error.\
2. I have followed the folder of the parent module where files were at the root of module.
3. Thanks for the suggestion. I have changed to single quote.
4. Thanks for the suggestion. The reason I have used "1" is the value saved in Drupal.settings is 0 and 1. Still I have changed the value to "TRUE".
Comment #11
howto commentedHi anil280988,
Line 50, file views_nested_accordion_style_plugin.inc, function render()
I think this is not related to the value saved in Drupal.settings. It's just compare value stored in database (style options) with a value.
For example: You can see form element checkbox in form create/edit Article and the code in file node.module, line 1108
I debug (use Netbeans and Xdebug) and find that the value $this->options['nestedaccordion'] is integer.
So, i think the best way to make a comparison is use function empty() like revision in node.
Line 10, file views_nested_accordion_style_plugin.inc
I think PA Review is not always true.
For example: i create new views plugin display and overwrite method options_form(). When i check with PA Review, i get this error:
This can not be fixed because method options_form() must have the same name with parent class.
I find that the class name of views plugin is alway in lowercase (in module Views and other module contrib).
https://api.drupal.org/api/views/plugins%21views_plugin_style.inc/group/...
Comment #12
anil280988 commentedHello,
The value 1 and 0 shows the status of the nested accordion checkbox. By default it is uncheck so the value will be 0. If checked it will be one.
Also I had followed the name pattern as parent class but due to error shown by PA Review I changed the name of the class. But now I have reverted it.
Comment #13
anil280988 commentedComment #14
nagarro_nikhil commentedIts working fine on my end. Solved my problem.
Thanks!!!
Comment #15
anil280988 commentedComment #16
nagarro_nikhil commentedComment #17
anil280988 commentedComment #18
nagarro_nikhil commentedComment #19
anil280988 commentedComment #20
laceysanderson commentedHi @Anil280988,
First of all I wanted to tell you that your module looks very good. I like the cleanness of your solution and the functionality is one that I have needed in the past. Good job :)
Automated Review
Your automated review came back clean except for the class & method names that you have already explained need to stay that way due to inheritance.
Manual Review
Individual user account: Yes.
Master Branch: Follows guidelines.
Licensing: None included (Follows guidelines).
3rd party code: Doesn't appear to include any.
README.txt/README.md: Follows Guidelines content-wise although "Summary" should be "Introduction". Your formatting for headings is off though. See: https://www.drupal.org/node/2181737.
Code long/complex enough for review: Yes. Meets minimum requirement of 5 functions and >120 lines.
Secure code: Yes, as far as I can tell.
Coding style & Drupal API usage: As mentioned above, the outstanding coding style deviations are necessary to override an existing class. One small bug that I noticed was a PHP-style single-line comment (//) in your CSS file. You should always use /* */ comments in CSS. Your usage of the Views API looks spot on to me.
No Duplication
Although I like the functionality this module provides, I wonder if it wouldn't be more useful and accessible if it were added to the existing views accordion module. Have you contacted the module maintainers proposing this? That said, the project application process is supposed to focus on the applicants skills and I feel this module shows that you have a good understanding of Drupal hooks including advanced views programming.
Just an added suggestion, I think your views_nested_accordion_style_plugin.inc file should be nested in a views folder and your views-view-accordion.tpl.php file should be nested in a theme folder. Many modules organize their files this way and it just makes it easier to see what's available at a glance.
Since there are no major problems that I can see, I'm marking this as "Reviewed & Tested by the Community" :)
Comment #21
anil280988 commentedHi @laceysanderson,
Thanks for the review. I have made changes in the README.txt as suggested.
As Views Nested Accordion inherits the Views Accordion module so we have followed the naming pattern and the folder structure of the base module.
Comment #22
anil280988 commentedComment #23
anil280988 commentedComment #24
pingwin4egHello @anil280988
There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxanil2809882303527git
Manual review:
(function ($) { ... })(jQuery);inside behavior's attach() method. Behaviors declaration should be inside it.description = "Create Nested Accordion"is not very descriptive in the .info file.; Information added by Drupal.org packaging script on 2014-07-09andcore = "7.x"should be removed. They are added by drupal.org packaging system automatically.Can you explain how exactly it prevents the mayhem. I don't see any reason for implementing this method too.
Comment #25
anil280988 commentedHi @pingwin4eg,
Thanks for taking time to review the module. I have worked on the input provided by you. The errors reported by automated review tools are false positive. These error cannot be removed as the module is dependent on the Views Accordion module, which itself have these errors. As I have extended the Views Acccordion class so the error in naming convention will be inherited from it.
1. Done. Declared Behavior's attachment inside function ($).
2. Added the comments in the JS.
3. Change Module description so it's more self-explanatory.
4. Changed info file.
5. Yes the option form add the check-box to the form so that it will implemented nested Accordion functionality. If not checked it will work as simple Accordion, that is if user want to group Accordion with more then one header but doesn't want to implement Accordion functionality on 2nd header.
6. Yes this function was not require to be redeclared as its already inherited from base module. So I have removed it.
7. Basically, I have inherited the base module and created a new view style from it by adding a new form element, which when checked will implement the nested accordion functionality.
Comment #26
mpdonadioAutomated Review
$ pareview.sh http://git.drupal.org/sandbox/anil280988/2303527.git
Git default branch is not set, see the documentation on setting a default branch.
Review of the 7.x-1.x branch (commit 67e9037):
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
These are false positives b/c of Views conventions.
Manual Review
(+) The behavior gets two parameters, contect and settings. You also should use these instead of the globals.
You should use .hasClass() instead of manually splittng .attr('class')
The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
Not much to this module; not seeing any blocking issues. Keeping single project tag and setting RTBC for another admin to have a look.
If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.
This review uses the Project Application Review Template.
Comment #27
klausiRemoved one review link which did not contain a manual review.
Comment #28
klausimpdonadio's comment has not been addressed yet, but otherwise looks good to me.
Thanks for your contribution, anil280988!
I promoted this project for you: https://www.drupal.org/project/views_nested_accordion
Now that this experimental project has been promoted, you'll need to update the URL of your remote repository or reclone it.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.