Page 1 of 1

Gallery in custom module failing to render in article

Posted: 25 Jun 2024, 14:55
by RIadmin
In Joomla 4.4.5, I'm using Phoca Gallery 5.0.0 (which is compatible with Joomla 4 & 5, to my knowledge).

I created multiple categories and sub-categories and associated them with several images.
I created a "Phoca Gallery ยป List Of Categories (Categories View)" menu link, and each category shows up, as you'd expect.

Then I followed the instructions here - https://www.phoca.cz/blog/1238-how-to-d ... ery-plugin - including setting "Prepare Content" to Yes.

In a custom module I put this syntax, literally: <div>{phocagallery view=entering|categoryid=11}</div>
where "entering" is the category alias, and "11" is the category ID.

In an article, I inserted the module like this, literally: <div>{loadmoduleid 462}</div> (it's module 462).

But nothing renders visibly. Viewing source, there's a lot there, starting with...

Code: Select all

<div class="custom">
	<div><svg aria-hidden="true" class="ph-sr-only" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <defs>
        <symbol id="ph-si-feed" viewBox="0 0 512 512">
            <path d="M108.56 342.78a60.34 60.34 0 1060.56 60.44 60.63 60.63 0 00-60.56-60.44z"></path>
            <path d="M48 186.67v86.55c52 0 101.94 15.39 138.67 52.11s52 86.56 52 138.67h86.66c0-151.56-125.66-277.33-277.33-277.33z"></path>
            <path d="M48 48v86.56c185.25 0 329.22 144.08 329.22 329.44H464C464 234.66 277.67 48 48 48z"></path>
        </symbol>
I updated my media options to include the MIME Type, svg, added:
- Allowed extensions: svg
- Legal image extensions: svg
- Legal MIME Types: image/svg+xml

but it made no difference.

The gallery is invisible!

I really hope someone can advise me.

Vicki

Re: Gallery in custom module failing to render in article

Posted: 25 Jun 2024, 19:00
by Benno
Hi,
I don't quite understand why you first integrate the plugin code into a module that you then display in an article instead of integrating the plugin code directly into the article. Too complicated for me.
In addition, the plugin code is not correct. It should be: {phocagallery view=category|categoryid=11|limitstart=0|limitcount=0} if you want to display all images of this category in the article.

Kind regards,
Benno

Re: Gallery in custom module failing to render in article

Posted: 26 Jun 2024, 10:37
by RIadmin
Hi, Benno,

Thank you for the reply!

I resorted to putting the plugin code -> module-> article because putting it in the article directly didn't work. (I looked around for a solution and followed the instructions - https://www.phoca.cz/blog/1238-how-to-d ... ery-plugin... )

But, as you pointed out, I had the syntax wrong.

So I just inserted your syntax in the article, but although a whole pile of SVG code is in source, nothing renders on the page (except line-height of the container div element).

This is my first time using Phoca Gallery, so I don't know what I should be seeing, but here's a screensnap of the structure:
https://imgur.com/a/N7kC6q7

Hope you can advise why it won't render.

Thanks!
Vicki

Re: Gallery in custom module failing to render in article

Posted: 26 Jun 2024, 11:27
by RIadmin
Just looking at source from the all-galleries view, I see that this whole element and all its children -

Code: Select all

<div id="phocagallery" class="pg-category-view pg-cv">
- is not in the article source. No wonder nothing renders... the gallery is not there.

Re: Gallery in custom module failing to render in article

Posted: 26 Jun 2024, 15:33
by Benno
Hi,
There are not many reasons why the Phoca Gallery Plugin is not displayed in an article:
1.) The plugin does not have the same version as the component.
2) The plugin is not installed or activated.
3) The plugin code is not valid. (Valid plugin code can be created with the Phoca Gallery Button Plugin)
4.) Recently the problem has arisen that the plugin does not work with the SP-PageBuilder. (SP-PageBuilder does not render any content plugins) However, there is a non-official fix for this.
I updated my media options to include the MIME Type, svg, added:
- Allowed extensions: svg
- Legal image extensions: svg
- Legal MIME Types: image/svg+xml
Phoca Gallery does not support SVG images. These can therefore not be displayed with the plugin.

See images:
Image

Image

Kind regards,
Benno

Re: Gallery in custom module failing to render in article

Posted: 26 Jun 2024, 17:31
by RIadmin
Hi, Benno,

Thank you so much for persisting to help me. It paid off!
It did turn out to be a clash of versions of Joomla, Phoca component, and plugins.
I upgraded to Joomla 5.1.1 and reinstalled the appropriate version of some plugins... and it's working now.

The category display is not what I want, yet... but I can work with the examples you gave, above, and play around until I get it right.

Thank you again, Benno! You are indeed a "Phoca Hero"!!!

Vicki

Re: Gallery in custom module failing to render in article

Posted: 26 Jun 2024, 17:38
by Benno
You're welcome!

Kind regards,
Benno