how to show image gallery

WordPress
22 May, 2020 20:37:34
msk285
Topics: 11
Messages: 36
Hello,
How can I upload the whole image gallery into the pdf?
So for example, maybe I have a website selling cars and if I want to sell that car I have to put pictures of the front view, back view, and two other side views. How can I be able to add all the pictures in a pdf? So I will be adding a gallery because the photos will be different for other types of cars.

Thanks :)
22 May, 2020 23:35:48
E2Pdf
Support
Topics: 7
Messages: 3163
Hi,

If gallery will be added to post content it could be used "Preg Match All" filter as example below. It will mark all images inside post by pattern and value can be output via "Preg Match All Output". Keep in mind please that example pattern prepared for default gallery output so it could be need to modify it depending on which HTML code generated for gallery inside page.

"Preg Match All Pattern" - is preg_match_all pattern to map needed elements. (/<figure><img src="(.*?)"/)
"Preg Match All Output" is the path to navigate via array keys (1.0)
"Value" - must be set to [post_content]

Example screenshot attached:
1.0 - 1 is the group number, 0 is the number of element inside group.
1.1 - will output 2nd match in 1st group.
1.2 - will output 3rd match in 1st group and so on...

We remain at your service.
We would really appreciate your feedback at WordPress.org!
23 May, 2020 01:09:15
msk285
Topics: 11
Messages: 36
So I have entered the Preg Match All Pattern, Preg Match All Output and Value however as you can see the image below it's empty. :(

However when I add this to the value, [meta key="_schoolgallery" path="0"], the images look fine as you can see at the bottom photo.
23 May, 2020 01:19:27
E2Pdf
Support
Topics: 7
Messages: 3163
It looks like you have gallery via ACF/Meta Keys. If so then all images data stored in array and solution with "Preg Match All" will not work.

If meta key value works for first image: [meta key="_schoolgallery" path="0"]

Then for 2nd it must be [meta key="_schoolgallery" path="1"], for 3rd [meta key="_schoolgallery" path="2"] and so on. If it will not work, create please "textarea" field with value [meta key="_schoolgallery"] to see which output you will get and share it with us please.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
23 May, 2020 03:21:58
msk285
Topics: 11
Messages: 36
Great!! Thank you!! It works perfectly fine now! I really appreciate your help :)