Jump to content

EyeDentify

Members
  • Content Count

    91
  • Joined

  • Last visited

  • Days Won

    2

EyeDentify last won the day on February 10 2016

EyeDentify had the most liked content!

Community Reputation

84 Excellent

About EyeDentify

  • Rank
    Full Member
  • Birthday 07/15/1979

Profile Information

  • Gender
    Male
  • Location
    Sweden
  • Interests
    Web programming and design. cooking. Movies. Photography and more.

Recent Profile Visitors

1,609 profile views
  1. Thanks to bernhard and Autofahrn i have come up with this example code and run it in TracyDebugger on a test page with a image field and it works beautifully. <?PHP /* get and save a new image to image field Pageimages array */ $page->of(false); $pageImages = $page->images->add('https://www.somesite.com/image_of_tree.jpg'); /* save the page (perhaps not needed but there for comfort.) */ $page->save(); /* get the last added image */ $lastImage = $page->images->last(); /* debug before changes */ d($lastImage, '$lastImage before changes'); /* add tags to the image and description */ $lastImage->addTag('test'); $lastImage->addTag('Tree'); $lastImage->addTag('Syren'); $lastImage->addTag('Sun'); $lastImage->addTag('Sunny'); $lastImage->description = 'This is a beautiful tree.'; /* debug info */ d($page->images, '$page->images'); d($lastImage, '$lastImage'); /* save the page */ $page->save(); ?> I used the following API docs and mentioned forums users help to accomplish this: https://processwire.com/api/ref/pageimage/ https://processwire.com/api/ref/pageimages/ https://processwire.com/api/ref/pagefile/ https://processwire.com/api/ref/pagefiles/ Just wanted to post this at the end so others who wonder about this could get a starting point.
  2. Oki. I have to do some testing but i think i got the gist of it.
  3. Thanks to Everyone involved with helping me on this subject. Sometimes you can get confused and then need another set of eyes on the problem to figure it out.
  4. Ok i got it. But i was refering to changing the Pageimage obj properties that was newly created: https://processwire.com/api/ref/pageimage/#api-construct And then save it. But maybe i should save it, find it, change it and then save it again?
  5. I do have TracyDebugger installed, but i did not know i could do that in the TracyDebugger You learn something new everyday. Thank you all for helping me understand this.
  6. Yes ofcourse Sir Forgot about the output formating But otherwise it seems allright? Could i expect to access the newly created Pageimage object as a return value from: <?PHP $urlToImage = 'http://www.somesite.com/image.jpg'; $pageImageObj = $page->images->add($urlToImage); ?> And do some changes to it before saving or should one save in between?
  7. 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
  8. I must say that i am very much in love with where the new site is going and specificly the Document section. And finaly a section that explains the "Markup Regions" Enjoying that section very much because i have planned for a long time to move over to using Markup Regions, but with the information scatterd all over the forums and the old site it was hard to get a complete grasp on the inner workings. Now i think with the new Documents section its pretty crystal clear how it works. Thank You Ryan and everyone working hard on the new site. Looking forward to the release when its finished.
  9. No Worries. Indeed its a fairly new API. You can also check it out in the source code at: https://github.com/processwire/processwire/blob/master/wire/core/FunctionsAPI.php For more details. Hope you find it useful. Cheers.
  10. I as have been a bit confused for some time about how the "Markup Regions" functionality in Processwire worked. But i have know read a bit more and think that i am getting to grips with it. And Markup Regions is going to be huge. To aid me in understanding Markup Regions better i started to read the Source code for the new "Regular" theme in conjunction with the Blog about the markup regions. It helped me a great deal to understand the basics and more fine details of it. A tip is to open both links and use the Source code of the "Regular" theme while reading the blog post. The Source code: https://github.com/processwire/processwire/blob/dev/site-regular/templates/_main.php The Blog post: https://processwire.com/blog/posts/processwire-3.0.62-and-more-on-markup-regions/ I hope this could help others starting out with markup regions. Just take it slow and read it a couple a times and soon you will see the greatness of markup regions. /EyeDentify
  11. Support for HTTPS is enabled by default in Processwire. Making SSL work with your hosting is a Certificate issue. Check out the letsencrypt.org website for more info.
  12. Hey @ryan I was woundering if you would recommend that one save the Page once, before trying to add files for upload and then save again? I think you mentioned that in some thread? Or is this not necessary anymore?
  13. Thank you @Juergen for this answer. Now i understand what i did wrong. I did not know that i could not test the field itself that i wanted to change visibility on. But your answer explains it well. I Thought i was going crazy there for a minute
×
×
  • Create New...