Custom file links

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Locked
ecuapac

Custom file links

Post by ecuapac »

Hi there!

  When I link to files within my site, I'd like to have special file links like

Name of the file (6.3 KB)

Is it possible to realize with CMSMS to e.g. print the size of a file and do this automatically lateron when selecting a file?

TIA Ralph
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: Custom file links

Post by tsw »

yes it is
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: Custom file links

Post by tsw »

ok, Im a bit tired  ;D

Youll want to create new user defined tag, maybe call it "file_link" and give one parameter for it, maybe "file"

now that tag knows almost everything it needs (path would be needed also, but lets assume all your linkable files are in uploads/files)

then you need to get the file size with php and echo the html and filesize as you want from the tag.

OR you could get uploads module which does most these things out of the box...

hope this helps
ecuapac

Re: Custom file links

Post by ecuapac »

Thanks a lot!

  I really could not imagine CMS Made Simple is really that simple :-) I've already written a user defined tag. You can find it at the CMSMS-Wiki:

http://wiki.cmsmadesimple.org/index.php ... #File_link

thx Ralph
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: Custom file links

Post by tsw »

Great, thanks for sharing your tag it might become handy
Locked

Return to “Layout and Design (CSS & HTML)”