Skip to main content
Post date:
Wednesday, November 5, 2014

Foundation is one of the latest and most popular responsive frameworks available on the Web nowadays, quite easy to use, fast to learn, the documentation section is really useful and there is also a Drupal version of this framework included as a base theme so you can take good advantage of Foundation in Drupal.

Zurb Foundation is the Drupal base theme that implements this nice framework and offers a lot of advantages for example, creating Modal windows with Foundation is a pretty straight forward task and the base theme makes this task way easier on Drupal by providing a theme hook in order to properly render a Modal in you HTML.

The hook is called  zurb_foundation_reveal and returns an html link.

theme('zurb_foundation_reveal', array(
  'text' => t('Text'), // element that triggers the modal; by default this theme function returns a link
  'path' => url('node/3'), //only available if ajax is true
  'ajax' => TRUE, /false if not an ajax call; use it with 'path'
  'html' => TRUE, //HTML permitted or false
  'reveal' => '', // HTML content to render; not needed when ajax is true
));

Use this hook to render whatever content you want into a Foundation Modal, it can be a AJAX call response too what you insert on the Modal jut remember to use JSON. To see more about the available options see the Foundation documentation for Reveal Modals.

Add new comment
The content of this field is kept private and will not be shown publicly.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.

Related Blogs