Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Content from Layout and formatting large blocks of Text

LEGEND ,
Feb 19, 2009 Feb 19, 2009

Copy link to clipboard

Copied

I've heard the mantra to keep Content separated from Layout.

With this in mind, I'm wondering how to format large blocks of content
that need formatting?

For example I have a product that will fill a page with text. Since I
can't take the time to dynamically develop a whole page for each
product, I must copy all the text into one row in a database. My problem
is then the fact that there are no individual headers, paragraph breaks
and all the rest of the content within that block of text.

What's the best solution for formatting content like this?

Should I use "classes" to block up the content and then format it using
CSS?

Is there a user interface that will write these classes?

Thanks




TOPICS
Server side applications

Views

606
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 19, 2009 Feb 19, 2009

Copy link to clipboard

Copied

Yahoo has it's own rich text library but this produces html like below
so I don't think that conforms to the Content from Layout mantra.

http://developer.yahoo.com/yui/examples/editor/code_editor_clean.html

Below is the text produced

This is some more test text.<br>This is some more test
text.<strong><br></strong><div style="text-align: center;"><ol
style="text-align: left;"><li><strong>This is some more test
text.</strong></li><li><strong>asdfasfdasf</strong></li><li><strong>asdfasf<br></strong></li></ol></li><strong><br></strong></div>This
is some more test text.<br><span style="background-color: #8000ff;">This
is some more test text</span><span style="background-color:
#8000ff;">.</span><br>This is some more test text.<br>This is some more
test text.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 20, 2009 Feb 20, 2009

Copy link to clipboard

Copied

Art wrote:
> I've heard the mantra to keep Content separated from Layout.
>
> With this in mind, I'm wondering how to format large blocks of content
> that need formatting?
>
> For example I have a product that will fill a page with text. Since I
> can't take the time to dynamically develop a whole page for each
> product, I must copy all the text into one row in a database. My problem
> is then the fact that there are no individual headers, paragraph breaks
> and all the rest of the content within that block of text.
>
> What's the best solution for formatting content like this?
>
> Should I use "classes" to block up the content and then format it using
> CSS?
>
> Is there a user interface that will write these classes?

I would store the html and the text in the one column, and just display
that. I would use an rich text editor, like fckeditor, or tinymce on the
insert/edit page, which will store it in the database. When you display
it on your page it will be displayed as per your initial creation.

Dooza
--
Posting Guidelines
http://www.adobe.com/support/forums/guidelines.html
How To Ask Smart Questions
http://www.catb.org/esr/faqs/smart-questions.html

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 20, 2009 Feb 20, 2009

Copy link to clipboard

Copied


>
> I would store the html and the text in the one column, and just display
> that. I would use an rich text editor, like fckeditor, or tinymce on the
> insert/edit page, which will store it in the database. When you display
> it on your page it will be displayed as per your initial creation.
>
> Dooza

I looked at both of those and they both write html but I'm trying to
stay away from putting html in with data.

Do you know of something that doesn't put html in with copy?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 20, 2009 Feb 20, 2009

Copy link to clipboard

Copied

After a little more looking, it seems that BBCode is more like what I
want but I think this is something that runs naturally on PHP servers?

Not sure but I suppose something like this needs a component running on
the server for it to run unless it's javascript-based and supplies it's
own command library.

All things considered, perhaps I don't know what I want.

What does everyone here think of putting html into a database?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 20, 2009 Feb 20, 2009

Copy link to clipboard

Copied

I'm starting to think that I need a wysiwyg program that will write css,
not BBCode, into a form field?


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 23, 2009 Feb 23, 2009

Copy link to clipboard

Copied

Art wrote:
> I'm starting to think that I need a wysiwyg program that will write css,
> not BBCode, into a form field?

You want formatted content on your page that is stored in a database?
Then you need to use code in the content, either BBCode or HTML. Doesn't
matter which, apart from when you use BBCode something needs to
translate it into HTML, so you may as well use HTML, unless its random
people you are giving access to store the code, then use BBCode as its
safer.

Dooza
--
Posting Guidelines
http://www.adobe.com/support/forums/guidelines.html
How To Ask Smart Questions
http://www.catb.org/esr/faqs/smart-questions.html

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 23, 2009 Feb 23, 2009

Copy link to clipboard

Copied


> You want formatted content on your page that is stored in a database?
> Then you need to use code in the content, either BBCode or HTML. Doesn't
> matter which, apart from when you use BBCode something needs to
> translate it into HTML, so you may as well use HTML, unless its random
> people you are giving access to store the code, then use BBCode as its
> safer.
>
> Dooza


By the way, have you heard about putting CSS classes in content?

I'm just trying to build for the future and I don't really want to go
back into all this data and pull html code out of the content.

Unless someone else has a better idea, I think that settles it.

Thanks Dooza.







Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 23, 2009 Feb 23, 2009

Copy link to clipboard

Copied

Art wrote:
>
>> You want formatted content on your page that is stored in a database?
>> Then you need to use code in the content, either BBCode or HTML.
>> Doesn't matter which, apart from when you use BBCode something needs
>> to translate it into HTML, so you may as well use HTML, unless its
>> random people you are giving access to store the code, then use BBCode
>> as its safer.
>>
>> Dooza
>
>
> By the way, have you heard about putting CSS classes in content?

How would you do this? You need to hook the class onto something, like a
p tag, so you will need an editor. One of the great things about
fckeditor is that you give it the classes that it could use, so you can
view your text as your typing it in the correct style.

> I'm just trying to build for the future and I don't really want to go
> back into all this data and pull html code out of the content.
>
> Unless someone else has a better idea, I think that settles it.
>
> Thanks Dooza.

What have you decided to do?

Dooza

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 23, 2009 Feb 23, 2009

Copy link to clipboard

Copied

> How would you do this? You need to hook the class onto something, like a
> p tag, so you will need an editor.

You're right. Classes wouldn't work unless I was willing to put some
html into it.

> What have you decided to do?
> Dooza

I think I'm going with TinyMCE since I already have it installed and
working on the server. It's for internal use so I guess it's not a big
deal.


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 23, 2009 Feb 23, 2009

Copy link to clipboard

Copied

LATEST
Art wrote:
>> How would you do this? You need to hook the class onto something, like
>> a p tag, so you will need an editor.
>
> You're right. Classes wouldn't work unless I was willing to put some
> html into it.
>
>> What have you decided to do?
>> Dooza
>
> I think I'm going with TinyMCE since I already have it installed and
> working on the server. It's for internal use so I guess it's not a big
> deal.

Good choice, wordpress uses a cut down version of TinyMCE and I haven't
had any problems with it so far.

It may not be a big deal for this project, but your thinking about it,
which is good, as when it does become a big deal you have already done
your research and will be able to move forward with it quicker.

Dooza
--
Posting Guidelines
http://www.adobe.com/support/forums/guidelines.html
How To Ask Smart Questions
http://www.catb.org/esr/faqs/smart-questions.html

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines