• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Article Plugin - Image gallery

focault

Member
On my blog list I have an image upload using the file upload in Ajax mode.
On the Fabrik details view the images are thumbnailed and show the full size images in lightbox mode - works good apart from the layout of the thumbnails.
Now if I look at the Joomla article that the form has created the images are just shown as thumbnails in the same layout but do not use the lightbox - the images just link to the fullsize image in full page mode.
Is there a way to get the lightbox gallery working in a Joomla article?
 
Hi
I presume you are using the article plugin? And are these images which have been defined in that plugin's "intro image" and "full image" options? If so then I think we simply place the images in the article's image fields.
Its probaby best if you point me at the form in question so I can have a look at your settings, along with the article it creates.

Also is there a way to show in the list view the amount of uploaded images.
The amount of what? Do you mean the filesize?

-Rob
 
ok by the amount I meant count.
Imagine a user uploads 15 pictures into the form I would like in the details view an element which shows Images - 15
So it counts up the amount of images uploaded
 
The only way I can think of getting a count would be to do it with a calc element, that queries the table we automagically create to hold the multiple image info (it'll be named something like tablename_repeat_elementname). The query would then need to be somethiing like ...

PHP:
$db = FabrikWorker::getDbo();
$query = $db->getQuery(true);
$query->select('COUNT(*)')->from('tablename_repeat_elementname')->where('parent_id = {tablename___id_raw}';
$db->setQuery($query);
return (int) $db->loadResult();

Modify the from() and where() table / element names as appropriate.

-- hugh
 
As for the lightbox ... the problem there is, because when you create the article from the form, you are basically freezing a "static" HTML snapshot of a detail view display, and when displaying the article, no Fabrik code is actually running. And the lightbox effect requires Fabrik to be actually rendering the display, so as to include and fire off the lightbox script and effect through JavaScript.

I think there are a number of 3rd party extensions which might work for this, which add lightbox effects, and would recognize the generic attribute we use to identify the href's from the thumbnails to the full images as being lightbox. I think it's rel="lightbox", off the top of my head.

-- hugh
 
You wouldn't. At least, not with our blessing. We're so totally beyond making any more specific changes to our code to accomodate Rocket Theme doing things their own way. The accepted way every lightbox script has done this since the Dawn of Time has been to use <a rel="lightbox" href="/path/to/image" ....>. If RT want to do it their own way ... ::sigh::. I can understand they wanted to add some extra features, like automatic captions and albums, but they could have provided a backward compatible switch in their settings, that just says "Treat rel='lightbox' as Rockbox", which would have solved this.

If you want to, you can commission us to come up with some way of detecting if RT / rockbox is installed, or add it where we currently have our "Use lightbox or Mediabox" option, and optionally build the lightbox links accordingly. Probably an hour or so's work. But it's not something we'll do otherwise.

-- hugh
 
(Sorry about the somewhat emotional repsonse, but if you knew the hoops we've had to jump through because Rocket Theme don't play well in the sandbox with others, you'd understand!)
 
Oh no worries then - I know RT like to do things their own way which is not always the best way to do things or to play nice with others ;)
 
Meh. Woke up in the middle of the night, decided doing some simple coding might put me back to sleep.

https://github.com/Fabrik/fabrik/commit/fefa9ff23de49f302a2ec0ef0eaa415c7daaddbc

Should work in list view for upload elements, as a first cut test. But I don't currently have any RT themes installed, so I can't test it, except to see that I'm including the right attributes for Rokbox, according to their docs.

To test, go to our global options (button top right of any top levl back end Fabrik admin page), select Rokbox from the "Lightbox script" dropdown, and then set "Include lightbix JS" to "No" (to stop us from including the slimbox or mediabox JS libs on the page by default).

-- hugh
 
Note that it won't yet work in your article plugin context, as mentioned, I've only added it to list view for now. If you can confirm that it works there, I'll go ahead and add the code everywhere else we render lightbox links.

-- hugh
 
How about when using the article plugin?

That might actually work, come to think of it. Or I may need to tweak a few more lines of code.

-- hugh
 
Yes!! ;) just tested it out on my local host and its working fine in a normal joomla article.
The icing on the cake would be now to display the thumbs in a row along the page not in a li so they go down the page.
 
You'd have to do that by adding some custom CSS. Normally, you'd do that with a custom_css.php in our template folder. But of course in an article created using this plugin, there's no "Fabrik" running, and our CSS doesn't get included.

So I think your best bet would be to use the built in J! template override feature (Extensions, Template Manager, Tmplates, <edit your template>, Create Overrides). Create the override, edit the default.css it creates, and add a class in there to style the 'li' however you want it, and in your Fabrik 'article' plugin template, wrap the placeholder for your photos in a div with that class.

So something like ...

Code:
My pics: <div class="myPicsClass">{yourtable___your_pics}</div>

... and then in the com_content default.css template override, add ...

Code:
.myPicsClass ul li {
  # whatever CSS you need goes here
}

There's probably a simpler way of getting an extra class in to a content page, I'm just having trouble thinking of how to do it. Heck, you may just be able to add it as a static style sheet tag in your template.

EXTRA RAMBLING

I recall trying to add a way of solving this a while back ... a long while back, in the Fabrik 2.1 days ... and I think what I came up with was adding a "form_css" view option to our regular {fabrik ...} content plugin, and adding an option to the the original 2.1 form2article plugin so it insertes {fabrik view=form_css id=X layout=foo} at the top of the article.

That allowed you to include all our usual classes and styling, by having a plugin that ran in the article, which included our normal form CSS. I just looked, and that code is still in our article plugin. However, I strongly suspect that it has suffered from bitrot over the years. You could however try that, and add the above {fabrik ...} incantation by hand to your 'article' plugin template, as the first line, replacing X with the form ID, and foo with a valid Fabrik form tmeplate name (like 'default'). If that works, you should then be able to add a custom CSS to the template.

I may well have a hack at resurecting that code / option in the 3.x article plugin, as it proved to be quite useful in 2.1. It just never made it in to 3.x, as I added it in 2.1 after we forked the first cut of 3.x.[/code]
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top