ContributionsMost RecentMost LikesSolutionsAccessing inner text of freemarker xml response elements I'm using the lithium rest API and having a problem accessing elements' contained text values in the XML response. I can get the @attributes values but trying to get the text value of the element returns a freemarker error. Here's my code: <#assign groups = rest("/categories/id/platinum_groups/groups/list").groups/> ${groups.@@markup} <ul class="groups-list"> <#list groups.group as group> <li><a href="${group.@view_href}">${group.default_role.short_title}</a></li> </#list> </ul> Also: I can see from calling groups.@@markup that each group has an element called default_role which contains sub-elements including short_title. however when i call @@markup on the element it comes up empty. for example ${group.default_role.@@markup} returns just <default_role href="/roles/id/863" type="role"></default_role> Is there a different way to access the contained text for an element? The method shown in this post seems like it's just calling it with dot syntax ie: ${recent.message.subject} Freemarker access to custom content title? I'd like to include not only the content but the title of my custom content blocks in a custom component. Right now, I bring in the body with something like <@component id="common.widget.custom-content" name="5" panel="false"/> Thanks! SolvedRe: Which Page template is used for new ideas?Thanks @grazitti! To clarify for any others who have the same problem: To modify the 'new idea' page in my community, what I did was to add a new custom component to the page called 'PostPage' under messages in studio. Inside that component, I did the rest call that grazitti describes, then rendered my content only if the response was 'ideas'.Which Page template is used for new ideas? I am hoping to add a custom content block to the page where new ideas are submitted (the <body> class is PostPage). This would be fairly straightforward for an Idea Exchange page: I would create a new custom page in studio with the prefix "IdeaExchangePage" and then select it in my admin under 'custom pages'. But how would I do a similar thing for the Post Page? There's no field for that under Custom Pages in the admin, and post page us not listed under Ideas in the page menu (it's under Messages). Thanks in advance! Solvedmax limit on kudos/givers ? I'm using the rest API to get an array of kudos givers for the posts on my community. Here's the call (having gotten the variables 'board' and 'message_id' previously using coreNode.id) <#assign kudos_givers = rest("/boards/id/"+board+"/messages/id/"+message_id+"/kudos/givers/")> In most cases this works flawlwessly, but in some posts that have 60+ kudos, I'm not recieving the full list of givers. For example, I had freemarker print the size of the kudos_givers.users.user array and it's 25 givers where the post stats say there are 83. Is there a size limit on the array or am I doing something wrong? SolvedRe: freemarker error handling in rest api that did it, thanks! freemarker error handling in rest api I'm using the rest api (which is great, thanks!) to create a custom component, pulling recently solved messages from a large number of boards on my community. The rest call references boards by id, adds their messages to a giant list and then re-orders by date, serving up the 6 most recent. In testing I noticed that a typo in the board dispid would generate a freemarker template error that breaks the page: code="101" ; message="No board with the specified dispid." Everything is great and there are no errors now but I want to incorporate error handling in case somebody changes or deletes one of the (many) boards that i'm referencing in the rest call. I've tried the classic "<#if message?? && message?has_content >" test but that's too late in the process to prevent the freemarker template error. What can I do to test if the board id exists in the community before i use the rest api call? Thanks! SolvedRe: Question involving working with components Thanks Both look promising. To bad the announcements can't be treated like the 'custom content' feature. I ended up just including the whole component in my custom one using the xml tag, and I used css to hide all the chrome. Smelly - I know - but it works! Question involving working with components (In regards to this article) Is there an easy way to bring in only the contents of a standard component from inside a custom component? I'm bringing the announcements component inside another custom component: <@component id="common.widget.announcement" /> It's being brought in complete with wrapper divs and header title. I'd like to bring in just the contents. Can this be done by passing a paramerter as suggested here ? Thanks! SolvedRe: using freemarker to get window.top Hi Nathan Thanks, that would work if i were only loading the iframe once, however I need to detect when the page is still in the iframe even after the user navigates around the embedded site using internal links. In that case the referrer is no longer from the iframe. I guess it's not surprising that freemarker would not have access to the DOM since it operates on the server and has already done its work by the time the window is loaded into the frame. Thanks anyway Chris