Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2015-06-03 09:40:02

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: [REQUEST] Add file upload to contact form

philwareham wrote #291274:

How about minimal version for 4.5 and jQuery UI version for 4.6?

That’d work, sure. I just don’t know how to go about offering styling options. Every contact form is different so I’d be reticent to render something that looked like the (excellent) Queue widget in case that wasn’t what was required in a person’s contact form.

It kinda needs a bare bones approach with tags for :

  • File upload input widget.
  • Dropzone.
  • Buttons.
  • Feedback area.
  • Anything else…?

So, for example, it might work like this:

<txp:zem_contact to="someone@example.org">
   <txp:zem_contact_text label="Message" />
   <txp:zem_contact_email  />
   <txp:zcr_file_attach class="upload_widget">
      <txp:zcr_file_attach_dropzone wraptag="div" class="filedrop" />
      <div class="zcr_buttonbar">
         <txp:zcr_file_attach_button type="add" />
         <txp:zcr_file_attach_button type="upload" />
         <txp:zcr_file_attach_messages />
      </div>
   </txp:zcr_file_attach>
</txp:zem_contact>

An input box could be rendered by default by the zcr_file_attach tag (as a fallback) which you could hide if you preferred. Or maybe it should only render that if the tag is used as a single tag, with an option to include one via <txp:zcr_file_attach_input /> if used as a container. That way, a site admin could choose which extra bits of functionality to include and style the components individually to taste.

Not sure if that would work or if it’s customisable enough. Further thoughts welcome.

[Edited for clarity]

Last edited by Bloke (2015-06-03 09:42:48)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#26 2015-06-03 09:51:15

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: [REQUEST] Add file upload to contact form

Actually thinking about it, do we even need to do any styling? That is really down to the site author isn’t it?

I agree the best approach is to allow the author to choose the pieces they want, to build the upload as simple or as full-featured as Plupload allows.

Offline

#27 2015-06-03 10:02:36

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: [REQUEST] Add file upload to contact form

philwareham wrote #291276:

do we even need to do any styling? That is really down to the site author isn’t it?

Yeah, after initially mentioning pretty interfaces I realised after a bit of brainthought that it was a bad choice and then the zcr_file_attach-as-container idea sprang into my head.

The only thing about the examples I’m unsure about is why you need an extra <script> tag to include the queue module. I thought the plupload.full.min.js included everything but it doesn’t appear to. Rats.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#28 2015-08-28 07:44:49

dorka
Member
Registered: 2012-10-04
Posts: 90

Re: [REQUEST] Add file upload to contact form

Hellooo!
I’ve been peeping into this thread and it seems that you have made some good progress. Is there a later version of the plugin with progress bar redy to use, already?
Thanks

Offline

#29 2015-08-28 08:14:49

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: [REQUEST] Add file upload to contact form

Have a look here (non-free)

Offline

#30 2015-09-04 07:31:22

dorka
Member
Registered: 2012-10-04
Posts: 90

Re: [REQUEST] Add file upload to contact form

ruud wrote #294408:

Have a look here (non-free)

Thanks Ruud. I had a look. Accordind to what I can get from the discription (there are no actual screenshots, unfortunately) the all essencial fitures have been covered in Stef’s version, which I have installed and running on the site already. The next step now is adding progress bar to visualize the upload process. This feature is not mentioned in Kuopassa’s plugin, either.
Pity I didn’t dig this plugin earlier (and I tried hard), it could have saved some work, probably.

Offline

Board footer

Powered by FluxBB