[deleted] Was this extension working before for you? That part of the code is untouched.

I can add some checks to see if the tag exists, I'll do my own debug with the upload extension. I will let you know when you can update and try again.

    malago using fof/upload
    one of bbcod unsing is : [upl-image-preview url=XXX.jpg]
    worked with the original fancybox 🙂

      Does this allow you to resize uploaded images?

      A big plus if fof formatting add this option (fancybox) for both contents it can manage (images, youtube video, etc)

      But, for now, it's just awesome having this extension working in beta 15. Thx @malago for this

      Amarok I'm glad to see it working!

      So it has to be some other problem if it works for you with the upload extension 🤔

      I didn't have time to debug it yet though...

      Also, if I have more time (I have a lot to learn about Flarum extensions) I can try to improve the extension. I have to see if fancybox can also work with videos, but it might not be possible.

      • [deleted]

      • Edited

      I've created a basic extension for this, where a loop is created over all <img> tags, and data-fancybox is added as an attribute. It is also 100% compatible with fof/upload

      It's clean, and works in my instance. See a demo over at https://metabullet.com

      I will be extending this so that Youtube and other videos can take advantage of the same thing.

      EDIT: Uploaded 🙂

      It's basic, but functional. Further development to follow

      To install

      composer require phenomlab/fancybox

      To update

      composer update phenomlab/fancybox

      To remove

      composer remove phenomlab/fancybox

        [deleted] mmmh, work not very well. After the image was viewed in full, it's disappear (on my installations)

          • [deleted]

          • Edited

          Amarok really ? Can you provide a bit more detail ? I can't replicate that here. Are you using the latest version 0.1.2 ?

          Also, can you give me your forum URL so I can have a look ?

            I see the same behaviour, after viewing the image is no longer displayed in the original post. The issue is related to CSS that gets applied to the image, after viewing in the fancybox the main image gets set to style="display: none"

            • [deleted]

            • Edited

            @ctml @Amarok I've checked the link @Amarok provided in three browsers, and cannot replicate this issue at all. @ctml I also cannot replicate your issue either.

            This extension does not add or alter any CSS - all it does in fact is add data-fancybox as an attribute. Do either of you have the other "fancybox" extension installed and activated ?

            @ctml - can you send me a link please so I can test this ?

            @Amarok - also, I do not even see the data-fancybox attribute being added

            Is the extension enabled ?

              • [deleted]

              Amarok Are you using "Login2See" ? I think there is a conflict there.

                • [deleted]

                • Edited

                Amarok This is the issue. If you look at the HTML, you'll see that the image after clicking is in fact still there

                The issue is that there is an inline display: none; which is being set by the Login2See extension, and not by my extension. You can test this by disabling the Login2See extension to see if this resolves the issue.

                EDIT: I could fix this by adding an inline style display: inherit. What may be happening here is that the CSS called by the extension is the stock from Fancybox itself, and that may have some bearing. However, I cannot replicate this on my own forums, and do not use Login2See, so I really do not think that is it.

                I may add a note on the extension itself to note that there is an issue with Login2See, but I'd appreciate if you could disable this extension (Login2See) and let me know if it's still an issue, or if it disappears.

                  [deleted]

                  One thing, I don't have Login2See extension but see the same behaviour regardless of the post number.