I am using a chrono form to construct a dynamic article. The form returns content + div structure and this is deposited in my database -works fine.
I need introduce some line breaks so that the output breaks logically over lines and divs and looks like below. I have tried to introduce characters to get this but am struggling. Any advice much appreciated.
$introtext = '<div id="articlecontainer"><div id="artheader">'."$intro".'</div><div id="leftcol"><div class="artimages">'."$holder1".'</div><div class="artimages">'."$holder2".'</div><div class="artimages">'."$holder3".'</div></div><div id="rightcol"><div id="rightcolcontent">'."$introtext" .'</div></div></div>';
//$introtext=nl2br($introtext);
I need introduce some line breaks so that the output breaks logically over lines and divs and looks like below. I have tried to introduce characters to get this but am struggling. Any advice much appreciated.
<div id="articlecontainer">
<div id="artheader">'."$intro".'</div>
<div id="leftcol">
<div class="artimages">'."$holder1".'</div>
<div class="artimages">'."$holder2".'</div>
<div class="artimages">'."$holder3".'</div></div><div id="rightcol"><div id="rightcolcontent">'."$introtext" .'</div>
</div>
</div>
For some reason my article template will not render the saved article unless it has line breaks. At the moment it's one continous string I need to insert breaks that break the code onto new lines.
Hi Bob,
This string is being saved in the article field as one long undifferentiated string with no line breaks-
I need it to saved as is above but with some line breaks so it appear as thus - the line breaks need to be saved in the mysql database otherwise for some unknown reason I have problems with the template rendering the article. If the above string appears as below all is fine -but how do I get chronos to write it to the database in this form
<div id="articlecontainer">
<div id="artheader">'."$intro".'</div>
<div id="leftcol">
<div class="artimages">'."$holder1".'</div>
etc etc et
This string is being saved in the article field as one long undifferentiated string with no line breaks-
<div id="articlecontainer"><div id="artheader">'."$intro".'</div><div id="leftcol"><div class="artimages">'."$holder1".'</div><div class="artimages">'."$holder2".'</div><div class="artimages">'."$holder3".'</div></div><div id="rightcol"><div id="rightcolcontent">'."$introtext" .'</div></div></div>
I need it to saved as is above but with some line breaks so it appear as thus - the line breaks need to be saved in the mysql database otherwise for some unknown reason I have problems with the template rendering the article. If the above string appears as below all is fine -but how do I get chronos to write it to the database in this form
<div id="articlecontainer">
<div id="artheader">'."$intro".'</div>
<div id="leftcol">
<div class="artimages">'."$holder1".'</div>
etc etc et
Hi ugly,
OK - I see what you are saying now - but that 'long string' is perfectly valid html. I'm not sure why adding line-breaks would make any difference to the way it looks in the Joomla article :-(
I'll have to experiment later.
Bob
OK - I see what you are saying now - but that 'long string' is perfectly valid html. I'm not sure why adding line-breaks would make any difference to the way it looks in the Joomla article :-(
I'll have to experiment later.
Bob
This topic is locked and no more replies can be posted.