đŸ Archived View for chirale.org âș 2007-12-19_b424813374ee24bd99b2fc0b107a73ad.gmi captured on 2024-05-12 at 15:27:10. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
How to make a collapsible content body with Contemplate and the Drupal core âcollapsibleâ function?
Make sure youâve Contemplate enabled (through admin/build/modules)
Go to admin/content/templates and choose the type you want to display collapsible content within.
Enable body contemplate checking âAffect body outputâ and write (change field names):
> \<?php > drupal_add_js(âmisc/collapse.jsâ); > drupal_add_js(âmisc/drupal.jsâ); > ?\> > \<fieldset class=âcollapsible collapsedâ\> > \<legend\>\<?php print t(âMy Translatable First Field > Labelâ)?\>\</legend\> > \<div class=âfieldset-wrapperâ\> > \<h2\>\<?php print t(âMy Translatable First Field > Headerâ)?\>\</h2\> > \<?php print $node-\>field_myfirstfield\[0\]\[âviewâ\] ?\> > \</div\> > \</fieldset\> > \<div class=âmysecondfieldâ\> > \<?php print $node-\>field_mysecondfield\[0\]\[âviewâ\] ?\> > \</div\>
Update: If you want a collapsible box expanded by default, use class=âcollapsibleâ without âcollapsedâ class.
Add collapsible content in Drupal @ Random Snippets
Add collapsible content in Drupal @ Random Snippets
https://web.archive.org/web/20071219000000*/http://drupal.org/project/contemplate
https://web.archive.org/web/20071219000000*/http://www.codesnippet.info/?p=52