filter by attribute set
Permalink Browser Info Environment
Hi,
This is a good learning block. How would you go about filter custom page attributes by attribute set?
This is a good learning block. How would you go about filter custom page attributes by attribute set?
Type: | Discussion |
---|---|
Status: | Archived |
If you wanted to add a user interface to select a set, that is all standard writing a block level skills to add extra components to the dialog and database, so I won't try an teach that here.
To hard code a set (or use what you have added to the interface), you will need to write code in the block view and/or the library dump_collection_attrs (or the base class) (ideally using an override rather than modifying the actual block code in situ).
Here, the processing is centred on a list of all attributes for a collection. You could loop through them, find out which are /are not in the set, and modify the list accordingly.
The developer docs on attributes ( http://www.concrete5.org/documentation/developers/attributes/overvi... ) are a bit out of date, so you will need to look at the core code to work out the details. Maybe see what the dashboard interface does to group attributes into sets.
Filtering by set isn't a change that I would consider for the block.
However, adding a column for attribute set to the table of attributes output is something that I would consider a good addition to this block. To do that, the code for the change could be built into show_list in the dump_attrs_base class.
If you were to get such an addition to the output table working, I would consider publishing it in a new release of the addon (with full credit of course).