My user wanted the ability to upload a variety of pdf's and other non-image files and then provide links to them from richtext or nicedit entries anywhere in the site. Neither of these types seem to have a file upload option so I did the following.
1. Created a hidden page called files.php
2. Created a repeating file upload template:
3. Output the file list as links with the name of the file:
4. Gave the user the following procedure:
Seems to work fine if a bit of a cludge. There is probably a much easier way to do this - happy to learn....
1. Created a hidden page called files.php
2. Created a repeating file upload template:
- Code: Select all
<cms:template>
<cms:repeatable desc='Upload the files here' label='Files' name='files'>
<cms:editable
name='uploadedFile'
label='Uploaded File'
type='file'/>
</cms:repeatable>
</cms:template>
3. Output the file list as links with the name of the file:
- Code: Select all
<cms:show_repeatable 'files'>
<p>
<a href="<cms:show uploadedFile/>" class="_contentlinks"><cms:show uploadedFile/></a>
</p>
</cms:show_repeatable>
4. Gave the user the following procedure:
- a. Upload the file(s) in the files page in the admin panel and save.
b. Open or refresh the 'files.php' page.
c. Right click on the required file link and select 'copy link address'.
d. Paste this into the desired link field in the text editor and select the required 'Open in' option.
Seems to work fine if a bit of a cludge. There is probably a much easier way to do this - happy to learn....