Page 1 of 1

User-defined Documents

Posted: Mon Sep 21, 2015 1:33 pm
by lewishowles
I have an interesting query, and I'm looking for a second set of eyes to see if anyone has any other ideas off the top of their heads.

I'm creating a website that has a relatively large number of pages, and it could be the case that the editors want to add one or more documents to any of those pages. The problem is I would want the buttons to have some HTML associated with them so that they look nice and would stand out for any visitors. The editors know very little HTML (they're volunteers for a charity), so I don't want to overwhelm them with 'this is what you need to copy and paste' and explaining the code view in MicroTiny to them.

Essentially what would be ideal is a WordPress Shortcode type offering.

There are a few ways I can think to do this in CMSMS:

Let them choose files through MicroTiny.
The downside of this is that they'd have to manually edit the HTML to make it look good.

Create a few content areas for files that they may or may not use, perhaps in a tab called 'Documents'.
This would have been easy with GBFilePicker, and it would have let them upload and select files right there in the content page, but unfortunately it doesn't work in 2.0. I don't think there's a way to select files from a dropdown using the {content} tag like there is for images. Am I wrong there?

Create an EasyList instance that allows them to upload files
I could categorise them based on Page Alias, which would let me automatically apply any style I want to links. This would be a nice solution, but would require a lot of category setup, and I'd have to teach them how to create a category that matches a page alias in the future if they wanted to add more pages.

Use a UDT or Plugin that allows them to specify a document path
For example {document file='/path/to/my/file.pdf'}. This is neat, and quite similar to the WordPress Shortcode idea. It would also allow documents to be added anywhere in the content, rather than in one defined location, but the only downside is explaining how to get the full path of the document, just in case they want to organise the documents themselves. This would be my favourite solution but the path isn't shown in the File Manager, and when you click on the file to view it, a temporary path is used. Having the File Manager show the full path for each file would be a nice option.

Use a UDT or Plugin that searches for a document directory that matches the current page
Similar to the EasyList option, but automatic. This would let them create a 'home' folder in a particular location, and when on the 'home' page, it could show any documents added in there. This would be a nice solution, but we come back to the issue of creating folders with specific names based on page alias.

Has anyone been in a similar situation and used a different solution or have any ideas?

Re: User-defined Documents

Posted: Mon Sep 21, 2015 1:45 pm
by velden
Create an EasyList instance that allows them to upload files
I could categorise them based on Page Alias, which would let me automatically apply any style I want to links. This would be a nice solution, but would require a lot of category setup, and I'd have to teach them how to create a category that matches a page alias in the future if they wanted to add more pages.
IIRC LI2 (the predecessor of EasyList) had a fieldtype definitions to choose a specific page from a dropdown. That, combined with the search functionality MIGHT give you an option to do what you want.

Other options may be (not tested):
- CSS/jQuery to style links that meet specific properties (src attribute).
- A UDT combined with CMSMS Event Manager to search a content block for specific links and change those before sending to browser (or cache).

Re: User-defined Documents

Posted: Mon Sep 21, 2015 1:50 pm
by lewishowles
Interesting. Very interesting.

Indeed LI2 (and I think EasyList) has a Pages dropdown field type. So I could perhaps have them choose a document, and a page, and on each page perform a search for which documents match the current page. Very interesting.

I didn't even realise you could intercept content using the Event Manager. That's also very interesting! I guess the downside there is how easy it would be to test what you're doing since it all happens in the background.

Re: User-defined Documents

Posted: Mon Sep 21, 2015 2:02 pm
by lewishowles
Just tested the first solution - EasyList pages definition combined with search. Beautiful. Works perfectly.

I always forget about the search functionality in EasyList/LI2

Re: User-defined Documents

Posted: Mon Sep 21, 2015 11:11 pm
by Jeff
Use a UDT or Plugin that allows them to specify a document path
For example {document file='/path/to/my/file.pdf'}. This is neat, and quite similar to the WordPress Shortcode idea. It would also allow documents to be added anywhere in the content, rather than in one defined location, but the only downside is explaining how to get the full path of the document, just in case they want to organise the documents themselves. This would be my favourite solution but the path isn't shown in the File Manager, and when you click on the file to view it, a temporary path is used. Having the File Manager show the full path for each file would be a nice option.
The UDT can be code that the file location is relative to a specific location such as root, the uploads directory, etc.