PDA

View Full Version : How to separate content using tags or something?


Paws
08-01-2007, 08:53 PM
How to separate content using tags or something?
I have a page that is made up with tables and css and need to create tags or code to separate the text from eachother.

So if I have this text in table one: (from table called "field1")
This Home Page layout makes a great starting point for your website. Virtually all of the content is customizable, including the images, the text, and the links. You can decide whether to keep the existing graphics or swap them out for pictures of your own.
and have this text in table two: (from same "field1")
The text on this page is intended to help you jumpstart your design by suggesting the sort of content you may want to include, but don't let it limit you.

What can I use to separate this if it comes directly in one blob from the mysql table?

Hope this is the right place to post?

domedia
08-02-2007, 12:11 PM
Best option is to separate it before it goes into your DB. Insert regular <p> tags around each paragraph.

Paws
08-02-2007, 12:19 PM
The best option that I can think of is to have the admin section setup with as many textarea boxes as needed then the data would be seperate as they would be in seperate records already.

Thanks for you reply.

Cheers

domedia
08-02-2007, 01:31 PM
Separate database entries for each paragraph in an article for example? I seriously doubt that's the best option. Have you looked at how all other CMS'/admin areas are handling this?

Paws
08-02-2007, 01:37 PM
No, I develop my own 'control panels' / 'admin areas' for each individual website.
This is a demo of a page that can give you a better idea:

mysql_select_db($database_cnaida, $cnaida);
$query_rsabout = "SELECT * FROM tblabout";
$rsabout = mysql_query($query_rsabout, $cnaida) or die(mysql_error());
$row_rsabout = mysql_fetch_assoc($rsabout);
$totalRows_rsabout = mysql_num_rows($rsabout);

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>TEST BREAK UP</title>
</head>
<body>
<p>TABLE1</p>
<table width="300" border="0" cellspacing="0" cellpadding="2">
<tr>
<td><?php echo nl2br($row_rsabout['AboutUs']); ?></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
<p>TABLE2</p>
<table width="300" border="0" cellspacing="0" cellpadding="2">
<tr>
<td><?php echo nl2br($row_rsabout['AboutUs']); ?></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
<p>TABLE3</p>
<table width="300" border="0" cellspacing="0" cellpadding="2">
<tr>
<td><?php echo nl2br($row_rsabout['AboutUs']); ?></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
<p>THE END</p>
</body>
</html>


Cheers

Paws
08-02-2007, 01:39 PM
I know of the
n2lbr($rowofdata)
but too bad there isn't an option for
nl2table($rowofdata)