highlight entry

Permalink Browser Info Environment
Is it possible to use custom attributes to assign a pro blog entry as
'highlighted' or 'sticky' so when we show a list of blog entries (previews in a sidebar) the blog entries which are highlighted are first in the list?

Type: Discussion
Status: New
opuscambodia
View Replies:
RadiantWeb replied on at Permalink Reply
RadiantWeb
yes..you can add any attribute type to the "ProBlog Additional Attributes" attribute set, and it will be available on posting.

Then, in whatever view you're using, find the page object type var. In list views, this is typically $cobj. In the content block this is normally $c.

you can then call the attribute by it's handle from that object like so:

$sticky = $cobj->getAttribute('sticky_post');
echo $sticky;


or you can then also filter by a var by adding the following just above where the loop starts in the list view. You will need to take the page list object before it's looped, add a filter, to then re-get the pages and redefine the list of pages. the filter should look for "ak_"+ your attribute handle. Typically, the pre looped "container" of page objects is called "$cArray" . You can do this in the view just above the $cArray loop like so:

$pl->filter(false,"ak_sticky_post = 1");
$cArray = $pl->get();


Now the loop will only display your sticky posts.

In general, this is how to do this with any attribute. However, select attribute types need to filter differently like so:

$pl->filter(false,"ak_my_select LIKE '%\n$keyword\n%'");
$cArray = $pl->get();


ChadStrat

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.