Forum Discussion

skylinegtr's avatar
10 years ago

Custom component box not display content

When I log into the community, the custom component boxes display the content. When I log out, the custom component boxes doesn't display the content. I've changed the permission to allow customers/users to see the content but it still did not show. I would like it to display when new visitors/customers visit the community home page without signing in. How can I fix this? 

Image12.png

  • These 2 areas, configuration and tips-tricks seem to be allowed to only special members, like mods, employees, i.e. with special rank.

    Also, you need to add attempt recover blocks other wise your code could break any time

     

    Ref: http://freemarker.org/docs/ref_directive_attempt.html 

     

    you need to check the access to these 2 calls

     

    boards/id/configuration/topics/recent?page_size=3
    boards/id/tips-tricks/topics/recent?page_size=3

  • skylinegtr - Can you post the code here so I can look into the issue? This usually happens because you are accessing something which is accessible to the Admin but not to the normal users or the logged out state, like a gated area which needs to be checked for permission, but you have added the REST call directly without putting a permission check for it in your code. This is a code fix, not a permission related fix.

    • skylinegtr's avatar
      skylinegtr
      Mentor

       

      VarunGrazitti thanks, below is the code.

       

      <div class="homepage-tiles-2015">
      <div class="inner">
      <div class="tile-wrapper">
      <ul class="tiles">
      <li style="height: 342px;" class="tile">
      <div class="border">
      <h2 class="tile-title">Featured Topics</h2>
      </div>
      <div class="inner">
      <#assign messages = rest("/topics/style/board/recent?page_size=3").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("")}</span>
      </div>
      </#if>
      <#list messages.message as message>
      <#assign posted_by_userid = message.author.login?string />
      <#assign posted_by_label = text.format("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}
      <span class="custom-read-more"><a href="${message.@view_href}">${text.format("custom.component.latest_three_blog_articles.read_more")}</a></span>
      </#if>
      </div>
      </div>
      </#list>
      </div>
      </div>
      </li>
      <li style="height: 342px;" class="tile">
      <div class="border">
      <h2 class="tile-title">Knowledge & Support</h2></div>
      <div class="inner">
      <#assign messages = rest("/boards/id/configuration/topics/recent?page_size=3").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("")}</span>
      </div>
      </#if>
      <#list messages.message as message>
      <#assign posted_by_userid = message.author.login?string />
      <#assign posted_by_label = text.format("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}
      <span class="custom-read-more"><a href="${message.@view_href}">${text.format("custom.component.latest_three_blog_articles.read_more")}</a></span>
      </#if>
      </div>
      </div>
      </#list>
      </div>
      </div>
      </li>
      <li style="height: 342px;" class="tile last">
      <div class="border">
      <h2 class="tile-title">Blogs</h2></div>
      <div class="inner">
      <#assign messages = rest("/topics/style/blog/recent?page_size=3").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("")}</span>
      </div>
      </#if>
      <#list messages.message as message>
      <#assign posted_by_userid = message.author.login?string />
      <#assign posted_by_label = text.format("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}
      <span class="custom-read-more"><a href="${message.@view_href}">${text.format("custom.component.latest_three_blog_articles.read_more")}</a></span>
      </#if>
      </div>
      </div>
      </#list>
      </div>
      </div>
      </li>
      <li style="height: 342px;" class="tile">
      <div class="border">
      <h2 class="tile-title">Events</h2></div>
      <div class="inner">
      <#assign messages = rest("/topics/style/blog/recent?page_size=3").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("")}</span>
      </div>
      </#if>
      <#list messages.message as message>
      <#assign posted_by_userid = message.author.login?string />
      <#assign posted_by_label = text.format("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}
      <span class="custom-read-more"><a href="${message.@view_href}">${text.format("custom.component.latest_three_blog_articles.read_more")}</a></span>
      </#if>
      </div>
      </div>
      </#list>
      </div>
      </div>
      </li>
      <li style="height: 342px;" class="tile">
      <div class="border">
      <h2 class="tile-title">Idea Exchange</h2></div>
      <div class="inner">
      <#assign messages = rest("/topics/style/idea/recent?page_size=3").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("")}</span>
      </div>
      </#if>
      <#list messages.message as message>
      <#assign posted_by_userid = message.author.login?string />
      <#assign posted_by_label = text.format("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}
      <span class="custom-read-more"><a href="${message.@view_href}">${text.format("custom.component.latest_three_blog_articles.read_more")}</a></span>
      </#if>
      </div>
      </div>
      </#list>
      </div>
      </div>
      </li>
      <li style="height: 342px;" class="tile last">
      <div class="border">
      <h2 class="tile-title">Forums</h2></div>
      <div class="inner">
      <#assign messages = rest("/boards/id/tips-tricks/topics/recent?page_size=3").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("")}</span>
      </div>
      </#if>
      <#list messages.message as message>
      <#assign posted_by_userid = message.author.login?string />
      <#assign posted_by_label = text.format("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}
      <span class="custom-read-more"><a href="${message.@view_href}">${text.format("custom.component.latest_three_blog_articles.read_more")}</a></span>
      </#if>
      </div>
      </div>
      </#list>
      </div>
      </div>
      </li>
      <div class="clearboth"></div>
      </ul>
      </div>
      </div>
      </div>

      • VarunGrazitti's avatar
        VarunGrazitti
        Boss

        These 2 areas, configuration and tips-tricks seem to be allowed to only special members, like mods, employees, i.e. with special rank.

        Also, you need to add attempt recover blocks other wise your code could break any time

         

        Ref: http://freemarker.org/docs/ref_directive_attempt.html 

         

        you need to check the access to these 2 calls

         

        boards/id/configuration/topics/recent?page_size=3
        boards/id/tips-tricks/topics/recent?page_size=3