Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Wolfflow on
Hi, that is regarding mostly html code test:
I have tried to build a simple "Field-Test-page" here is the code
<div><fieldset class=" collapsible"><legend class="collapse collapsed-processed"> Fieldset </legend><div class="fieldset-wrapper"><div class="table-wrapper"><table class="one"><thead><tr><th class="checkbox">Enabled</th><th>Name</th><th>Version</th><th>Description</th></tr></thead><tbody><tr class="odd"><td class="checkbox"><div class="form-item" id="status"><label class="option"><input type="checkbox" name="status[enabled]" id="edit-status-one" value="oneunlock" checked="checked" class="form-checkbox" /> </label></div></td><td><strong><label for="edit-status-one">Fieldset</label></strong></td><td class="versione">Version</td><td class="description">Description</td></tr></tbody></table></div></div>
Though that if I see the page in preview the fieldset is collapsible but saving the page no more collapsible.
I have analyzed the source trying many changing of the code but without succeeding.
Any hint?
Comments
The problem is that the
The problem is that the javascript used to achieve this is loaded when you are in the admin sections (because there are collapsible fieldsets present), but when viewing the node the javascript isn't loaded. Unfortunately I can't recall how to overcome this, but I'm sure it's simple. Btw, can you tell us what version of Drupal you're using?
Sure, forgot to mention,
Sure, forgot to mention, 6.10. So all I have to do is to call the collapse.js whithin the node. I think there is a function for that. Thanks
If you look at word and nouns you do not clearly understand
take a look at Common Terminology
if is missing feel free to post a comment - ;-)
Contact me for drupal projects in English, German, Italian, Drupal Hosting Support.
Ok, thought is not the best
Ok, thought is not the best solution yet, as because for we newbies that just want to experiment with some test-page doings and not have to study for hours how independently JavaScript code(files) can be loaded within a single node
see Ajax Load or Have php snippet that needs to add a javascript onload event to the body element I will provide here my very simple example:
1. Step
- Insert any JavaScript code or a cloned .js file that you will find in your Drupal installation/folder misc/
in this example I copied the content of collapse.js file in my new page or story node-type and add some very important HTML code that initially you get mad to realize (
<!--
after the beginning script-type declaration and//-->
at the "end" and before the closing script-type declaration).Here the collapse.js content
2. Step
add your HTML code that needs the JavaScript Functions or as in this Fieldset-Example the code above.
It should work ! see my Filedset-Test Page
Enjoy
Contact me for drupal projects in English, German, Italian, Drupal Hosting Support.
please no!
Copy & Paste is so wrong.
Here is your answer
.dan.
if you are asking a question you think should be documented, please provide a link to the handbook where you think the answer should be found.
| http://www.coders.co.nz/ |
.dan. is the New Zealand Drupal Developer working on Government Web Standards
Thank you @Dan, you are
Thank you @Dan, you are fully right, I state that this solution is not the best surely. Thanks for your best solution link.
Signature:
If you look at word and nouns you do not clearly understand
take a look at Common Terminology
if is missing feel free to post a comment - ;-)
Contact me for drupal projects in English, German, Italian, Drupal Hosting Support.