Cloud Tags

Anyone out there using version 6.7 and cloud tags? I have created a content type with a multi-dropdown of preconfigured cloud tags for the end user to chose but an having difficulty getting the tags into page. The idea being the the choices the user makes will be in the published page (not visible) just within the html. the a JS populates the cloud tag field in the global template. Any better or different ideas?

I found this code snippet in the forum but am having problems with it:

#set($myList = $user.psoListTools.asList($sys.item.getProperty("rx:prectags").getValue()))
#foreach($a in $myList)
#set($lbl = $rx.keyword.getLabel('FF_Expert_Category_Types',$a.getString()))
#$label$delimiter
#end

It does not grab the items inn the field.

Thanks,
MJW

I’m not sure if this would serve your needs or not, but we worked with Percussion PSO to implement a custom tagging module that allows an administrator to define a taxonomy (basically a tree of terms) and then the users can tag content items with whatever tags they want, which can then be used in the Velocity code to build pages.

Thanks so much for the input, certainly that may the best option and we will be working with there PSO in the very near future on some other issues but unfortunately I am under the gun on this particular issue to get the cloud tag in place QUICKLY due to a new site launch. The idea being I put in a stop gap measure and as mentioned, and then discuss a more robust solution with the PSO when we discuss other work we need done.

I am just hoping someone can jump in and tell me where I am going wrong on the code. This should be fairly striaght foward to grab choices from the multi-dropdown choices and add them to the HTML in a hidden field but I am having no luck

MJW

MJW,

If you want to use sys_DropDownMultiple with a Keyword set populating the choices then you can use the following base code to guide you to the desired result:


#set($selectedChoices = $user.psoListTools.asList($sys.item.getProperty("rx:dropdownMultipleFieldName").getValues()))##
#foreach($selectedChoice in $selectedChoices)##
#set($selectedChoiceValue = $a.getString())##
#set($selectedChoiceLabel = $rx.keyword.getLabel('keywordChoices',$selectedChoiceValue))##
Choice Label: $selectedChoiceLabel [noparse]<br />[/noparse]
Choice Value: $selectedChoiceValue()
#end##

Let me know if that gets you close to your desired result. If you’re wanting to delimit the values then you’ll have to use the $velocityCount variable within the foreach to determine the last occurrence then stop delimiting.

Thanks Riley I appreciate the start, I mae it to getting this error on the page:

Problem assembling output for item (name=“Security-Global-Implications”, id=2-101-26068) with template: erauPgArticle. Underlying error: keywordvalue may not be null or empty See log for stack trace.

Confused.
Thanks,
Mike

[QUOTE=Rileyw;19766]MJW,

If you want to use sys_DropDownMultiple with a Keyword set populating the choices then you can use the following base code to guide you to the desired result:


#set($selectedChoices = $user.psoListTools.asList($sys.item.getProperty("rx:dropdownMultipleFieldName").getValues()))##
#foreach($selectedChoice in $selectedChoices)##
#set($selectedChoiceValue = $a.getString())##
#set($selectedChoiceLabel = $rx.keyword.getLabel('keywordChoices',$selectedChoiceValue))##
Choice Label: $selectedChoiceLabel [noparse]<br />[/noparse]
Choice Value: $selectedChoiceValue()
#end##

Let me know if that gets you close to your desired result. If you’re wanting to delimit the values then you’ll have to use the $velocityCount variable within the foreach to determine the last occurrence then stop delimiting.[/QUOTE]

Can you copy and paste the code snippet?

Absolutely

#set($selectedChoices = $user.psoListTools.asList($sys.item.getProperty("rx:prectags").getValues()))##
#foreach($selectedChoice in $selectedChoices)##
#set($selectedChoiceValue = $a.getString())##
#set($selectedChoiceLabel = $rx.keyword.getLabel('keywordChoices',$selectedChoiceValue))##
#Choice Label: $selectedChoiceLabel <br />
#Choice Value: $selectedChoiceValue()
#end##	

I tried utilizing the code as you posted it with several changes but the most recent above, simply has the field (rx:prectags) that is in the template that lists the dropdwon choices.

Try the following:


#if($sys.item.hasProperty("rx:prectags"))##
#set($selectedChoices = $user.psoListTools.asList($sys.item.getProperty("rx:prectags").getValues()))##
#foreach($selectedChoice in $selectedChoices)##
#set($selectedChoiceValue = $a.getString())##
#set($selectedChoiceLabel = $rx.keyword.getLabel('keywordChoices',$selectedCho iceValue))##
#Choice Label: $selectedChoiceLabel 
#Choice Value: $selectedChoiceValue()
#end##
#end##

Thanks Riley. I tried that code and it gives me the same message:

“Problem assembling output for item (name=“Human-Factors-Article”, id=6-101-26015) with template: erauPgArticle. Underlying error: keywordvalue may not be null or empty See log for stack trace.”

This has me way perplexed. I am unclear as to why it seems so difficult to pull into the page a multi-dropdown choices from a field? In another site I am using a querybuilder statement to pull in specific content types via a multi-dropdwon choice e.g.

#set($myChildren = $sys.item.getProperty("degrees").getValues())##
			#set($qrybldr = "")##
			#set($operator = "")##
			#foreach($myChild in $myChildren)##
				#set($qrybldr = "${qrybldr} ${operator}")##
				#set($qrybldr = "${qrybldr} rx:sys_contentid = ")##
				#set($qrybldr = "${qrybldr} ${myChild.String}")##
				#set($qrybldr = "${qrybldr}")##
				#set($operator = " or ")##
			#end##

But I am not clear if I can use the same type of query builder statement to pull in a “field”, as opposed to a content type?

Thanks agian for the help, I appreciate it.
Mike

[QUOTE=Rileyw;19772]Try the following:


#if($sys.item.hasProperty("rx:prectags"))##
#set($selectedChoices = $user.psoListTools.asList($sys.item.getProperty("rx:prectags").getValues()))##
#foreach($selectedChoice in $selectedChoices)##
#set($selectedChoiceValue = $a.getString())##
#set($selectedChoiceLabel = $rx.keyword.getLabel('keywordChoices',$selectedCho iceValue))##
#Choice Label: $selectedChoiceLabel 
#Choice Value: $selectedChoiceValue()
#end##
#end##

[/QUOTE]

Mike, do you know where “keywordvalue” is originating?

Hi Riley
I do not. I checked the server log for errors, keyword value problems, etc. and see no reference to that value and am unclear as to what that line is referring to.

Does the error still occur when we remove the code we’ve inserted?

No, the error disappears once the code is removed.

Mike, it appears that the second parameter in $rx.keyword.getLabel() is null or empty. You may need to add a statement to verify that this parameter isn’t empty/null.

Thanks Riley, working on it. Will report back as to what I find out.
As always, very much appreciated.
Mike

Here you go. Thanks again for the help. This code:

#set($myList = $user.psoListTools.asList($sys.item.getProperty("rx:prectags").getValues()))
#foreach($a in $myList)
#set($lbl = $rx.keyword.getLabel('FF_Expert_Category_Types',$a.getString()))
$lbl
#end

Pulls mulitiple choices from the drop down list into the page.

Mike