Magictabs breaks Lightbox type mods
txcrew - November 10, 2008 - 13:23
| Project: | Magic Tabs |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
In my magic tab function listed below I have a view that displays the referenced photos associated with the node. Each photo is set to display in its own lightbox upon click. I tested the view by itself, independent of the lightbox and it worked just fine.
However, once loaded inside the magic tab, the lightbox will not open. I've tried this with Lightbox2 and Shadowbox to no avail. Is there something I should've added to my function? Like an add_js snippet? Any ideas would be helpful.
Thanks,
txcrew
<?php
function magic_tabs_event_callback($active = 0) {
$photos_view = views_get_view('photos_ref');
$photos = views_build_view('block', $photos_view, $view_args, FALSE, 8);
if (arg(0) == 'node' && is_numeric(arg(1))) {
$node = node_load(arg(1));
node_build_content($node);
}
$tabs[] = array(
'title' => t('Synopsis'),
'content' => $node->content['body']['#value'],
);
if (!empty($photos)) {
$tabs[] = array(
'title' => t('Photos'),
'content' => $photos,
);
?>
#1
I found this issue that is of a similar request: http://drupal.org/node/282089
It basically says to add
$.getScript()to your ajax file and tell it to get your lightbox.js fileWhere would I add something like this for in the magic_tabs.module file?
txcrew
#2
I am also having problems using magic_tabs with lightbox2 in drupal 5. (Both modules work fine on their own.) I'm trying to use lightvideo to present movies linked to from within the content of each tab. The lightvideo links for the default tab load in lightbox2 correctly, but lightvideo links in subsequent tabs load just the movies in an empty browser window without the lightbox2 interface. Reloading the page after clicking a new tab fixes the problem, but it happens again as soon as I click to a different tab. Here's the code I'm using in my template.php file:
function magic_tabs_homepage($active = 0) {$tabs[] = array(
'title' => t('title1'),
'content' => t('Paragraph goes here.<br /><br />Movies: <a href="/files/movies/tab1movie1.mov" rel="lightvideo[width:464px; height:480px;][Movie1 caption goes here.]">Link text</a> and <a href="/files/movies/tab1movie2.mov" rel="lightvideo[width:464px; height:480px;][Movie2 caption goes here.]">link text</a>'),
);
$tabs[] = array(
'title' => t('title2'),
'content' => t('Paragraph goes here.<br /><br />Movies: <a href="/files/movies/tab2movie1.mov" rel="lightvideo[width:464px; height:480px;][Movie1 caption goes here.]">Link text</a> and <a href="/files/movies/tab2movie2.mov" rel="lightvideo[width:464px; height:480px;][Movie2 caption goes here.]">link text</a>'),
);
$tabs[] = array(
'title' => t('title3'),
'content' => t('Paragraph goes here.<br /><br />Movies: <a href="/files/movies/tab3movie1.mov" rel="lightvideo[width:464px; height:480px;][Movie1 caption goes here.]">Link text</a> and <a href="/files/movies/tab3movie2.mov" rel="lightvideo[width:464px; height:480px;][Movie2 caption goes here.]">link text</a>'),
);
return $tabs;
}
I just updated to the latest dev release of the magic_tabs module (magic_tabs.module,v 1.3.2.13 2008/09/23 07:36:13 yhager), but to no avail.
Any ideas?
Thanks!
Tom