Categories and DragSortOrder
2 posts by 2 authors in: Forums > CMS Builder
Last Post: April 3, 2012 (RSS)
By Perchpole - April 2, 2012
Hello, All -
In the early days of CMSB I experimented with a lot of different ideas. Some of them were pretty weird (lots of them still are!).
In one instance I created an entire website for a client using nested categories instead of normal records. This worked surprisingly well (especially in terms of controlling the hierarchy). The only problem is that whenever my client adds a new record (news item, article, etc), CMSB adds it to the very end of the category listing!
That wasn't a problem a couple of years ago - but after building up about 200 records he's getting a bit miffed!
The problem is that a category listing cannot use DragSortOrder - so he can't "drag" the article to the top of the listing. Instead he has to rely on those "up-and-down" arrows, clicking each one in turn to bump the article up through the older records.
He's going mad!
Is there anything I can do?
At the ver least, is there a way I can make a new record appear at the top of the list - not the bottom?
:os
Perchpole
In the early days of CMSB I experimented with a lot of different ideas. Some of them were pretty weird (lots of them still are!).
In one instance I created an entire website for a client using nested categories instead of normal records. This worked surprisingly well (especially in terms of controlling the hierarchy). The only problem is that whenever my client adds a new record (news item, article, etc), CMSB adds it to the very end of the category listing!
That wasn't a problem a couple of years ago - but after building up about 200 records he's getting a bit miffed!
The problem is that a category listing cannot use DragSortOrder - so he can't "drag" the article to the top of the listing. Instead he has to rely on those "up-and-down" arrows, clicking each one in turn to bump the article up through the older records.
He's going mad!
Is there anything I can do?
At the ver least, is there a way I can make a new record appear at the top of the list - not the bottom?
:os
Perchpole
Re: [Perchpole] Categories and DragSortOrder
By (Deleted User) - April 3, 2012
Hi Perchpole,
Unfortunately in order for the Category structure to work, the records have to remain nested in their respective category/sub-category.
When adding a new record, you can set which category/sub-category the new record belongs to which can eliminate some of the frustration, however after that it's just a case of bumping one step at a time.
The other alternative is to create a new multi-record view and add new records to it instead. Adding a field for 'category' through 'Section Editors'->'{table}'->{Add list} using the pulldown/get options from database then choose the categories table with 'num' as the stored value and 'name' as the list value will then enable you to assign category/sub-category to the record and you'll still be able to use dragSortOrder to re-arrange the records relative to each other.
When retrieving the records, you'll have to getCategories and then getRecords for the category selected, then loop over the returned getRecords when outputting in order to maintain the dragSortOrder arrangement.
Of course, that's not exactly a simple solution, but it is perhaps a good idea to implement it now so that it's easier for the future.
Let me know if this helps,
Tom
Unfortunately in order for the Category structure to work, the records have to remain nested in their respective category/sub-category.
When adding a new record, you can set which category/sub-category the new record belongs to which can eliminate some of the frustration, however after that it's just a case of bumping one step at a time.
The other alternative is to create a new multi-record view and add new records to it instead. Adding a field for 'category' through 'Section Editors'->'{table}'->{Add list} using the pulldown/get options from database then choose the categories table with 'num' as the stored value and 'name' as the list value will then enable you to assign category/sub-category to the record and you'll still be able to use dragSortOrder to re-arrange the records relative to each other.
When retrieving the records, you'll have to getCategories and then getRecords for the category selected, then loop over the returned getRecords when outputting in order to maintain the dragSortOrder arrangement.
Of course, that's not exactly a simple solution, but it is perhaps a good idea to implement it now so that it's easier for the future.
Let me know if this helps,
Tom