Page Attribute versus Block

Permalink
Dear developers,
I recently moved from Wordpress to Concrete 5 and must say I'm extremely pleased. Concrete 5 feels much more like a actual (and decent) CMS system to me. Right now I got stuck at a development decision I have to make and I'm searching for some extra information about this subject.

I have a collection of models (like photomodels), each of these models have their own little "portfolio" page. I'm using the pagelist block with a custom template I created to list some information of these portfolio pages (name, picture and age). These portfolio pages are subpages of the model overview page (the page where I list some of the data). At the moment I have created custom page attributes that contain this data. But this attribute data is also displayed on the webpage so it feels much more like I should use blocks (set as template default) for this purpose instead of attributes.

I hope anyone can explain to me when to use attributes and when to use blocks since in my example all the attribute data is showed on the website but also needed to provide the filter functionality.

Thanks in advance,
Marco

 
emirii replied on at Permalink Reply
emirii
I think a block would be an easy option for you.

Create a block, in edit mode have a few fields:
Name Input Field
Age Input Field
Image Select Input

In view mode:
Show the image selected
Display Name/Age any way

An awesome free add-on is Designer Block that can give you examples of all these types of fields to help build the block.

That way, you can use this block on all of your different model's pages with their unique data. It would also be easy to edit through edit mode on the front end page.

Welcome to the light side :D I dumped wordpress as well.
puurlef replied on at Permalink Reply
Thanks for your quick reply,
I have used Designer Block when I started working with Concrete 5. But then I read somewhere (cant remember where) that using page attributes was the way to go. But now it doesn't seems like it. When I create a custom block how can I retrieve the page data in the pagelist view ? I guess using the page id right ?

I'm using the age, size and gender fields in a filter so what should I do with those? As well extract from the custom block or keep them as page attributes ? When I keep them as page attributes its getting quite hard to maintain all the data since you have to edit them at two separate places (inside the block and as custom attribute).

I like it pretty much on the light side! :) Concrete feels like a gift from heaven in comparison to wordpress
JohntheFish replied on at Permalink Best Answer Reply
JohntheFish
The useful thing about page attributes is that you can easily search and filter a page list on them. Info in a block can only at best be text searched.

If you don't need the attributes to search/filter, there are many ways for a block to be used in more than one place:
http://www.concrete5.org/documentation/how-tos/designers/show-conte...
puurlef replied on at Permalink Reply
Thnx for your reply, didn't knew that attributes are better for search/filter.. In this case the filter works based on html classes & javascript (show and hide) and is not based on mysql select querys. In this case I don't think I need an attribute (maby size since it's used on the filter but not showed on the webpage itself). Your link about content in multiple places really helpfull :)

Thank you
JohntheFish replied on at Permalink Reply
JohntheFish
>> page attributes is that you can easily search and filter a page list on them

Please be sure, what I am referring to in that statement is only how a page list block selects what pages to show. Not general site searching.
puurlef replied on at Permalink Reply
Sorry for my misunderstanding. I indeed thought you were talking about page searching. In my case the page list has to select all the sub pages, because the filtering is achieved by some front-end modifications (css + javascript).

Thanks for you explanation it will definitely come handy in near future projects, since the css & javascript filtering isn't the best solution for large amount of pages.