Skip to main content

Any idea for implementing a listing like the 5 more recent solutions in the sidebar? 


Thanks.

Hi Rodrigo,


That's a pretty awesome idea actually. I think it would be great to show users, say, the 5 most recent solution articles you published. You can use the Theme customizations (from Admin>Helpdesk Rebranding>Customize Portal) to show "N" articles in a specific folder. For example, here is a sample gist of the sidebar displaying 5 other posts from the same folder as an article, on the default theme. The problem is the available placeholders only let you access Articles from within a specific Folder (you can't access portal.article - you need to specify it as folder.article).

 

I was wondering the best way to answer your question though - how do you showcase the most recent "N" articles on any page of your portal (irrespective of the folder)?

Last month, when we announced the Facebook In-sync app, we opened a few additional placeholders in Freshthemes. So here's the gold:

The placeholder you need is now exposed, and it's called recent_articles.

You can use this placeholder from the portal as "portal.recent_articles"

Here is a sample gist that will display your most recent 5 articles on the sidebar.


Working like a charm 🙂 Thanks Vikram!


Is there a list somewhere with all the current placeholders? The solution articles don't have all of them.


Actually.. something doesn't seem to be right.. I created new articles, and they are not showing up on the list. Going to submit a support ticket.


Here's my implementation, which IMO looks great. It includes an header similar to forums last posts lists, bullet icons and Category / Folder below each item




<div class="cs-g-c">


<section class="article-list">
          <h2 class="heading">Latest Solutions Articles</h2>
          <p class="intro">Showing 5 most recent</p>
          <div class="cs-s">
            <h3 class="heading" style="width: 144px; margin-bottom:-10px">&nbsp;</h3>
         
            <ul>
          {% for article in portal.recent_articles limit: 5 %}              
              <li> 
                <a href="{{ article.url }}">{{ article.title }}</a> 
                <div class="help-text">{{ article.category.name }} / {{ article.folder.name }}</div>
              </li>            
            </ul>
          {% endfor %}            
          </div>


</section>


</div>

Also, to let other people know about this, in case they find the same odd behavior I did:


"The portal.recent_articles placeholder is designed to display the last 10 pubic articles created in your helpdesk and hence it will not work when the folder permissions is set to "logged in users"." 

Meaning, if you use a closed helpdesk, you need to set everything to "All" permissions, or the recent articles won't show up.

"And with regards to the last modified time on the Solution article our Dev Team have clarified that this is by design since it is actually the Ruby time stamp that is taken into account when the folder permissions are modified."

Meaning, if you change a folder permission, the timestamp of all the articles in it will be modified, and then they'll show up as most recent.