I really like this module, but found some limitations, so I thought I could make it better.
So here's a big patch fixing/improving lots of things. I also attached the whole module updated.
Let me know if you'd like me to split this patch into several smaller ones.
- Node Class location: I created a page for settings to set if the class is supposed to be displayed in the body tag, in the node, or both.
- Node Class widget: By default Node Class shows a textfield, but there is the option to have a dropdown (to select one value), or an autocomplete field (to select multiple values).
- Source of autocomplete / dropdown: Here we have two options: "database" means it'll find all values already pre-entered, and "predefined set of values". In that case a textarea will appear where it's possible to enter a list of classes.
- Code cleanup: fixing white spaces and comments to follow Drupal best practices (thanks to Coder). I also removed the Readme file since it was only describing D6 behavior.
- A specific permission also exists to administer the settings.
Comment | File | Size | Author |
---|---|---|---|
#5 | patch_apply.png | 7.97 KB | dineshw |
#5 | node_class_location_coder_fixes_v7.x-1.x-2229045-5.patch | 13.69 KB | dineshw |
#3 | support-body-class-2229045-3.patch | 13.26 KB | dineshw |
#2 | Screenshot from 2015-08-22 16:15:28.png | 137.92 KB | sumanthkumarc |
#2 | Node Class | Drupal standard 2015-08-22 16-09-58.png | 60.36 KB | sumanthkumarc |
Comments
Comment #1
JurriaanRoelofs CreditAttribution: JurriaanRoelofs commented+1, nice patch --I also reviewed your block_class patch. This needs to be reviewed by 2 people before it can get committed, if someone is interested in using this improvement please review here.
Works as advertised for me.
by the way it needs to patch against 7.x-1.3, it won't patch against latest dev because the 7.x-1.x branch does not contain the commits from recent tags.
Comment #2
sumanthkumarc CreditAttribution: sumanthkumarc as a volunteer commentedI have tested it with dreditor simplytest.me link. Tried both body and node separately. Working fine in both cases. Tried predefined set of values. Working fine. Attaching screenshots.
Comment #3
dineshw CreditAttribution: dineshw as a volunteer commentedHello @JurriaanRoelofs and @Stanto
I tried to apply patch over git but it was not successful,
I feel you can try creating patch again.
For reference, I have created patch from files you have given in node_class.zip which is working perfectly fine as tested by @sumanthkumarc.
@sumanthkumarc can you re test the patch I provided using?
Comment #4
sumanthkumarc CreditAttribution: sumanthkumarc as a volunteer commentedI tested the patch provided by @dineshw and its applying good on branch 7.x-1.x. It's working as expected.
Comment #5
dineshw CreditAttribution: dineshw as a volunteer and at TATA Consultancy Services for Pfizer, Inc. commentedAdded More Cleaner version of patch based on current 7.x-1.x Branch,
Contains Fixes for
Working Fine! Needs Review!
Comment #6
nidhi.badani CreditAttribution: nidhi.badani as a volunteer and commentedComment #7
madzakaria CreditAttribution: madzakaria commentedHello guys, may i know how to apply the patch ?
Comment #8
dineshw CreditAttribution: dineshw as a volunteer commentedfollow
https://www.drupal.org/project/node_class/git-instructions
https://www.drupal.org/node/1054616