arambalakjian / DataObject-as-Page

A SilverStripe module for displaying DataObjects as Pages
53 stars 27 forks source link

Title and Content fields not needed #17

Closed petebacondarwin closed 11 years ago

petebacondarwin commented 11 years ago

We should not be forced to have Title and Content fields onour DataObjectsAsPages. The Content should be removed completely as it is not required by the DOAP infrastructure. The DOAP should be refactored to allow Title to be an optional field, set in the extended class, not in DOAP.

arambalakjian commented 11 years ago

This was due to the way it was previously setup to be searchable and so needed these fields. It could now be removed however so I might do that.

arambalakjian commented 11 years ago

Thinking about it, the logic could be applied to SiteTree also. I think the idea was that this was to create a 'Page Like' object from a DataObject. If Title is removed, then URLSegment has nothing to reference when it is created. All objects that are viewable in SilverStripe should have a Title field. Content field could be removed I guess.

petebacondarwin commented 11 years ago

I think it could be clever. DataObjectAsPage is an abstract class yes? So no one will use it directly. The agreement should be that the user (i.e. developer) must provide "some" field from which the URLSegment is generated. The idea being that "Title" is too restrictive and makes people hack their problem domain. For instance, what if my DataObjectAsPage was a Person? In that case Title would mean something different (i.e. Mr, Mrs, Dr, etc) and you would not want to use this to generate the segment. Pete

On 9 November 2012 13:29, Aram Balakjian notifications@github.com wrote:

Thinking about it, the logic could be applied to SiteTree also. I think the idea was that this was to create a 'Page Like' object from a DataObject. If Title is removed, then URLSegment has nothing to reference when it is created. All objects that are viewable in SilverStripe should have a Title field. Content field could be removed I guess.

— Reply to this email directly or view it on GitHubhttps://github.com/arambalakjian/DataObjects-as-Pages/issues/17#issuecomment-10226349.

arambalakjian commented 11 years ago

Yea that's a good idea, so you set a static or something in the Child Class which tells it what to use as the URL Segment source?

I still think it is good practice to give always have a 'Title' field as this is assumed across many SS functions such as defaults for mapping and used in search results (not that I think I will be able to get this working in the search like the 2.4 module did, but I assume Solr and Lucene use Title fields also.