Iain Posted August 22, 2011 Share Posted August 22, 2011 Hi all, Loving ProcessWire so far, we had an existing site we wanted to drop dynamic content into, it's so easy! Anyway, we want users to be able to upload new documents and link to them in the main body of the page. I've set up a new field of "File" type and called it "attachment". I've checked the list of supported file types, and tried to upload a standard DOC file to test it. The file uploads fine, but how can the user then choose where to drop the links into the document? With images you can use the image button on the editor, but there doesn't seem to be one for files... Any ideas? Link to comment Share on other sites More sharing options...
apeisa Posted August 22, 2011 Share Posted August 22, 2011 I assume you are using the 2.0 version? There is "Link to file" functionality in "soon-to-be-stable" version 2.1. There isn't upgrade script ready yet for 2.0 => 2.1 (there are few db changes that require running a script), but it coming soon after the 2.1 release. Not 100% sure, but most probably the InputfieldTinyMCE module from 2.1 works without problems in 2.0 also. Just replace the /wire/modules/Inputfield/InputfieldTinyMCE/ folder from 2.1 in your site structure. This could be short-term solution before you can update to 2.1. I don't usually recommend touching wire folder, but this should be pretty much safe operation (of course, test first ). 2.1 can be found here: https://github.com/ryancramerdesign/P21 and is considered (=used) pretty much production ready (although under heavy development). Link to comment Share on other sites More sharing options...
Iain Posted August 22, 2011 Author Share Posted August 22, 2011 So just copy that folder from the 2.1 (pre)release into my current site? Think I'll do a full backup in case and then give it a go, thanks for the help Also nice to know it's not possible yet and I'm not losing my marbles... Link to comment Share on other sites More sharing options...
ryan Posted August 23, 2011 Share Posted August 23, 2011 I'm actually thinking this won't work, though can't say for certain (haven't tried). But in 2.0 I think it's better to just link to the URL of the file you want. Right click on the filename in the admin, copy, then paste as the URL in the link tool. That's one approach. Another is to reserve some area of your site's design for listing/summarizing file attachments rather than relying on the editor to manually link them in the rich text editor (a good practice with or without 2.1). But of course the needs for every site are different and what makes sense in one site may not in another. PW 2.1 provides a little more flexibility here. Link to comment Share on other sites More sharing options...
Iain Posted August 23, 2011 Author Share Posted August 23, 2011 I'd thought about hard coding a file listing, but they want to be able to pick and choose where each document link goes, so that idea went out the window... Link to comment Share on other sites More sharing options...
ryan Posted August 23, 2011 Share Posted August 23, 2011 In that case, with the 2.0 version, I would instruct them to use the existing link tool and paste in the file's URL as the href. Grabbing that file URL is as simple as right clicking on the filename in admin and selecting 'copy link'. This is how I always did it before adding the file selection to the link box in 2.1. Link to comment Share on other sites More sharing options...
Iain Posted August 23, 2011 Author Share Posted August 23, 2011 If the site gets handed over before 2.1 is released, I'll do just that. Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now