Use modal in calc element

rodeokid

Member
Hi, i struggle for over an hour now with what i thing should be simple... please anybody can help me or push me in the right direction ?
I have a query that return images link from phocagallery database as an array, everything works fine, the images are displayed correctly in small size, but i just want to click on it and open in modal to see the normal size... but it does'nt work at all.
My form opens in modal already, so i tried a couple of things like content.prepare, but i can't do it.

Here is my code so far:

Code:
$codeprojet = '{liste_des_projets___code_projet}';
$ceprojetid= '{liste_des_projets___id}';

if (empty($ceprojetid)) {
//echo '';
}
else {
$db = JFactory::getDBO();
$query = 'SELECT id FROM a0z3w_phocagallery_categories WHERE title ='.$codeprojet.'';
$db->setQuery($query);
$catid = $db->loadResult();

$myDb = JFactory::getDbo();

$myQuery = $myDb->getQuery(true);

$myQuery
    ->select(array('filename'))
    ->from('a0z3w_phocagallery')
    ->where('catid = ' . $catid);

$myDb->setQuery($myQuery);

$rows = $myDb->loadObjectList();


$list = array();
foreach ($rows as $row)
{
    $list[] = '<a href="images/phocagallery/' . $row->filename . '" rel="lightbox"><img src="images/phocagallery/' . $row->filename . '" width="150px" height="150px"></a>';
}
return '' . implode($list) . '';
}

Thank in advance if anybody feels like wanting to help !!
 
I guess the attribute rel="lightbox" in the link is supposed to trigger the image opening in a modal/lightbox? Why should that happen? Do you have any script running which should do so?
 
Yeah i was testing with Slimbox script, but no success. Nothing seems to work.
I just want to be able to open the images in the form cause we need to see the images uploaded by our employees in phocagallery. This form is already opened in a modal so i am looking for a way to click on the picture, see it large but then be able to close it or scroll the others pictures, but stay on the form if i close a picture. Right now i have to click back and the form is closed, so we have to open it again to see another picture.
Is there a way to have the picture open in a modal window when we are already in a modal window ? I did it easily with the modal from another component (DpCalendar) because i could use modals from Regular Labs, but it's not working in Fabrik form. So anybody has a clue for me please ?
 
Well, opening a modal (or lightbox) from inside a modal can generally be tricky, indeed, depending on what scripts are used. IOW, some scripts allow it while others don't.
Either way, it's not a Fabrik "thing", so you may need to look elsewhere for such specific, custom solution.

Not sure if you and your users could live with the following alternative, but as a sort of workaround I could think of using just CSS: initially display the images as thumbs (= downscaled in size per width/height properties) and -- on hover -- scale them up to whatever size you fancy.
 
Ok so right now i am not very proud of me... I've slept on it and tought about it and said to myself: i did it in the past and it was working just fine so there nust be something wrong... and i saw that in my form config in Options tab, the Joomla content plugin option was on Details only, i just switch it to Details & Form, and bingo ! Everything works fine now, i can open all the pictures in a modal window, even scroll through all the pictures, and all that from a modal form... I feel stupid this morning, but happy to have found the bad config.
God i love this software.
Please Fabrik, find a way to have a Joomla 4 version one day, i don't want to use anything else in my life. Honestly, i think that Fabrik should be included directly in Joomla, i can't even imagine myself working with any other component.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top