how to create html template to define editable regions

  • Thread starter Thread starter dSchwartz
  • Start date Start date
D

dSchwartz

I am creating a totally adminable news system in asp.net (C#, SQL
server). what i want to accomplish is allow multiple news templates
to be read by an admin area.

heres how it works (hopefully): an artist creates a news template
(html file), drops it into a specific directory, now a client can
choose that template and edit a certain number of fields. the artist
has to be able to specify these fields in the template somehow,
example:

....html tags...
news-NewsTitle-text-news
...html tages...
news-NewsDate-text-news
...html...
news-NewsImage1-image-news
...html tags....

now my admin area needs to read this template file and pull out of it
each of these fields to save to a db which describes the news article.

fieldname="News Title", fieldtype="text"
fieldname="News Date", fieldtype="text"
fieldname="News Image 1" fieldtype="image"

then based on that info i'll create an admin area where they can edit
the actual info saved for each of those. what i need some advise on
is how should i instruct the artists to label each of the fields in
the template, and then how should i pull that info off the template.

I'm pretty new to C# and asp.net, but have experience with classic
asp(vbscript). what i think of is useing filesystemobject, write a
function that will read the html templates line by line, looking for
"news-" and somehow extracting everything there before the "-news".
would this be a good situation to learn reg exp's to use here?

Thank You much for any time you are able to spend to give me a bit of
advise!
 
I'm pretty new to C# and asp.net, but have experience with classic
asp(vbscript). what i think of is useing filesystemobject, write a
function that will read the html templates line by line, looking for
"news-" and somehow extracting everything there before the "-news".
would this be a good situation to learn reg exp's to use here?

Thank You much for any time you are able to spend to give me a bit of
advise!


My first read would be that you would be much better off using XML, so
you can benefit from the .NET support for XML.

Rather than news being between news- and -news you use the XML
convention of <news>....</news>.

This would also make your system more scalable. You have a template
which consumes the XML to create news stories. By using XML rather
than your own codes you can easily convert the system to a webservice,
where you isolate the content contribution in on one site and the
template and publishing on another. In this way you can have the same
content read in to (consumed) by many sites on both .NET and JAVA
Enterprise servers, and you can consume news stories from multiple
services.

Do some research on SOAP and Web Services. It may give you a vastly
more powerful system with little more scaling, and open you site to
inclusion of portlets from the outside world as well as multiple
servers sites.
 
Back
Top