Forum Discussion

Beryllium's avatar
13 years ago

recent solutions module

Moments ago, this page http://lithosphere.lithium.com/t5/Developers/Where-are-the-Lithium-developer-docs/td-p/67886

 

had a component with the title "recent solutions"

 

It linked to : https://lithosphere.lithium.com/t5/forums/searchpage/tab/message?filter=location&location=forum-board%3Alisupport&solved=true&sort_by=-topicPostDate&search_type=thread&filter=location,solvedThreads

 

How can I make my own component called recent solutions to get content like this?

 

I can't find anythign in the REST Api (http://lithosphere.lithium.com/t5/Developers-Knowledge-Base/Admin-Guide-REST-API-JavaDocs/ta-p/5966)   that gives me any sense of what call I would use. 

 

That the documentation isn't searchable due to being local isn't helping.

  • Hi Beryllium,

     

    The call you noted in your comment should do the trick - http://community.lithium.com/community-name/restapi/vc/solutions/recent

     

    It is possible that there are not recent solutions in your community and it is not showing any results. If you're receiving a Success message in the XML output, it should be what you're looking for though.

     

    Alternatively, there is a Recent Solutions component already created within the platform for use on the community. To add this to a page, navigate to Studio and add the component to the desired page type you're working on.

     

    Note: You'll find the recent solutions component under the list of components on the left. Expand Solutions and hover over Find More Solutions, then select Add.

     

    I hope this helps!

6 Replies

  • Beryllium's avatar
    Beryllium
    Ace
    13 years ago

    Either that's not working or there are no recent solutions in the community :/

     

    Can someone tell me if I'm on the right path?

     

    Documents/restapidocs_12_10/Community.html#Community.solutions.recent

  • JeffS's avatar
    JeffS
    Lithium Alumni (Retired)
    13 years ago

    Hi Beryllium,

     

    The call you noted in your comment should do the trick - http://community.lithium.com/community-name/restapi/vc/solutions/recent

     

    It is possible that there are not recent solutions in your community and it is not showing any results. If you're receiving a Success message in the XML output, it should be what you're looking for though.

     

    Alternatively, there is a Recent Solutions component already created within the platform for use on the community. To add this to a page, navigate to Studio and add the component to the desired page type you're working on.

     

    Note: You'll find the recent solutions component under the list of components on the left. Expand Solutions and hover over Find More Solutions, then select Add.

     

    I hope this helps!

  • Hi Jeffs,

     

    thank you for your response. I checked and there are three really old cases of solutions. i'm struggling a bit with the documentation still. I found the call, and I've been copying and pasting other code I could find, but where the language for components is described I can't locate.

     

    For example, this is the code I'm attempting to use:

     

    <#assign messages = rest("/solutions/recent?page_size=5").messages />

     So where is assigned documented? Where are control flow (if then else) documented?

     

    THis is the snippet in full I have:

     

    <#assign messages = rest("/solutions/recent?page_size=5").messages />
    <div class="custom-recent-articles-container">
      <#if messages.message?size gt 0>
        <div class="custom-recent-articles-heading-bar">
          <span class="custom-recent-articles-heading-bar-title">${text.format("custom.component.latest_three_blog_articles.title")}</span>
        </div>
    
      </#if>
    
      <#list messages.message as message>
    
        <#assign posted_by_userid = message.author.login?string />
    
        <#assign posted_by_label = text.format("custom.component.latest_three_blog_articles.posted_by") />
    
        <div class="custom-recent-article-wrapper">
    
          <div class="custom-article-header">          
    
            <div class="custom-article-subject">
    
               <a href="${message.@view_href}">${message.subject}</a>
    
             </div>
    
    <div class="custom-article-posted-by">
    
              <span class="author">${posted_by_label} <#if ((posted_by_userid != "") && (posted_by_userid != "Anonymous"))><@component id="common.widget.user-name" user="conv:${message.author.login}" />
    </#if></span>
       </div>
    
          </div>
    
          <div class="custom-article-teaser">
    
            <#if message.teaser?length gt 0>
    
              ${message.teaser}
    
            </#if> 
    <br />
    <span class="custom-read-more">
                 
                 <a href="${message.@view_href}#fieldset" style="margin-left:3px;">Post a Comment</a>
             </span>             
    
          </div>
    
        </div>
    
      </#list>
    
    </div>

     

    It's all copy paste, and I don't understand it.   With this in a component, how can I tell if I'm receiving a success message in the XML?

     

    I am really beginning with lithium and there's a lot of empty holes in my understanding of how the system works. A kick in the right direction is appreciated.

     

    Btw, the "Find More Solutions" does help. I had seen this as I clicked through every single available component, however since it wasn't called "Recent Solutions" I mistakenly thought this was somehting else. I've added it to the front page and now it says "New Solutions" on the actual page. Hopefully this will satisfy the requirements for what I'm supposed to do. 

    Thank you

  • JeffS's avatar
    JeffS
    Lithium Alumni (Retired)
    13 years ago

    Hi Beryllium,

     

    The code you pasted is actually making use of freemarker, a markup language that is useful when creating custom components in Lithium. I would suggest looking over this article as a starting point - http://lithosphere.lithium.com/t5/Customer-Connection-Knowledge/Using-FreeMarker-expressions-to-personalize-announcements-and/ta-p/7427

     

    From there, you can read about the expressions you're able to use and further documentation here: http://freemarker.sourceforge.net/docs/dgui_template_exp.html - I hope that helps with clearing up the control flow logic.

     

    You can tell if you're receiving a success message via the XML by pasting the URL to the rest call you're dealing with. For example, if I wanted to see the recent solutions on Lithosphere via XML/REST, I'd use this http://lithosphere.lithium.com/restapi/vc/solutions/recent

     

    I'm glad the Find More Solutions component worked out for you. Since you're newer to Lithium, I'd highly recommend checking out the Support TKB - http://lithosphere.lithium.com/t5/Support-Knowledge-Base/tkb-p/lisupport%40tkb

     

    In addition to the Developer Knowledge Base, you'll find various how-to's and all sorts of information that will be of use when navigating through Studio or the Admin console. We're also constantly adding new articles each month, so more tips and how-to's are always being added.

     

    Please let me know if I can be of any further help.