So What I’m presenting is a very simple solution with Razor, where we only ask the Tridion user to put one Media Manager distribution URL in Tridion, but we can get both options out of it.
A Review of a Media Manager Distribution
Before we really get rolling on Media Manager, let’s touch on the two sharing options for a distribution in Media Manager.
- Article Detail Page: one video
- Homepage: one video
- Article listing pages: some videos
- Video listing page: all the videos
On our listing pages, it’s different. We’re providing a button that opens the video in a modal window. My modal window plugin is fancybox, which has a cool
iframe feature; it takes whatever is in the
href of a given element and generates an iframe from that.
Finding a way to load
One Schema Field, or Many?
Direct Link has that cute little copy/paste icon which copies the url into the Tridion user’s clipboard, how about if I work with that? I’ll just create a single field called
VideoDirectLink in my article schema.
Re-analyzing the distribution URLs
- Client-specific subdomain; this is unique to the client
- Path to SDLMedia
- Query String
- Unique ID of the distribution; this is unique to the distribution
Writing the Razor
The solution is really simple now. We use C#’s
Replace method to append
What About the Extension?
There is a Media Manager connector extension for Tridion 2011 that allows you to view the distributions from within Tridion, and connect those distributions to your component. That’s certainly ideal, but it I ran into some shortcomings with that extension that eliminated it as a solution. I’ll explain that extension and its faults in a separate blog post.