0

I am trying to render the name of an uploaded file without displaying the full url path i.e. replace '/portal/documents/Doc1.docx' with 'Doc1'. I am using the razor template files that come with the install package and my razor file field is called 'q.Link'. From screenshot, I want to display file name only from 'File:673'.

enter image description here

Also, is there a way to auto display the selected font awesome icon from the 'FileType' option above? Is it possible to display a certain icon if a certain file is uploaded i.e. .docx uploaded then 'fa-file-word-o' displays to screen just left of file name 'Doc1' (currently I am getting user to select an icon from a dropdown list but looking to skip this hopefully unnecessary step)?

denisjoconnor
  • 115
  • 1
  • 9

1 Answers1

1

Yes you can, but you'll need to write a bit of code to do that automatically - basically checking the file name.

There's actually a template which already does some of this quite nicely - in the standard Bootstrap 3 Content-templates. Install them and check out the _Helpers.cshtml which is in charge of the icon-resolution.

https://github.com/2sic/2sxc-content-bootstrap3/blob/master/_Helpers.cshtml

iJungleBoy
  • 5,325
  • 1
  • 9
  • 21