Simple CMS Functionality

Coordinator
Mar 1, 2010 at 11:13 PM

I am adding a database table to save content (html) for a controller/action combination. This will allow simple cms functionality.

 

Thoughts?

Developer
Mar 2, 2010 at 5:43 AM

Is this going to be as simple as a paragraph or two of text and simple html, or will you want it to be able to add structure as well? Will there be a need for dynamic lookup values that we want to show without updating the content? i.e.:

Lorem ipsum dolor sit amet, consectetur [[UG Admin]] adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

 

Coordinator
Mar 2, 2010 at 4:57 PM

We don't currently have a large site with tons of dynamic html content that needs to be maintained. I think the only active content we have to address right now is the event and speaker information. Could we use the CMS functionality to maintain this type of content? If not, I think the CMS functionality would still be nice to have because it would allow us to address some of the other maintainability issues up front. The magic fields, aka dynamic lookup values, would also be a nice to have feature on top these CMS services. But I think we should hold off on developing the magic fields until we get some feedback from the administrator.

Coordinator
Mar 4, 2010 at 4:23 PM

My initial design was to hold the controller name, action name and a block of html (no script). We could extend this by adding a title ad heading to inset content into those sections as well. Do we need more than this for this site? 

Coordinator
Mar 4, 2010 at 9:09 PM

I have finished an early implementation of this CMS functionality.

 

To Create a content page

/Content/Create/Controller/Action

To Edit

/Content/Edit/Controller/Action

examples:

/Content/Edit/History/Detail

/Content/Edit/Organization/Detail

 

Saving will show the detail view

/Content/Controller/Action

examples:

/Content/History/Detail

/Content/Organization/Detail

 

Please review and give me feedback for improvements

Developer
Mar 4, 2010 at 9:32 PM

I like to overthink things and usually don't have the benefit of 2 professionals to reel me in... with that said...

I was thinking about how it would work with simple text ids - that way we could use more than one chunk of inline content on a given page (which is responsible for the layout). The team and events page could benefit from this approach - one entry per item to be rendered. For items that are part of a group, like the team members, we'd have to define a sequence field to control the sequence used to render the items. Items could be removed from the sequence by either removing it from the table entirely, or by setting its sequence to 0. From the view's perspective, it would function similarly to a data repeater.

What do you think?

Developer
Mar 4, 2010 at 9:33 PM

Whoops, I didn't realize you had already implemented anything.

 

Coordinator
Mar 4, 2010 at 11:50 PM

LOL! I updated the functionality to work off of the default route. This modifies the way the views are called:

 

To Create a content page

/Content/Create/Controller/Action

To Edit

/Content/Edit/Controller/Action

examples:

/Content/Edit/History/Detail

/Content/Edit/Organization/Detail

 

Saving will show the detail view

/Controller/Action

examples:

/History/Detail

/Organization/Detail

 

The only downside to this is an application level HashSet that contains the names of the controller/action pairs. This avoids having to hit the database every time to see if it a real or virtual route. I think we can add a repository function to fill this hashset and call this event on application start and every time the Content Edit and Create events are called.

 

 

Please review and give me feedback for improvements

Coordinator
Mar 4, 2010 at 11:52 PM

jl, I think we can make a simple modification to the content table to specify if it is a markup block or an entire page. A simple html helper could them be used to load markup blocks on demand.