demianturner / sgl-docs-tickets-migration-test

0 stars 0 forks source link

ArticleMgr: make array of items with categories #901

Open demianturner opened 11 years ago

demianturner commented 11 years ago

so you avoid spaghetti code like in add/edit method:

{{{ if ($input->dataTypeID == 2 || $input->dataTypeID == 6) }}}

which can be pretty ugly when you have more item types.

a simple

{{{ if ($in_array($categoryItems)) }}}

would be much more elegant

most elegant solution would be if the item object knows if it uses categories or not which would break BC and schema.

like

{{{ $item = & new SGL_Item(); $item->setDataTypeId($input->dataTypeId); $usesCategories = $item->usesCategories(); // true or false }}}

demianturner commented 11 years ago

[werner] why don't we just define that every item can use categories? is there really need to say that static html article doesn't have categories?

IMHO it's better for dealing with high numbers of items to sort even static html articles in categories.

demianturner commented 11 years ago

[aj] This is one of the first peices of code I remove when setting up a site that uses the publisher module. What do you have to say about it Demian?

demianturner commented 11 years ago

[demian] Hi AJ - i'm not sure which code you're referring to that you remove.

demianturner commented 11 years ago

[werner] the code in !ArticleMgr afaik as listed above in the description of this ticket

When working w/ aj on sgl_item we decided to make ALL item types with categories, even !StaticHtmlArticle which is the same like HTMLArticle then but can be accessed directly in !SectionMgr

demianturner commented 11 years ago

[demian] sounds fine to me, I suppose you could also set the catId to null for static articles, doubt that would break anything.

demianturner commented 11 years ago

[werner] aj: your comment on static articles' catId = null ?

demianturner commented 11 years ago

[aj] We could set it to null it wouldn't break anything. We could also allow static articles to be assigned to a category. This would make it so there is no difference between the 2 html article types and would us to remove it. I never use the Static Article type and think ti'd be more intuitive if we only had one html article type.

demianturner commented 11 years ago

[demian] be handy if we could include this improvement for the 0.6 series, i imagine cms module will be used after that. also, there are lots of folks using static articles so of course we have to respect that. i don't have any big opinions as these proposed changes don't affect me.

demianturner commented 11 years ago

[lakiboy] My 2 cents. I recently used publisher for one of the projects, and i must admit categories for static html articles are very helpful.

demianturner commented 11 years ago

[demian] as no patches are coming in for this ticket i'm de-scoping it