Key/Value Field - Rating Macro disables output

37 views
Skip to first unread message

Alex

unread,
May 22, 2012, 9:11:56 PM5/22/12
to dot...@googlegroups.com
dotCMS 2.0:

I added a key/value field in the demo on the Blog structure.  Then, I added this code to the demo for detail blog page:



<h2>Ratings</h2#getRating($!content.identifier)
    
    <h2key/Value Field Output</h2>
    
    #if($UtilMethods.isSet($!content.lunch))
<h4>Lunch</h4>
<p>
#foreach($lunch in $!content.lunch.entrySet())
$lunch.key: $lunch.value<br>
#end
</p>
#end


If the rating macro is enabled then there is no output of the key/value field.



Thanks,

Alex

Maria Ahues Bouza

unread,
May 23, 2012, 1:09:39 PM5/23/12
to dot...@googlegroups.com
Alex,

I tested this on the demo site and it works fine.
Look at the page: (I'm attaching an image too in case the demo gets
rebuilt before you see it)
http://demo.dotcms.com/blog/a-jetblue-turnaround-story-in-the-making/

Maybe the issue is that on your code you were using $content and on
the Blog Detail page you need to use $URLMapContent.

This is how I added your code
<h2>Ratings</h2> #getRating($!URLMapContent.identifier)

<h2> key/Value Field Output</h2>

#if($UtilMethods.isSet($!URLMapContent.lunch))
<h4>Lunch</h4>
<p>
#foreach($lunch in $!URLMapContent.lunch.entrySet())
$lunch.key: $lunch.value<br>
#end
</p>
#end

Thanks
Maria
> --
> You received this message because you are subscribed to the Google Groups
> "dotCMS User Group" group.
> To post to this group, send email to dot...@googlegroups.com.
> To unsubscribe from this group, send email to
> dotcms+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/dotcms?hl=en.



--
Community Manager

dotCMS
Main: 305.900.2001
Fax: 305.397.2579
www.dotcms.com
http://www.twitter.com/dotCMS
http://www.facebook.com/dotCMS

Please consider the planet before printing this email.
mailinglist_rating_keyvalue.png

Alex

unread,
May 24, 2012, 4:02:41 PM5/24/12
to dot...@googlegroups.com
Thank you Maria!

I had some issues in the past about getting inconsistent data via the
$URLMapContent with select and multiple select fields so I got used
to get the identifier and find the content that way with:

#set($content = $dotcontent.find($URLMapContent.identifier))

If I set up the code with the $content variable and the getRating
macro, the key/value fields after invoking the getRating macro do not
output their data.

So I will keep on using the $URLMapContent to avoid this issue.

Thanks,

Alex
> <mailinglist_rating_keyvalue.png>

Reply all
Reply to author
Forward
0 new messages