Jump to content


Photo
- - - - -

Ibox links to Modals

ibox modal customization

  • Please log in to reply
4 replies to this topic

#1 grahamd79

grahamd79

    Advanced Member

  • Members

  • 56 posts
  • Country: Country Flag

Posted 20 November 2013 - 12:31 AM

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.

 

 



#2 Danny

Danny

    Is Awesome!

  • Moderators
  • 16289 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 20 November 2013 - 08:31 AM

Hi,

 

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



#3 grahamd79

grahamd79

    Advanced Member

  • Members

  • 56 posts
  • Country: Country Flag

Posted 07 December 2013 - 07:58 PM

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.


  • Danny and CliffordP like this

#4 Danny

Danny

    Is Awesome!

  • Moderators
  • 16289 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 08 December 2013 - 11:44 AM

Thanks for sharing.



#5 CliffordP

CliffordP

    Advocate

  • Members


  • 455 posts
  • LocationOklahoma
  • Country: Country Flag

Posted 09 December 2013 - 05:14 PM

@ahansson89 - consider adding as an option to Better iBoxes ?







Also tagged with one or more of these keywords: ibox, modal, customization