Getting the name of a content type into the velocity assembler

I am trying to create my own preview template. This will display a page with a predefined link to a page that knows how to display each content type that is stored in our published database. In the below example, I would rather not be using contenttypeid and instead be using content type name. Has anyone found a way to get at a list of content types from the velocity templates?

#displayfield("rx:sys_contentid")<br/>
	#displayfield("rx:sys_contenttypeid")<br/>
	#set ($contentType = $sys.item.getProperty("sys_contenttypeid").String)
		
	#if ( $contentType == "318")
<a href="http://www.guidestar.org/index.jsp?content_id='#displayfield("rx:sys_contentid")'">Click here to preview FAQ</a>
#else
	<a href="http://www.guidestar.org/index.jsp?content_id='#displayfield("rx:sys_contentid")'">Click here to preview Others</a>

    #end

of the current item is to use the primary node type. I recommend that you create a binding variable with name of the current item type…


$ctypename = $sys.item.getPrimaryNodeType().getName()

You can then use this binding variable ($ctypename) in your #if statement.

Note that this returns the full name of the content type (e.g. “rx:rffBrief”)

getPrimaryNodeType doesn’t seem to be available in Rx 6.0 ?

Yes, you’re correct, that was added later.

There’s a JEXL binding function in the PSOToolkit ($user.PSOObjectFinder.getContentTypeSummary($sys.item.getGuid()) that returns the PSContentTypeSummary object. Calling getName() will return the full name of the content type.

This function (the PSOObjectFinder) was not in the initial builds of the PSOToolkit, so you should check if it’s in your copy or not.

Rhythmyx 6.0 is really rather old at this point, and the upgrade to 6.1 should be relatively painless (the upgrade to 6.5 is pretty straightforward, but not quite as simple as the upgrade to 6.1 is).

Dave

This (see attached) is all I got in the toolkit you sent me Monday. Could we get this function as well?

Thanks.

Sinisa,

I’m not really in a position to re-build old toolkits and add functionality to them. Yes, I have all the files in source control, but I don’t think I even have the 6.0 libraries installed locally any more, so I’ll have to do a re-install of the old system.

If you really cannot upgrade to 6.1, I’ll try to do it when I have some time. This may take me a week or two at the rate things are going.

Dave

It’s OK Dave. I’ll go with hardcoded CType ID for now, and that’ll change once we upgrade to 6.5.

Speaking of upgrade, one issue we encountered with both 6.1 and 6.5 is loss of “Allowed relationship types” for all our slots (not rff*). Dropdown setting would go from ActiveAssembly to [empty]. (We did open tickets with the Support, but then we would decide to postpone upgrade and close them ticket.) Any ideas what could be causing this?

Thanks,
Sinisa