tags:

views:

49

answers:

1

I developed a homemade CMS that posts articles and blog items, and I want to insert a block of Related News Items (basically, just a dynamic unordered list) that floats within the body copy of every article around the middle with text wrapping around it.

Is there a best practice that someone knows for getting this done? I don't want the writers to have to paste Label Control code that would permanently reside in the body copy and I would like to be able to remove the block down the road without having to do a mass Find/Replace within the database.

I know I can easily nest a control on the page to present the block, but the problem is that I don't know how to get the text within the body copy (simply text and p tags) to wrap around the block without the block residing within the same p tags.

I do understand that there are full-fledged content management systems that might be easier, but I need to use this CMS for now.

Thanks in advance...

A: 

I would add a table to the database and insert the related items there, referencing the main item's PK. Then do a LEFT JOIN on that table when retrieving an article. If there are related items, construct a floating div for display. That way, you can always remove the code that checks for related items in the future.

MikeB