I have a bunch of blog posts in my app and track the total # of unique views for each. Is there a way to create a list that dynamically shows say the 10 posts with the highest views? Right now, I just manually populate a “Most Popular” sheet and display the list, but I’d like to automate this.
One possible solution I thought of was just using my All Posts sheet, sort by # of Views and then limited the # of entries to 10. But how do I do it without showing the “See All” link? I tried to use CSS to hide the link, but it hides all the “See All” links and not just the one for this specific list.
div data-test=“app-horizontal-list” cols=“10” class=“sc-cCwQvm ccaWIF”
div class=“sc-xGAYn jEdJtV”
div class=“sc-kYQaHc BatEQ”>Most Popular </div
button data-test=“see-all” class=“sc-cSiBin eXcwcg”>See All</button
div
Thanks Lucas, but I have 6 other Inline lists on the same page, so the above code hides the “See All” for 6 vs just 1 particular Inline List. Anyway to isolate the button to just 1 particular list?
What you could do is add a filter condition to your inline list such that it only shows posts where views is greater than X.
But assuming that you want to show (say, for example) just 10 posts, then the tricky part would be dynamically determining the correct value for X. There should be a way to do it, but I’d need to think about that for a bit…
On the Home Tab, you’ll see several Inline Lists for “Featured”, “Most Popular” and then for different Continents. All lists are limited to display 10 as there could eventually be 100’s for each continent. I would like the option for people to click “See All” for the Continent lists, but for “Most Popular”, the “See All” option just doesn’t make much sense, especially when users can view all Posts under the Journey’s tab.
I would agree with @Darren_Murphy’s idea, but yes, determining the right cutoff point for a filter is tricky. I’m wondering if @Lucas_Pires’s idea with the CSS would work if you added an nthe child [1] or something like that to single out the first instance of ‘See All’.
@Darren_Murphy gave you a good point too if you determine the right cutoff point for a filter
Here’s also what I did in one of my apps. You can use the filter (or the code) and add some “See All” button below. In my opinion it’s more intuitive, like facebook does
Yea the tricky part is that because the app is fairly new, there isnt much view data. But that could be a decent solution down the road when I do have a better idea where the best cut off would be. Would be something I’d have to keep on top of though.
In your example, did you just set buttons to link to a deep link?
Thank @marcioferlan, he helpes me a lot and helped me to find this!
Obs:
This :nth-of-type (1) has to match the ordinal of the component that represents the inline, you know? If there are other components above the first inline, this ordinal has to be adjusted.