How do you get Community Posts to appear on home page?
답변함I have a basic understanding of HTML and a little bit of CSS. I can look at other code and try to copy it for my use with pretty decent success. I've taken over for someone else who designed our help center and trying to add some features my CEO is asking for.
1. I am trying to get set up our Help Center Home page to show our community topics (for now).
2. I think ultimately I would like the most upvoted posts from our feedback section to appear on the home page, but for now I'd like to get started with getting #1 to work.
Would someone be able to point me in the right direction below is the code I have but its not showing much:
<div class="promo-block community-sub-nav">
<h1>{{t 'community'}}</h1>
<span class="community-topics"></span>
</div>
-
@Jeff - I'll see if I can help you here.
1. You can't currently show community topics on the home page unless you do some kind of workaround. You can easily hard code the HTML and point stuff into your topics which is the easiest way. You could create categories for each of your topics and redirect the links via curly bars or you could automatically pull them via the API which is the hardest way.
2. This would require some development as you would have to pull this from the API.
You can list the activity of the community by adding a scope statement like below. This will work on the HomePage.
{{recent_activity scope='community'}}
Hope this helps!
-
Hi Jeff
We remember of doing something in past without using API (because it has rate limit, and we might hit issues if HC sees a lot of traffic). We used an iFrame to embed activities, or other pages; used various javascript tricks to remove header/footer and other things from iframe page.
Hope that gives you some idea.
Cheers
Team Diziana
Visit Diziana to download free and premium custom responsive ready-to-use Zendesk theme or Zendesk template or Zendesk plugins for Zendesk Help Center. Brand your Zendesk Help Center, and provide fantastic self-service customer support experience. -
Just FYI, I was able to get our community topics to show on the homepage using an iframe and some javascript and css trickery.
https://www.tazsupport.com/hc/en-us
In your script.js page:
//put this outside document.ready:
function resizeIframe(obj) {
obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
}// put his inside document.ready:
if (window.location.href === "https://www.yourzendesksite.com/hc/en-us/community/topics") {
if (window.frameElement) {
$('#communityLinks').siblings().hide();
$('#communityLinks').parents().siblings().hide();
$('#communityLinks a').attr('target','_parent');
$('#communityLinks').addClass('in-iframe');
setTimeout(function(){
$('#launcher').hide();
},1000);
}
}in your community_topic_list_page.hbs put an id on the container of your topics... I put it as communityLinks
then on the home_page.hbs file add the topics list page as an iframe like this:
<iframe src="https://www.yourzendesksite.com/hc/en-us/community/topics" style="border:0px #ffffff none;" name="communityTopics" scrolling="no" onload="resizeIframe(this)" frameborder="0" marginheight="0px" marginwidth="0px" width="100%" allowfullscreen></iframe>
Worked for me... its pretty ridiculous that this is the kind of hacks we have to resort to in order to get basic functionality that should be built in... hope this helps someone.
-
Hi James! Thank you so much for sharing your solution!
댓글을 남기려면 로그인하세요.
4 댓글