Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Creating URL To Document property type programmatically

Vote:
 

I've been trying to create a property that links to a document programmatically in various ways:

        [UIHint(UIHint.Document)]
        [Display(
            GroupName = SystemTabNames.Content,
            Order = 315)]
        [CultureSpecific]
        public virtual Url FileAttachment2 { get; set; }

The property type doesn't seem to be affected based on the UIHint propery I define for it. All the UIHint attributes get the property type: URL to page/externall adress when you look at them under the Admin mode. Any idea how to change this to URL to Document type?

Cheers,

 

 

#71745
May 28, 2013 10:44
Vote:
 

The BackingType attribute doesn't seem to help either:

        [BackingType(typeof(PropertyDocumentUrl))]
        [UIHint(UIHint.Document)]
        [Display(
            GroupName = SystemTabNames.Content,
            Order = 315)]
        [CultureSpecific]
        public virtual Url FileAttachment { get; set; }

    

The reason why i want the property type to be URL to Document is that when you render the property using EPiServer:Property tag the renderer renders a link with the filename (name of the file .pdf)- not the path to the file (/Documents/name%20of%20the%20file.pdf). I guess i could find an alternative way to do this, but this falls under the nice to have category.

#71747
Edited, May 28, 2013 10:58
Vote:
 

Does this work the way you want: http://world.episerver.com/Modules/Forum/Pages/thread.aspx?id=63123

 

#71752
May 28, 2013 11:45
Vote:
 

Nice one! That seemed to work.

My issue doesn't seem to be related to the problem stated in that thread though. The issue in that one was that the dialog that popped up was incorrect if i understood correctly.

Thanks ;)

#71754
May 28, 2013 12:05
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.