Key Value/Field One More Question

45 views
Skip to first unread message

Alex

unread,
May 24, 2012, 5:12:14 PM5/24/12
to dot...@googlegroups.com
Hi,

This is a code sample segment to pull the key and values. :

#foreach($item in $!URLMapContent.additionalDetails.entrySet())
#if(!$item.key.equals("keys"))
<br/>$item.key:  $item.value
#end

The output of this is -as everyone knows is - I will be using some key/values from the video


USBInput: Yes
USBPort: Yes
ProductHieghtwithstand: 32-1/2

Note:  There is no space in between the individual words and the values display grammatically correct.  All videos show it like that.

What is the correct "element" or "variable" I need to get so that it display like:


USB Input: Yes
USB Port: Yes
Product Hieght with stand: 32-1/2

Thanks,

Alex

Maria Ahues Bouza

unread,
May 24, 2012, 5:29:18 PM5/24/12
to dot...@googlegroups.com
Alex,

You're right, we found out that's a bug in dotCMS 2.0 that was
reported here and fixed for 2.1
https://github.com/dotCMS/dotCMS/issues/209

The variable $URLMapContent.additionalDetails returns a JSON object
that you can parse in Javascript in the frontend and should have the
spaces.

But the map in velocity has the keys without spaces.

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
http://www.twitter.com/mabouza

Please consider the planet before printing this email.

Alex

unread,
May 24, 2012, 5:45:41 PM5/24/12
to dot...@googlegroups.com
Thank you Maria! So does this mean that in 2.1 the keys will be
displayed grammatically correct without recurring to javascript for
the JSON object?

Another issue I noticed is that the output does not match the order in
which I sorted the key/values on the backend. That may need some
tunning.

Alex

Maria Ahues Bouza

unread,
May 24, 2012, 6:03:21 PM5/24/12
to dot...@googlegroups.com
Yes they will work in 2.1 by using this code (adding map)
#foreach ($map in $con.specs.map.entrySet())

We'll test the order issue with the new map and put in a bug if it's
not working correctly.

Thanks
Maria
Reply all
Reply to author
Forward
0 new messages