Allowing users to insert media links in page fields
You can use the Media selection form control to allow users to select files on the Form tab of pages (Content tab for content-only pages). Users can then select any file from any source – Page attachments, Content tree and Media libraries – to insert a link into pages that they are editing.
To insert the media selection form control
- Open the Page types application.
- Edit () the page type into which you want to add the Media selection form control.
- Switch to the Fields tab.
- Add a new field using New field.
- Fill in the properties of the new field as follows:
- Field type: Standard field
- Field name: MediaSelection
- Data type: Text
- Size: 300
- Field caption: Media selection (for example)
- Field description: any description that you want users to see when hovering over the field caption
- Form control: Media selection (select via the (more items…) option)
- In Editing control settings, specify resizing options for images uploaded using this form control.
- Save the form control.
The system creates a new column in the page type’s table – dbo.CONTENT_Doctype. For example, dbo.CONTENT_News for the News page type. When a user inserts a link to a media using the form control, the link is stored in the column.
On Portal Engine sites, you can display media links on pages using a transformation in a repeater.