Forum Discussion

Beryllium's avatar
12 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!

  • JeffS's avatar
    JeffS
    Lithium Alumni (Retired)

    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

    • Beryllium's avatar
      Beryllium
      Ace

      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