Can Content Type Label be displayed in content editor

This is a similar question to “can Content ID be display in content editor” (http://forum.percussion.com/showthread.php?t=456) but instead of the content id, I would like the content type label.

Looking at the xml, i can see where i could get the content type name (eg. rffBrief via /ContentEditor/Workflow/ContentStatus/ContentTypeName) but not the Label of the content type (ie. Brief). Is there a way to get the label of the content type?

The reason behind this is a visual cue to the end user that the information that they are filling out is for a particular content type.

This isn’t documented, but you could make a call to sys_psxContentEditorCataloger/ContentTypeLookup.xml. This returns a document containing the localized name and id of all content types.

To be safer across upgrades and if you had a larger number of content types, you should make a copy of this resource in your own application and add an additional WHERE clause that only gets the entry that matches a supplied id (mark this as OMIT IF NULL.) You can make a document call in the XSL using the contenttypeid that is in the document to get the label.

Thanks! I’ve managed to get it down to three lines to be added in the xsl, where test.xml is just the rendered Rhythmyx/sys_psxContentEditorCataloger/ContentTypeLookup.xml


< xsl:variable name="CTName" select="document('../rx_resources/test.xml')" />
< xsl:variable name="contentTypeID" select="/ContentEditor/@contentTypeId" />
< h3>< xsl:value-of select="$CTName/sys_Lookup/PSXEntry[Value=$contentTypeID]/PSXDisplayText"/></h3>

But this relies on having an external file called (in this case) test.xml. I tried calling the xml application via


document('../sys_psxContentEditorCataloger/ContentTypeLookup.xml')

and variations there-of (including an absolution path), but none of that worked (error on the above was that the file didn’t exist, adding another …/ fixed the error, but that doesn’t make sense and still didn’t work).

One possibility is that the application requires a login and the login page is what is being returned, but I can’t seem to verify that. Any thoughts?

Wow…

an absolution path
…don’t we all feel that sometimes something and/or we need one of those…

The solution I found was to explicitly call the xml application (sys_psxContentEditorCataloger) by the full url and pass it a session id as well…Thus for anyone else interested, here’s how to get the content type label to show up on the editor (modify activeEdit.xsl and possibly another one as well)

Some “Documentation”:
$sessionID = session id of the user adding a new content item
$contentTypeID = Content Type ID of the new content item
$hostname = Hostname of the Rhythmyx server, I just randomly selected the DependencyView Link and created a sub-string
$CTLabelURL = URL to the XML that lists Content Ids and their labels, with session id passed to it


< xsl:variable name="sessionID" select="/ContentEditor/UserStatus/@sessionId"/>
< xsl:variable name="contentTypeID" select="/ContentEditor/@contentTypeId" />	
< xsl:variable name="hostname" select="substring-before(/ContentEditor/SectionLinkList/SectionLink[@name='DependencyViewer'], 'Rhythmyx')"/>
< xsl:variable name="CTLabelURL" select="concat($hostname,'Rhythmyx/sys_psxContentEditorCataloger/ContentTypeLookup.xml?pssessionid=',$sessionID)"/>
< xsl:variable name="CTLabelDoc" select="document($CTLabelURL)" />	
< h3>< xsl:value-of select="$CTLabelDoc/sys_Lookup/PSXEntry[Value=$contentTypeID]/PSXDisplayText"/>< /h3>
		

Note: I deliberately put spaces after each "< " so that the code would show up on this post.

You probably can do this via internal request, but you’ll have add a call to sys_MakeAbsLink to the Content Editor System Def XML. This is not for the faint of heart, so perhaps you way is better.

Dave