1
votes

I am developing a web application which will be added as a custom page in Tridion.

On the custom page I'd like to select a component of schema X. I want to use the ItemSelectControl for this purpose but I don't know how I can open that control from my custom page since I am not able to access any of Tridions javascript namespaces (e.g. $model or $const). I could simply open a new popup with the url to the ItemSelectControl and create my own filter in json but I'd rather use the constants defined in Tridions javascript namespace.

Is there a simple way to add references or something to my web application in order to access Tridions javascript namespaces? If not, do you have any suggestions how I should solve this?

More information on the custom page:

  • CMS server hostname: testcms

  • An empty ASP.NET project with one aspx page called Test.aspx published to path C:\TestPage\

  • In IIS, a web application called TestPage in the SDL Tridion site with path to C:\TestPage\

  • Trying to access the page in a broswer with url: http://testcms/TestPage/Test.aspx

2

2 Answers

5
votes

You can accomplish this by using the following markup/code for your popup. (Popup page must be an .aspx page)

<%@ Page Language="C#" AutoEventWireup="true" Inherits="Tridion.Web.UI.Controls.TridionPage" ClassName="DashboardView" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html class="tridion popup">
<head>
    <!-- Tridion manager -->
    <cc:TridionManager runat="server" Editor="CME">
        <dependencies runat="server">       
            <dependency runat="server">Tridion.Web.UI.Editors.CME</dependency>
            <dependency runat="server">Tridion.Web.UI.Editors.CME.commands</dependency>
            <dependency runat="server">Tridion.Web.UI.Editors.CME.globalCommands</dependency>
            <dependency runat="server">Tridion.Web.UI.Controls.Popup</dependency>
        </dependencies>
    </cc:TridionManager>
</head>
<body>
    My popup
</body>

This means that there is a dependency between your application and Tridion, because your popup page must inherit Tridion.Web.UI.Control.TridionPage. It's up to you if you want this. I don't know of another way to add the Tridion JavaScript files. (This approach is also used in the PowerTools project. Check it out here: http://code.google.com/p/tridion-2011-power-tools/)

1
votes

If you want to develop your own web application that connects to SDL Tridion (so you can use it as a Custom page or in a Custom URL for example), you should use the Core Service. This allows you to interface to the Tridion API without needing to copy (parts) of the SDL tridion Web.Config.

An example of how to use the Core Service is given on SDL Tridion World: Item Selector Custom URL eXtension

This example shows you an Item Selector build using the Core Service. Its is specifically designed to be used in a Custom URL (the link you have in Schema Fields), but can easily be converted to be used in your own web application or in a Custom Page.

Only when you are creating a SDL Tridion UI extension, you can (or should) use the Tridions javascript namespaces.