-
Posts
677 -
Joined
-
Last visited
-
Days Won
2
Everything posted by MatthewSchenker
-
Create Pages (with File-Upload Field) via API
MatthewSchenker replied to MatthewSchenker's topic in API & Templates
Greetings, I agree with renobird. This is a pretty complex area, so it's great to have people with the expertise and patience to work through it all. I'm hoping that this discussion can be a source for documenting these methods for people at all levels of development expertise. My goal is to be able to present a clear set of directions and explanations for the whole front-end form effort. With this discussion, I have some great material that I can put together and present down the line. Thanks, Matthew- 84 replies
-
- 1
-
- forms
- image upload
-
(and 1 more)
Tagged with:
-
Create Pages (with File-Upload Field) via API
MatthewSchenker replied to MatthewSchenker's topic in API & Templates
Greetings, I'm not afraid of long forms and code. But of course I am interested in the most concise code possible. Also, I'm thinking from the point of view of documentation and putting it all in the context of general "front-end form" tutorials for all users. Soma: I read your post on using the inputfield modules. It was on my mind when I started this discussion. The way I am documenting this, I want to show two general procedures for front-end forms: using modules or using "plain" HTML/PHP. But you also wrote this: "Also file uploads isn't there, but maybe at some point there will be more options." That's what made me wonder. The other thing is, as I use ProcessWire, I simultaneously use Laravel. I am constantly impressed with how ProcessWire provides methods that do what a full framework does. Building forms, and all that go with that, is a crucial piece. So I'm looking at the way Laravel does file uploads as I write all this and looking for the equivalent methods in ProcessWire. As long as we keep a good goal in mind, we'll be all right. Thanks, Matthew- 84 replies
-
- forms
- image upload
-
(and 1 more)
Tagged with:
-
Create Pages (with File-Upload Field) via API
MatthewSchenker replied to MatthewSchenker's topic in API & Templates
Greetings, Thank you extremely Ryan!!! And thank you Soma for patiently analyzing all the details. Of course, file uploads in any system are complex actions and should not be taken lightly. Just wondering: would it be better to access the ProcessWire "files" module (the same one that controls file uploads in the admin form)? Not sure if this is even possible... Again, my goal (besides using it in my projects) is to capture this routine and document it so others can use it. Together with "regular" fields, I think this moves us closer to a co,pkete picture of front-end page creation/management. Thanks, Matthew- 84 replies
-
- forms
- image upload
-
(and 1 more)
Tagged with:
-
Greetings LeiHa, Please report back after you run this and let us know if it works as planned! I have been working on a similar effort (getting file uploads working in a form with other ffields): http://processwire.com/talk/topic/3105-adding-file-upload-field-to-form-via-api/ I think it would be terrific and very helpful to have a well-documented way to take care of this important action. Thanks, Matthew
-
Create Pages (with File-Upload Field) via API
MatthewSchenker replied to MatthewSchenker's topic in API & Templates
Greetings, Thanks WillyC for helping... I posted two versions of the form: (1) without file uploads and (2) with file uploads. The form with file uploads has the correct enctype. So... Still searching for an answer. If anyone wants to post forms where they have file uploads working along with other fields, plase feel free to do so! Thanks, Matthew- 84 replies
-
- forms
- image upload
-
(and 1 more)
Tagged with:
-
Need guidance for UI modules, sortable data
MatthewSchenker replied to bongomania's topic in Getting Started
Greetings bongomania, One of the things that makes ProcessWire so amazing is how easy it is to link data at all levels with your styling/output concepts. As diogo shows, displaying your results in a table is easy. And you can get really fancy without too much more effort. I'm working on a project now where the client wants to be able to sort various fields of data, and I am using the JQuery DataTables plugin: http://www.datatables.net/index With this plugin, you can "foreach" through your pages as table rows, and then loop through fields in each page as table data, and make them sortable and styled beautifully. Starting from there, and the possibilities grow and grow... Thanks, Matthew -
Greetings Mark, Welcome to ProcessWire! That looks like it should work, but a couple of things that sometimes don't work: 1. Short tags. Instead of this: <?=$page->body?> Try this: <?php echo $page->body; ?> 2. Double quotes for referencing the body ID, like this: <div id="body"> These are not really a ProcessWire issues, but general HTML things. Try it and let us know! Thanks, Matthew
-
Create Pages (with File-Upload Field) via API
MatthewSchenker replied to MatthewSchenker's topic in API & Templates
Greetings, Thank you for analyzing this with me. I really appreciate the help. Interesting... I am seeing no file in the temp folder. Write permissions are as open as possible. One off-the-wall idea: does ProcessWire prevent non-logged-in users from submitting files? This form is open to anyone, even if not logged in. Just a thought. Thanks, Matthew- 84 replies
-
- forms
- image upload
-
(and 1 more)
Tagged with:
-
Create Pages (with File-Upload Field) via API
MatthewSchenker replied to MatthewSchenker's topic in API & Templates
Hey renobird, Yes, everything you summarized is true. Very interesting... Thanks, Matthew- 84 replies
-
- forms
- image upload
-
(and 1 more)
Tagged with:
-
Create Pages (with File-Upload Field) via API
MatthewSchenker replied to MatthewSchenker's topic in API & Templates
Greetings, Thanks renobird for helping! There are no errors. And pages get created successfully when the form only includes "regular" fields, without image uploads. It's only when I add the image upload field that everything just stops working. So it can't be an issue with the parent/children settings. Still stumped, Matthew- 84 replies
-
- forms
- image upload
-
(and 1 more)
Tagged with:
-
Create Pages (with File-Upload Field) via API
MatthewSchenker replied to MatthewSchenker's topic in API & Templates
Greetings, Thanks Soma for all your help. I'm starting to wonder if there's something off in the server environment. I have now tested literally the same form as the one you posted and it does not work. I'm not sure what else would stop it from working. Thanks, Matthew- 84 replies
-
- forms
- image upload
-
(and 1 more)
Tagged with:
-
Uploading a new photo to a member profile avatar field?
MatthewSchenker replied to FuturShoc's topic in Getting Started
Greetings FuturShoc, If you don't mind, could you kindly post the entire code for your user form, with the photo upload and "other" fields? Thanks for your help, Matthew -
Create Pages (with File-Upload Field) via API
MatthewSchenker replied to MatthewSchenker's topic in API & Templates
Greetings, I have used front-end forms to create pages without issues several times. In my original post of this discussion, I showed the form with all the "basic" fields, and it works great. it's only when I add the file-upload that things get thrown off. If you have that working example you mentioned earlier, I'd be curious to see it. I'm sure when this is done, it will all be obvious what the problem was! Thanks, Matthew- 84 replies
-
- forms
- image upload
-
(and 1 more)
Tagged with:
-
Create Pages (with File-Upload Field) via API
MatthewSchenker replied to MatthewSchenker's topic in API & Templates
Greetings, Just following up... I made all the changes suggested above, but still no luck. The form goes through with no errors, but nothing gets saved in the page tree. Soma: when you ran this with the code you described, were you able to get pages saved with images in the page tree? Continuing to investigate. Thanks, Matthew- 84 replies
-
- forms
- image upload
-
(and 1 more)
Tagged with:
-
Create Pages (with File-Upload Field) via API
MatthewSchenker replied to MatthewSchenker's topic in API & Templates
Greetings Soma, Thanks for taking a close look at the code! I admit there were an unusual number of un-spotted bits in there. I certainly don't think there's anything wrong with ProcessWire code. It's just that this operation does require a bit more code than other "simple" operations in ProcessWire, so there's more potential for errors. Still, I know this is something that a lot of people need to do with ProcessWire, so I'm glad it was out there and bashed around until it worked. I'll grad your gist and test it out. Thanks again! Matthew- 84 replies
-
- forms
- image upload
-
(and 1 more)
Tagged with:
-
Greetings onjegolders, Thanks for the link. Always like to see nice placeholder resources. Now, if there were only a resource that forced clients to upload proper photos on a live site... Thanks again, Matthew
-
Create Pages (with File-Upload Field) via API
MatthewSchenker replied to MatthewSchenker's topic in API & Templates
Greetings Wanze, Sorry, I meant to respond to that earlier. Yes, I am seeing a result from that. For example, I uploaded a photo called "cloudphoto.jpg. Here's the message I'm seeing: Array ( [contact_photo] => Array ( [name] => cloudphoto.jpg [type] => image/jpeg [tmp_name] => /tmp/phpdRhJLN [error] => 0 [size] => 1864092 ) ) Thanks, Matthew- 84 replies
-
- forms
- image upload
-
(and 1 more)
Tagged with:
-
Create Pages (with File-Upload Field) via API
MatthewSchenker replied to MatthewSchenker's topic in API & Templates
Hey Soma, Yes, I admit the code I posted has problems. I just can't seem to pinpoint the problem because building these kinds of forms gets into a lot of PW-specific steps. I haven't seen any examples to follow for forms with image-upload fields along with "regular" fields. I actually based my code above on your very helpful gist for uploading images to newly created pages (https://gist.github.com/somatonic/4150974). But somewhere in the process of mixing in "regular" fields with the image upload requirements, something is off. I realize I must be doing something wrong, but I can't tell what. I'm hoping in the end we'll have a working example of how to do this that can be beneficial to others, since I know other need (or will need) to do this. Thanks, Matthew- 84 replies
-
- forms
- image upload
-
(and 1 more)
Tagged with:
-
Create Pages (with File-Upload Field) via API
MatthewSchenker replied to MatthewSchenker's topic in API & Templates
Hi Soma, I used "GET" for the original form (the one with no file uploads). I then switched to "POST" for the one with file uploads. But to make it easier, I will switch all of them to the "POST" method. Thanks, Matthew- 84 replies
-
- forms
- image upload
-
(and 1 more)
Tagged with:
-
Create Pages (with File-Upload Field) via API
MatthewSchenker replied to MatthewSchenker's topic in API & Templates
Greetings, OK, Soma, here's my gist for this subject: https://gist.github.com/MatthewSchenker/5205927 I hope this can make it easier and more productive to work this out -- and better for everyone to use. Also, maybe this can be a spark that gets more of us to Github to work out our code? Thanks, Matthew- 84 replies
-
- 1
-
- forms
- image upload
-
(and 1 more)
Tagged with:
-
Create Pages (with File-Upload Field) via API
MatthewSchenker replied to MatthewSchenker's topic in API & Templates
Hey Soma, Yes, I meant just the code. It would be fun to post working code to Github (hint hint...). Thanks, Matthew- 84 replies
-
- forms
- image upload
-
(and 1 more)
Tagged with:
-
Create Pages (with File-Upload Field) via API
MatthewSchenker replied to MatthewSchenker's topic in API & Templates
Hey Soma, I get you! I really do... As someone who is attempting to document how to do things, it is difficult when there are pieces here and there for larger routines. For example, with file-uploads and front-end forms in general, there are isolated chunks throughout the forum, and putting it all together as a single file can be difficult. My goal with this discussion is to consolidate a whole routine in one coherent file. For sure, your points about better ways to discuss such code is worthy of a larger discussion! And yet, forums like this often have bits of code (many times, they are more than just "bits"). In fact, if you remove the code from a forum like this, what's left to discuss? If I were to move this to GitHub, would it be as valuable to the ProcessWire community? Thanks, Matthew- 84 replies
-
- forms
- image upload
-
(and 1 more)
Tagged with:
-
Create Pages (with File-Upload Field) via API
MatthewSchenker replied to MatthewSchenker's topic in API & Templates
Hey Soma, I know what you're saying, but I wanted to use the forum as a way to work out what the general idea should be. Ideally, it would be great to have things like this all in Github, but I think we often need to use a forum this way. It's a more direct way -- in the end -- to have code that everyone here can use for their sites. I think having a full working example of a form with various fields as well as file-uploads would be great for the forum. Good catch on the $u->getErrors()... Yes, that should be $contest_photo->getErrors() However... It still doesn't work. I'm sure we'll solve this! Thanks, Matthew- 84 replies
-
- forms
- image upload
-
(and 1 more)
Tagged with:
-
Uploading a new photo to a member profile avatar field?
MatthewSchenker replied to FuturShoc's topic in Getting Started
Hi Ryan, Thanks for posting... I am trying to put together a full working example of a front-end form with "regular" fields and file uploads. So as not to hijack this discussion, I started a new one with full working examples. Here's the other discussion: http://processwire.com/talk/topic/3105-adding-file-upload-field-to-form-via-api/ Thanks, Matthew -
Create Pages (with File-Upload Field) via API
MatthewSchenker replied to MatthewSchenker's topic in API & Templates
Greetings, To renobird: Yes, I am basing my work on Soma's code. But because I have more fields than just a file upload, I have to re-work the original code. In my code above, you can see that what I have looks like Soma's code, but with the other fields included. I fixed the path reference (updated my post above). But still no luck. The page is not being created. And no errors are being reported. Based on a comment from Ryan in a related discussion, I wonder if I am simply saving the page at the wrong stage? Here's the related discussion: http://processwire.com/talk/topic/2997-uploading-a-new-photo-to-a-member-profile-avatar-field/#entry30621 I really want to have a full, public example of how to put file uploads in a form with other fields, so I am hoping this discussion can become a live working out of the details. Thanks, Matthew- 84 replies
-
- forms
- image upload
-
(and 1 more)
Tagged with: