Open demianturner opened 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.
[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?
[demian] Hi AJ - i'm not sure which code you're referring to that you remove.
[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
[demian] sounds fine to me, I suppose you could also set the catId to null for static articles, doubt that would break anything.
[werner] aj: your comment on static articles' catId = null ?
[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.
[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.
[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.
[demian] as no patches are coming in for this ticket i'm de-scoping it
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 }}}