13hakta / FileAttach

Tool to attach files to resources with MODX Manager
http://13hakta.ru/blog/fileattach-en.html
15 stars 11 forks source link

Extra login checkbox #20

Open funkyduke opened 3 years ago

funkyduke commented 3 years ago

Hey Vitaly,

I hope you understand English. I do not speak Russian.

I have made a small adjustment to FileAttach Modx and I think it’s a great added value to the tool. Can you please consider in implementing it?

I wanted to transform the tool so that the admin can choose if a file is public or not. So I made an extra checkbox “login”. (see screenshot below, “Aanmelden” is Dutch for login)

When the box is checked there’s a message on the website that only logged in people can see it. (see screenshot below)

In combination with the addon Personalize the admin can check if the document can be showed or not (other ways are also possible of course):

[[!Personalize? &yesChunk=`fileprivate` &noChunk=`filenormal`]]
[[+login:eq=`1`:then=`html-code`]]

The new code: FileAttach-26-12-2020-extra-login-checkbox.zip

Another suggestion would be to ad a date-picker, to show the customer how old the document is (instead of upload date). Now I have used the tag-field for that.

afbeelding afbeelding afbeelding

13hakta commented 3 years ago

Hello. Extension implements public/private mode for files. For private modes you may set access with specified user groups, which for sure requires user registration. For adding auth message you may use conditional markup on your page, kind of: [[!+modx.user.id:isloggedin:is=1:then=[[!FileAttach]]:else=<p>Please login to view files</p>]]

Please describe scenarios in which addition would be useful.

funkyduke commented 3 years ago

There are a lot of scenarios where my update would be useful. The most important is to show the list of downloads, but make it only downloadable if you are logged in. The way you suggest just hides the files complete, but I want to show them to the customer in a list, just like you see in my third screenshot. Another advantage is that I can mix up files that are OK for free download and others you need to login for.