Recent searches
No recent searches
How do i show more than 24 promoted articles on the home page?
Answered
Posted Oct 21, 2021
Hello, I was wondering if there is a way to show more than 24 promoted articles on the home page?
1
25
Recent searches
No recent searches
Posted Oct 21, 2021
Hello, I was wondering if there is a way to show more than 24 promoted articles on the home page?
1
25 comments
Ifra Saqlain
Hi Edwin, just copy and paste the below code at your home_page.hbs at the bottom and you can see all your promoted article would be showing on homepage:
Thanks
Team Diziana
1
Brett Bowser
Hey Edwin,
It looks like Ifra Saqlain provided a response but it didn't carry over after our maintenance took place over the weekend. I'm copying her response below. Thanks for your help Ifra!
Hi Edwin, just copy and paste the below code at your home_page.hbs at the bottom and you can see all your promoted article would be showing on homepage:
Thanks
Team Diziana
0
Edwin Woo
Ifra Saqlain Thank you, i changed the name from "Promoted Articles" to "FAQs" would i need to change
<h2>{{t 'promoted_articles'}}</h2> to <h2>{{t 'FAQs'}}</h2>
https://support.vida.com/hc/en-us
Also just curious, would it be possible to add like a "Show more" button? I think showing all the articles would be too much. Maybe show the top 10 articles then users can click on the "Show more" button to show all the articles.
0
Ifra Saqlain
Hi Edwin, please follow the below steps to hide more than 10 promoted articles and to add show more button to show all promoted articles:
1). Copy and paste the show more button code inside the promoted articles code just after the <ul> tag on homepage (where you have added the promoted article code).
Screenshot for the same:
2). Copy and paste the below CSS code at the bottom on style.css file.
Screenshot for the same:
3). Copy and paste the script function on script.js file at the bottom but under the DOM function.
Screenshot for the same:
I know I'm too late to answer but.... :)
If any confusion, do let me know.
Thanks
Ifra Saqlain
0
Ifra Saqlain
But the question for the title -
<h2>{{t 'promoted_articles'}}</h2> to <h2>{{t 'FAQs'}}</h2>
It's not possible, you can write FAQ under the <h2> tag or create Dynamic Content for this.
0
Edwin Woo
Ifra Saqlain thank you! It seems to not be working, i think the issue is that i dont have the DOM function
document.addEventListener('DOMContentLoaded', function() {
in the script.js file.
0
Ifra Saqlain
See the issue in the console tab:
Now I have fixed your script code. Now you will have to do only the few below steps:
1). Remove your all script code from the script.js file.
2). Copy the below script code.
0
Edwin Woo
Ifra Saqlain Thanks, i just copied and pasted the script to the script.js file. I also had to edit the home_page.hbs and now the "show more" button shows up. There are a couple of issues now:
1. The show more button does not work. I added the 11th article and it still shows up with the rest of the articles.
2. The spacing and position of the "show more" button does not look right. I think the button should be in the middle of the FAQ section and also the button should be lowered a little bit so its not touching the line.
0
Ifra Saqlain
It's working, I checked on your homepage:
Before clicking: Is there a Desktop version of the Vida app? this article hidden now.
After Clicking: Showing now
And button color, position, you can set it via CSS by yourself or send me the UI of button so I'll update the button style and share the code here.
Thanks
0
Edwin Woo
Ifra Saqlain ok and would it be possible to include a button that says "Shoe Less" once the "Show More" button is clicked?
0
Ifra Saqlain
Yes, it's possible via JS.
Replace your button script code which I provided before with the new below:
Now, go to your home_page.hbs file and remove the hard coded text from the button and your current button would be empty, see below:
Screenshot for the same:
Thanks
Ifra Saqlain
0
Courtney Diaz
I was trying to have the section title appear above the linked article title. Similar to a section title that appears on a 'Trending in Community' post on the homepage.
0
Ifra Saqlain
Hi Courtney Diaz,
Welcome to Cmmunity!
here is your solution:
i). Go to the home_page.hbs file. Make sure your Promoted article's code should have some more code which is checking the categories , sections and article and then your promoted article's code to be inside it as I shared below.
ii). Promoted articles code with section title.
iii) Go to your script.js file and add this line of code.
iv). Make sure your document_head.hbs file must have JQuery CDN.
Output:
Try and if any confusion feel free to ask :)
Thanks
1
Courtney Diaz
Ifra Saqlain Apologies for the additional questions, and I GREATLY appreciate the additional code. I am not a coder by any means, so would this code you provided need to replace the current code or would this just need to be added?
0
Ifra Saqlain
@Courtney Diaz, Please don't apologies, it's a community forum where people communicate to each other for their queries and their issues...
This place is for you, please feel free to ask any question related to your Zendesk , we will always be there. We are just like your friends :)
Whenever I need help , I come to the community and ask to help. I'm just like you...
0
Ifra Saqlain
@Courtney Diaz,
Yes, that code need to be replaced otherwise you will have two sections of promoted articles :)
Please make sure about the classes or you can share your current code here so I'll check the class name and I'll provide the new code then you will only need to copy and paste to your home_page.hbs
0
Courtney Diaz
Ifra Saqlain Thank you so much! Here is the current code string, I may have copied some extra, but here is what appears between the two areas on our home page.
{{#is settings.toggle_promoted_articles 'yes'}}
{{/if}}
0
Walter
Hi Courtney Diaz
I believe you only need to replace this part:
0
Ifra Saqlain
Hi Courtney Diaz,
@Walter explain in the right way, you only need to replace only with promoted article code.
I have add update the code so now just copy the given code and paste there.
0
Courtney Diaz
Hi Ifra Saqlain, I greatly appreciate the code provided. However when I replaced the previous code with it (which is working, so again thank you!), it is now pulling in every section title, not just the titles for the articles that are being promoted. Which is creating a MASSIVE list on he homepage.
Any way to limit it to only the titles that are associated to a promoted article? Thanks
0
Ifra Saqlain
Hi Courtney Diaz, add that script code which I shared above:
script.js file--
JQuery CDN need to be added to document_head.hbs file.
0
Courtney Diaz
Hi Ifra Saqlain, I did add the script you provided, but it is still pulling in every section title, not just the titles for the promoted articles.
0
Ifra Saqlain
Please share your help center public URL here so I can see the issue. After solving the issue you can delete from here.
0
Courtney Diaz
Ifra Saqlain unfortunately, our sites are not public. I would need to have you registered, and it may kick you out as these are sites that are for our current client base, and if your email domain doesn't authenticate against a registered domain, it won't let you in. I greatly appreciate all of your help thus far.
0
Ifra Saqlain
Okay, you can check by yourself, I'll tell you how?
Open your theme's preview mode > Right click of your mouse > A list will be open > Select Inspect > Dev tool will be open > Open Console tab > If there is any error take screenshot and share with me.
Dev Tool > Console tab:
0