Re: PHP, Smarty, and Text

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 13, 2009 at 6:49 PM, Daniel Kolbo <kolb0057@xxxxxxx> wrote:

> Hello,
>
> I've been using PHP and Smarty for several years now and I am happy with
> this "division" of data from presentation.  With this philosophy in mind, i
> am a bit perplexed as to how to handle the text on my sites.  That is, the
> text is data, so i am motivated to store the text in a database, files, or
> the like, but then text is loaded with little markup nuances (random
> italics/weight/colors, etc...) that make template design rather ugly.  This
> motivates me to put markup (maybe even my own brand of markup) around the
> text, and to store this markup-text combination in a database.  But I don't
> like this either, because a lot of the people writing the content/text know
> word/writer not markup.  So i am motivated to have them save their text as
> .html, and I parse this file and modify accordingly.  However, i don't like
> this either as not all word/writer styles are 1-to-1 with CSS.  Without any
> options I am back to thinking "hard code" the text with markup in included
> templates, but it hurts just thinking of updating/modifying.
>
> I have looked (briefly) at Web Content Management Systems, but this seems
> like overkill really, maybe i'm ignorant.
>
> What would the community suggest?  The text can take on many forms,
> introduction text, about text, product information, articles, blurbs, (some
> changes daily, some doesn't) etc...where does all this text live in
> 'properly' designed site.
>
> Thanks in advance,
> dK



For specific requirements like this. I think it is very OK to set some
rules  when the user inputs the text. You can make the simple text area and
make some custom tags for ur application only. For example <bold> in ur
application means <b> in html.

This way you can str_replace all that user enters in to watever class or
text u want to to make it look pretty. Its an easier way and reliable way
because you have the authority to validate user input if it does not match
certian criteria that you may need.

I don't know you can never blame user for what he enters. Not every user is
computer literate and our code should always cater the needs of this kind of
user and I feel its perfectly ok to tell the user to enter proper data if it
doesnot meet ur standards.

Thanks,
V

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux