Plots2: blog tab not working after page 5

Created on 11 Oct 2018  ยท  8Comments  ยท  Source: publiclab/plots2

I was exploring some older posts on the blog (www.publiclab.org/blog) when I noticed I couldn't tab back more than the 4 pages that show on the bottom of the blog. If you try to hit "next" once you're on page 4 nothing happens.

screen shot 2018-10-11 at 4 31 51 pm

@publiclab/mentors here's another bug that might be made into a good issue :)

bug in progress

Most helpful comment

@steviepubliclab as you've already figured out, it's not due to number of blogs that the blog tab is not working after page 4*.

This is really because in file :
/plots2/app/controllers/tag_controller.rb

#code-snipet

  def blog
    nids = Tag.find_nodes_by_type(params[:id], 'note', 20).collect(&:nid)
    @notes = Node.paginate(page: params[:page], per_page: 6)

#code-snipet

You'd notice we're passing a limit of 20 blogs to the model, and there are 6 blogs on each of page 1, 2, 3 and remaining 2 on page 4, which make all of it.

I'm not sure why this has been implemented in such a way, I'd like @publiclab/mentors to explain it better. :star:

All 8 comments

Hi! Is it possible that there are not enough blog entries to populate a 5th page? I ask because when I try to navigate to https://publiclab.org/blog?page=5 I get "No results found; try searching for 'blog':"

You are right @quinn-codes-synthesis, as seen from the above image too, the Next button is disabled after arriving at Page 4 as there is no 5th page. @steviepubliclab do you think, this issue can be closed now? Thanks!

Oh no sorry, there are a lot more blog entries than that. Should go back about 3 years. (at least)

Best,
Stevie

@steviepubliclab as you've already figured out, it's not due to number of blogs that the blog tab is not working after page 4*.

This is really because in file :
/plots2/app/controllers/tag_controller.rb

#code-snipet

  def blog
    nids = Tag.find_nodes_by_type(params[:id], 'note', 20).collect(&:nid)
    @notes = Node.paginate(page: params[:page], per_page: 6)

#code-snipet

You'd notice we're passing a limit of 20 blogs to the model, and there are 6 blogs on each of page 1, 2, 3 and remaining 2 on page 4, which make all of it.

I'm not sure why this has been implemented in such a way, I'd like @publiclab/mentors to explain it better. :star:

Nice catch @shubhangi-chauhan! I am really confused why is there limit placed on blog nodes at first place. Anyways, @steviepubliclab @jywarren so we want to increase the nodes limit or display all the blog nodes?

@shubhangi-chauhan you can solve this issue if you want as soon as any @publiclab/community-reps gives :+1: .
Thanks!

Yes let's increase the total! Awesome find!!!

On Sun, Oct 21, 2018, 2:24 PM Gaurav Sachdeva <[email protected]
wrote:

Nice catch @shubhangi-chauhan https://github.com/shubhangi-chauhan! I
am really confused why is there limit placed on blog nodes at first place.
Anyways, @steviepubliclab https://github.com/steviepubliclab @jywarren
https://github.com/jywarren so we want to increase the nodes limit or
display all the blog nodes?

@shubhangi-chauhan https://github.com/shubhangi-chauhan you can solve
this issue if you want as soon as any @publiclab/community-reps
https://github.com/orgs/publiclab/teams/community-reps gives ๐Ÿ‘ .
Thanks!

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/3676#issuecomment-431691858,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ3gmqR1vylq47edI0BuZQqJ8Csm-ks5unLu7gaJpZM4XYUT4
.

Quoting @gauravano ,

Anyways, @steviepubliclab @jywarren so we want to increase the nodes limit or display all the blog nodes?

Let's increase the limit, but still show the same # per page. Make sense?

On Wed, Oct 24, 2018 at 11:32 PM Shubhangi Chauhan notifications@github.com
wrote:

Quoting @gauravano https://github.com/gauravano ,

Anyways, @steviepubliclab https://github.com/steviepubliclab @jywarren
https://github.com/jywarren so we want to increase the nodes limit or
display all the blog nodes?

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/3676#issuecomment-432902518,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ6tM4chTIcRKoyw3pyGYF9N_FXDrks5uoTC-gaJpZM4XYUT4
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sagarpreet-chadha picture sagarpreet-chadha  ยท  72Comments

grvsachdeva picture grvsachdeva  ยท  183Comments

SidharthBansal picture SidharthBansal  ยท  142Comments

jywarren picture jywarren  ยท  69Comments

jywarren picture jywarren  ยท  98Comments