Query images from HappyFiles

Hi!
I have a question about HappyFiles. I believed many of you know about this plugin. I use HappyFiles for all my websites (whether I build the site with Bricks or not). In Bricks, I can query the images from HappyFiles, and I can also query the images based on the folders I created in HappyFiles.

I want to know, is it possible for me to do the same in Cwicly? I haven’t tried it myself. Need to know if anyone doing the same for their websites.

Hey @jornes.

They have a Gutenberg block.
Here you can see it and all the available options:

Hope that helps.

Hi @Marius
I didn’t want to use Gutenberg Block. I want to achieve something with query block instead.

Yes it is possible. Currently not on the PC - but I already did it using the query block. The folders are just custom taxonomies as far as I remember - so you would need to set up a simple meta/taxonomy query to achieve that.

Hope that helps. When I’m back in office later today I can send you a screenshot of my query.

Cheers

2 Likes

Hi @Wolfgang
Thank you for confirming this!

I will try this out.
Your screenshot will be helpful. I appreciate it!

Oh boy, of course I forgot about it, will send it tomorrow- already marked it in my calendar :wink:

No problem. Take your time. :v:

Hey @jornes,

here are the promised Screenshots, sorry it’s all in German, hopefully you will make your way around it :slight_smile:

  1. Post-Type “Media”

  2. Create a Taxonomy Query

  • there you have to select the happyfiles-registered taxonomy in english it would be called “Folders - (attachment)”, i guess :wink:
  • for Terms you would need to select the Folders you want to query the assets, in my case the folder name was “Brand Assets”
  • not sure anymore (it’s been a long time since using this) but i think you also have to set term_id on the field-dropdown.

I remember that there was one thing which didn’t work expected. In my case it was linking the image via the dynamic data (you can get the image via dynamic data, but not the link since wordpress uses another function behind the scenes rather than getting the post link for example → wp_get_attachment_url…

I’ve worked around that using a code-block, something like that:

image

Not sure if that limitation still exists, I remember that I’ve opened a thread on the discourse, but I cannot remember anymore what the answer was, maybe it’s already fixed, maybe it will not be fixed → maybe @Louis can remember that case better than me?! :slight_smile:

If you want to just output an Image without the need of a Link you could still use Cwicly’s Image Block, but you would need to select “Attachment URL” as Data Source, like seen here:
image

You’re also able to query things like the title of the image, for example, like doing so:
image

Hope that helps, and sorry for the delay! :slight_smile:

Cheers
Wolfgang

1 Like

Thanks @Wolfgang

When I doing the same (except the custom php code), I noticed that I was unable to set anything to the image (after the query setup).

Screencast:

Not sure if that’s a bug.
@Louis

1 Like

Hello @jornes,

Will take a look at this later in the week and get back to you.

Sorry I can’t help right now, but I’m not all that familiar with the plugin.
Is the post type Media necessary in this case?

1 Like

Hey @Louis.

I think here you can check out the logic.
Maybe it helps.

If you need temporary access to a installation with HappyFiles installed, feel free to DM me.

2 Likes

Interesting, I’ll check that tomorrow too.

1 Like

Thanks @Louis!

I hope this can be resolved soon. I am actually developing this site for my client and will publish it when the stable version releases. I really hope I can build this site with Cwicly.

Anyway, new UI looks really great. Just love it.

1 Like

Hello @jornes,

Could you try setting the Post Status parameter in Status to Inherit or Any.

2 Likes

I’ve just tested this with @louis suggestion; status inherit and any both work.

All my settings as follows:

Query block:
Post Type = ‘Media’
Status = ‘Any’ or ‘Inherit’
Taxonomy = ‘Folder - (attachment)’
Terms = ‘Folder Name (happyfiles_category)’
Field = ‘term_id’

Image block:
src = Attachment URL

1 Like

Hi @Louis

As @dazziebunz said, it works now.
Thank you very much!

@dazziebunz Thank you!

2 Likes

Great to hear!
Thanks for letting us know, @jornes and @dazziebunz :smiley:

1 Like

Oooooh my apologies, I’ve overlooked that… yep, that was one thing you have to take care about - thousand times sorry to @jornes

Cheers

2 Likes

Hi @Wolfgang !

No worries! Thank you so much! :blush:

Hi @Louis

Now, I noticed something is not working when I enabled the Slider.

Refer to the screencast:

You can see that when I enabled the Slider, the divs of the query items that contains image seem to be missing. When I disable it, the div appears again.

Please take your time.