Add attribute to Pagelist block

Permalink
Hi all,
I see that the pagelist block allows for the option to us the attribute "is_featured" to display only pages which are "featured".

I'm wondering if there is an easy way to add an additional checkbox in the pagelist form that will allow me to filter the pagelist based on my "popular" attribute.

Any suggestions?

 
hutman replied on at Permalink Reply
hutman
There isn't an "easy" way to do this, you would have to override the PageList Controller and Add/Edit views to make it work as well as changing the db.xml to store an additional field in the database for this additional option.
stangn99 replied on at Permalink Reply 2 Attachments
Thanks for the quick reply.
I managed to mess around with the Page List block and got a little further. I'm still learning, and realize modifying core blocks is probably not a good idea.

That being said, I basically duplicated all the lines for "Is Featured" and replaced it with "Is Latest". I've already created an "Is_Latest" attribute.

In the Page List block Preview, i can see my content being filtered by the custom attribute. When I save the block though, all content shows and attribute filtering is ignored.


Please see attachments:
hutman replied on at Permalink Best Answer Reply
hutman
Did you update the db.xml and then go into the Blocks & Stacks and do a Refresh Block so that the setting is saving?
stangn99 replied on at Permalink Reply
That's what I was missing.
It's working great!

Thank you very much for the help.