Search the Community
Showing results for tags 'Pageimages'.
-
I have made a photo gallery using PW and I'm quite pleased with myself as it works pretty much as I want and I consider myself a basic programmer. Basically my templates use Pageimages field to hold uploaded images. Now I want to make a template to share some of my images online. I intend to cherry pick a bunch of my images and store the selection in a WireArray. Then I want to be able to send a link to someone which will use this to display the selection of images. The bit that I don't know is how to save this WireArray of selected images. I don't want to use Pageimages because it will store again the image on disc, what I want is a reference to the already saved images so that I can use that in my template field, but I'm not sure what field to use. Is it one of the Page Reference fields in the drop list for fields? I've tried looking this up in the forums but most of it seems to be to map things to front end (AsmSelect etc. which I don't really understand!) whereas I just want to save my list of selected image references to the database. I could probably use the cache class to save the WireArray as it says it can save arrays... but any pointers in the right direction would help. Many thanks!
-
Hello Gentlemen and Ladies. I have not posted for a while but now i need your help figuring out some things. The Documentation has come a long way and i love it. Though on the page: https://processwire.com/api/ref/pageimages/ I am trying to figure out if when i want to add an image to an existing image field with multiple images alldready in it and using the method $page->images->add() <?PHP /* get the images object array for the Page */ $myPageImg = $page->images; /* define the image to add */ $newImg = 'http://www.somesite.com/image.jpg'; /* Thanks Autofahrn, forgot about the output formating */ $page->of(false); /* create a new Pageimage object with the given URL and add to the Pageimages array */ $myPageImg->add($newImg); /* save the page */ $page->save(); ?> I am pretty sure i missed a few steps in the code above? Is that string suppose to be an URL like "http://www.somesite.com/image.jpg" and the method will automaticly download the image and create an Pageimage Object and add it to Pageimages array or does it have to exist on the host first and i supply a file path to that image? I guess im confused about that, hope you guys could clarify that for me. And if it needs to be allready downloaded to my host before adding the image, what would be the best API methods for that task? Just point me in the right direction and i will figure it out. Sorry for the bad explaination but i could not figure out a better way of asking. Thanks in advance. /EyeDentify
-
After upgrading from PW 2.3.2 to PW 2.3.13 (also tried 2.3.15) - I get the following fatal error (500): All I do in this special template / script, is pull data from PW and generate a PDF with the tcpdf library. It used to work fine before the PW upgrade. Q: The hoster is still running PHP 5.3.3 - the readme on the Github page (dev branch) says "minimum PHP version = 5.3.8. Could this be the culprit? btw - I had other very strange errors with various often-used modules when upgrading (module manager, xml-sitemap etc.) - but I want to try and solve each puzzle one by one...
- 4 replies
-
- error 500
- Pageimages
-
(and 1 more)
Tagged with:
-
Hello All, I have an issue editing certain pages with specific templates. I noticed this issue after migrating from MAMP to a production server. Not sure if there's a relation there but just had to mention it. 'Error: Call to undefined method DirectoryIterator::getExtension() (line 104 of /var/www/vhosts/.../httpdocs/wire/core/Pageimages.php) This error message was shown because you are logged in as a Superuser. Error has been logged.' When line 104 in Pageimages.php is commented out i'm able to edit the pages successfully. Any help or information will be appreciated. PW Version 2.5.25 DEV