Hi,
as many others I am trying to get into the ContentItem thing, to develop a workflow system.
I read a lot of posts here in the forum regarding this. Though I looked through the decorators, I still have some questions.
Why does the IContentItem interface has some attributes like section and urlFormat? I would have expected them in an implementation of the abstract ContentItem class. There are many cases I can Imagine where you do not need these attributes.
Have I overlooked something?
From what i understand, they are only really used when you want the content item to be searchable (ie, implement ISearchableContent).
I guess you could alter it to declare those in the ISearchableContent interface as apposed to IContentItem, however i am guessin that they have been implemented in the ContentItem abstract class so that any content item can just implement then interface and extend the abstract.
Does that make sence? Please extend on this if anybody knows otherwise.
That would make sense. This implies that every contentItem can only be used in one section. For example, we are working on an article module that lists the content filtered by categories. To be more precise, if you have publication news on one page you can set the module that way, so it only display publication news. Same for a project page. On the main page you will show all kind of news. In this case the articles aren't bound to a section but to a category.
Declaring the attributes in the ISearchable interface will leave it up to the ModuleController which anyway is responsible for the presentation.
This implies that every contentItem can only be used in one section
At the moment this is true and needed because of the backwards compatibility. All current infrastructure demands that content is bound to a specific section (or else where would a reference e.g. in a search result point to?).
Reusing content can be solved through categories. You'd have a display control that lists content of the desired categories while the content itself will be presented by the section that is the container of this content.
If your module supports presenting content from other sections, you have all the flexibility (e.g. home page with all news and specific pages with only product news or similar where the details can be displayed on any page) even with the 1:1 Section:ContentItem concept.
Max,
Yes, but backwards compatibility can be added and still use "symbolic links".
At the DB level its just to model the fact that Section can map to Many page nodes.
Higher up in the architect there are only suttle changes.
would not have to break existing old versions as the DB upgrade is very very simple.
The other aspect to all this is the fact that Actions can be attached to a section. This would not have to change at all as the actions will point to another section irrespective of where the two pages are.
ged
Max,
I kind of see what you are getting at my using the Categories technique.
i guess what i am trying to accomplish is to have 2 completly different views of the same content really.
I expect that the easist way of doing this woudl be to just create the module in such a way that one of the paramaters that is set in the admin ui for the section is the View ( ie a User Control).
Yes ? Makes sense?
But regardign the Categories thing, the problem i cant get my head around is how the to have a view on Page Node 01, for content that lives in Section X, that lives on Page Node 02 for example.
Can you see what i am getting at (or not as the case may be) ??
ged