• 0

Ibox links to Modals


Question

Posted · Report post

Hi, I have been playing around with iboxes, specifically trying to create scrollable modal windows to pop up when clicking the ibox.

Initially I tried with a css3 only solution which I almost got working but it is not scrollable so does not work responsively and it has no js fallback.

 

Anyone got any ideas how to get a scrollable modal going as a link from an ibox?

 

Thanks.

 

 

Share this post


Link to post
Share on other sites

4 answers to this question

  • 0

Posted · Report post

Hi,

 

You would most likely need to customize the iBox section yourself and play around with the section.php.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thanks Danny,

 

I played around with it and it works a treat for modals in the iboxes! I'll show what I did in case any one else needs a hand with this sort of functionality:

 

All I did was to copy the ibox section into the base theme and rename the plugin to Modal Ibox (to prevent confusion) and changed two lines of the section.php

Line 162

From

$text_link = ($link) ? sprintf('<div class="ibox-link"><a href="%s">%s <i class="icon-angle-right"></i></a></div>', $link, __('More', 'pagelines')) : '';

To

$text_link = ($link) ? sprintf('<div class="ibox-link"><a %s>%s <i class="icon-angle-right"></i></a></div>', $link, __('More', 'pagelines')) : '';


Line 191

From

$media_link = sprintf('<a href="%s">',$link);

To

$media_link = sprintf('<a %s>',$link);



Then this allowed for a full link with classes and IDs - e.g. href='#modal-link' class='modal-plugin-class' etc. which could be connected easily to any typical modal plugin - (I used foobox for this one). Using single quotes for the link code kept it visible on the DMS front end after refresh.

2 people like this

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thanks for sharing.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

ahansson89 - consider adding as an option to Better iBoxes ?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now