var editedItemId = ''; if ((document.location) && (document.location.search)) { var qStr = top.location.search.substring(1); var keyValList = qStr.split("&"); for (var i=0; iThis will allow Sitecore to check for an existing item and go directly to it in the Content Tree. Otherwise it will default to the current sites Media folder. Really simply to implement and makes managing 300,000 items of content much easier.1) { if (splitPair[0] == "id") { //Value was already escaped, no need to unescape and re-escape editedItemId = splitPair[1]; } } } } } And then I had to add to the query string variables of editor.ShowDialog: + (editedItemId ? "&editedItemId=" + editedItemId : "")
A dive into the world of technology, fatherhood and the real world. Discussions around enterprise CMS, Web, and other social trends.
Showing posts with label Media Library. Show all posts
Showing posts with label Media Library. Show all posts
Tuesday, January 17, 2012
Sitecore RichText Commands Custom Media Library
My last post discussed a unique setup where we needed to point the Sitecore Media Library (Insert Sitecore Item) to a different root folder based on the website. We have a multi-site implementation. All have their own distinct Media (Images, Video, Audio & Documents). If we didn't there would be nearly 180,000 items in these folders.
To get 6.3.0 to work the following changes need to be made.
in sitecore\shell\Controls\Rich Text Editor\RichText Commands.js
add the following to the RadEditorCommandList["InsertSitecoreMedia"] = function(commandName, editor, tool):
Labels:
Insert Sitecore Media,
JavaScript,
Media Library,
Sitecore
Sunday, September 25, 2011
Sitecore RadEditor and Multisite Media Library
Currently working through an upgrade from 6.0.1 to 6.4.1 yea we are a little behind but we need to catch up and start using some of the features. We have 18 sites in a single Sitecore instance. And about 250,000 items in that tree.
During the upgrade process our problem and so far only one we have run into is our custom Media Library. Each site has its own Media folder with a separate Images, Videos, and Audio folders. This makes ownership and maintenance a little easier.
How did we do this? There is an override of the InsertImageForm (picture coming soon) that calls a sitecore query: similar to this.
targetPath = "query:ancestor::*[@@templateId='{18F42371-1B85-4EE1-AF6B-20F5AF81BD5D}']/Media";This uses a technique very simliar to Alex Shyba's example on how to remember the last section when working with Media. Once we deployed 6.3 we ran into an issue where this no longer works. The query appears to be failing and we end up with the default Media Library being displayed. This means that all of our sites no longer have access to their unique media content. My mission this week is to use .NET Reflector and see what's changed in the Sitecore.Kernel.dll and how this override of InsertImageForm needs to be altered. Any suggestions?
Subscribe to:
Posts (Atom)