"Featured" Pages
Permalink
Maybe I'm just dumb, but how do you make a page a featured page so that the page list filters for them with the "Featured pages only." option.
I figured the page attribute wasn't created, so I tried using a check box with the handle "featured" and "IsFeatured"
No luck.
I figured the page attribute wasn't created, so I tried using a check box with the handle "featured" and "IsFeatured"
No luck.
Bump
but I didn't check... I think there's a __call method somewhere in the page list model in case this doesn't work, check it to see what attribute you need to add
function filterByIsFeatured
So it would be is_featured rather than IsFeatured?
I should have figured that. :p
Thanks Remo!
So it would be is_featured rather than IsFeatured?
I should have figured that. :p
Thanks Remo!
I think c5 uses camel case stuff quite often..
But I'm not sure, you have to dig into the code a bit to understand it
But I'm not sure, you have to dig into the code a bit to understand it
That at least gave me a sweet error.
An unexpected error occurred. mysql error: [1054: Unknown column 'cv.cvIsFeatured' in 'where clause'] in EXECUTE("select distinct p1.cID, if(p2.cID is null, pt1.ctHandle, pt2.ctHandle) as ctHandle from Pages p1 left join Pages p2 on (p1.cPointerID = p2.cID) left join PageTypes pt1 on (pt1.ctID = p1.ctID) left join PageTypes pt2 on (pt2.ctID = p2.ctID) inner join CollectionVersions cv on (cv.cID = if(p2.cID is null, p1.cID, p2.cID)) where 1=1 and cv.cvIsFeatured = 1 and cvName != '' and cvIsApproved = 1 and (p1.cIsTemplate = 0 or p2.cIsTemplate = 0) and (p1.cID not in (5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43) or p2.cID not in (5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43)) order by cvDatePublic desc limit 0,5 ")
Just another thing we need to do a better job of documenting.
The page attribute should have the handle of "is_featured".
The page attribute should have the handle of "is_featured".
It should be a "checkbox" or "boolean" type.
Thanks for the help guys, but I'm still getting the error. I think the problem is the block. I'm tracing it back now. We'll see.
Since it's already set in the page list block type, I think this should be included in the installer??
I'll submit this as a Feature request
I'll submit this as a Feature request
It took me a couple of hours to understand what was going on.. I also wanted to do this.
1.
I added the following in the file:
YOURWEB\concrete\models\page_list.php
Line: 158
2. I added a Page Attribute called "isFeatured". Go to
Dashboard-> Pages and Themes -> Page Types-> Page Attributes.
I. Add page Attribute.
II. Handle "isFeatured", Type "Check Box", Name "isFeatured".
and the feature should work.
I tried the things that were mentioned here but no luck.
My Concrete5 version is Con5 v5.3.0
1.
I added the following in the file:
YOURWEB\concrete\models\page_list.php
Line: 158
public function filterByIsFeatured($data) { $this->filterByCollectionAttribute('isFeatured', $data, "="); }
2. I added a Page Attribute called "isFeatured". Go to
Dashboard-> Pages and Themes -> Page Types-> Page Attributes.
I. Add page Attribute.
II. Handle "isFeatured", Type "Check Box", Name "isFeatured".
and the feature should work.
I tried the things that were mentioned here but no luck.
My Concrete5 version is Con5 v5.3.0
It should be able to filter on any page attribute to be able to use page attribute like taxonomy in drupal...
Could be great to create collection of page about some particular subject...
Could be great to create collection of page about some particular subject...
It would be nice to have a dynamically created list of visible page attributes that the page-list can be filtered by.
For example a list of check boxes.
This doesn't seem to hard to implement... in my head at least.
I'll try to set this up if I get some free time.
For example a list of check boxes.
This doesn't seem to hard to implement... in my head at least.
I'll try to set this up if I get some free time.
Sure,
could use "tags" in text fields attribute too...
And some day create some tags clouds as a sitemap index... :)
Got so much ideas and so little time...
could use "tags" in text fields attribute too...
And some day create some tags clouds as a sitemap index... :)
Got so much ideas and so little time...