Unwanted line break generated
-
- Posts: 23
- Joined: Thu 28. Oct 2004, 13:04
- Location: London
Unwanted line break generated
Firstly, thanks Oliver for a great CMS. Ive tried so many CMS solutions and this by far is the easiest and most concise for my purposes. Ive been searching the forum for a month or so now and have found all the answers to my questions - great community!
Anyway - heres my problem:
Ive been adding html content parts to my articles like this:
When I then view this page in my browser the CMS has placed an unwanted and <br /> tag:
Any ideas how I can get rid of this line break?
Thanks
Anyway - heres my problem:
Ive been adding html content parts to my articles like this:
When I then view this page in my browser the CMS has placed an unwanted and <br /> tag:
Any ideas how I can get rid of this line break?
Thanks
I have the same problem. The only way to solve this is to modify directly the files which are repsonsible for rendering the different block elements. Take a look into the folder include/inc_frontend/content. For example cnt14.article.inc.php is responsible for rendering a HTML block element:
Code: Select all
//HTML
$content["main"] .= headline($crow["acontent_title"], $crow["acontent_subtitle"], $template_default["article"]);
$content["main"] .= ($crow["acontent_html"]) ? "<br />".$crow["acontent_html"] : "";
Durring some tests last days I recognized some additional unmeanted <br /> tags in my html source. After some tests I found out that the problem was the following line:
after i replaced the line above by the following one the <br /> tags are gone with the wind.
Unfortunatelly I have no experience with PHP, so i was not able to analyze the nl2br function in more detail. But maybe we have another member of this forum, who is able to bring more details forward?
Code: Select all
$content["main"] .= nl2br(div_class($crow["acontent_text"],$template_default["article"]["text_class"]));
Code: Select all
$content["main"] .= nl2br($crow["acontent_text"]);
That is actually for WYSIWYG HTML.kubens wrote:I have the same problem. The only way to solve this is to modify directly the files which are repsonsible for rendering the different block elements. Take a look into the folder include/inc_frontend/content. For example cnt14.article.inc.php is responsible for rendering a HTML block element:
Code: Select all
//HTML $content["main"] .= headline($crow["acontent_title"], $crow["acontent_subtitle"], $template_default["article"]); $content["main"] .= ($crow["acontent_html"]) ? "<br />".$crow["acontent_html"] : "";
cnt6.article.inc.php is for HTML, BUT it is all brought together in content.article.inc.php:
Code: Select all
$content["main"] .= "<a name="jump".$row["article_id"].""></a>";
Code: Select all
if($content["summary"]) {
$content["main"] .= $content["summary"];
$content["main"] .= $template_default["article"]["head_after"];
Code: Select all
$content["main"] .= ($crow["acontent_before"]) ? "<br />".spacer(1,$crow["acontent_before"]) : "";
switch($crow["acontent_type"]) { //Felder für passenden Content Type
case 1: include("include/inc_front/content/cnt1.article.inc.php"); break; //Text mit Bild
case 2: include("include/inc_front/content/cnt2.article.inc.php"); break; //Nur Bilder
case 3: include("include/inc_front/content/cnt3.article.inc.php"); break; //Link & Email
case 4: include("include/inc_front/content/cnt4.article.inc.php"); break; //Bullet List
case 5: include("include/inc_front/content/cnt5.article.inc.php"); break; //Link Liste
case 6: include("include/inc_front/content/cnt6.article.inc.php"); break; //HTML
case 14: include("include/inc_front/content/cnt14.article.inc.php"); break; //WYSIWYG HTML
case 7: include("include/inc_front/content/cnt7.article.inc.php"); break; //File List
case 8: include("include/inc_front/content/cnt8.article.inc.php"); break; //Link Article
case 15: include("include/inc_front/content/cnt15.article.inc.php"); break; //Article Menu
case 9: include("include/inc_front/content/cnt9.article.inc.php"); break; //Multimedia
case 10: include("include/inc_front/content/cnt10.article.inc.php"); break; //Email Form
case 11: include("include/inc_front/content/cnt11.article.inc.php"); break; //Code
case 12: include("include/inc_front/content/cnt12.article.inc.php"); break; //Newsletter Subscription
case 13: include("include/inc_front/content/cnt13.article.inc.php"); break; //Search Form
case 16: include("include/inc_front/content/cnt16.article.inc.php"); break; //Ecard
case 18: include("include/inc_front/content/cnt18.article.inc.php"); break; //guestbook
case 19: include("include/inc_front/content/cnt19.article.inc.php"); break; //sitemap
case 20: include("include/inc_front/content/cnt20.article.inc.php"); break; //bid
case 21: include("include/inc_front/content/cnt21.article.inc.php"); break; //page / ext. content
case 50: include("include/inc_front/content/cnt50.article.inc.php"); break; //reference
case 100: include("include/inc_front/content/cnt100.article.inc.php");break; //<ul>/<li> Liste
default: include("include/inc_front/content/cnt0.article.inc.php"); break; //Text
}
//Standardfelder Abschluß
if($crow["acontent_top"]) { //check if top link should be shown
if($template_default["article"]["top_sign_before"].$template_default["article"]["top_sign_after"]) {
$content["main"] .= $template_default["article"]["top_sign_before"];
$content["main"] .= '<a href="#top">'.$template_default["article"]["top_sign"].'</a>';
$content["main"] .= $template_default["article"]["top_sign_after"];
} else {
$content["main"] .= '<br /><a href="#top">'.$template_default["article"]["top_sign"].'</a>';
}
}
$content["main"] .= ($crow["acontent_after"]) ? "<br />".spacer(1,$crow["acontent_after"]) : "";
}
mysql_free_result($cresult);
}
}
}
$content["main"] = str_replace("</table>\n<br />", "</table>\n", $content["main"]);
$content["main"] = str_replace("</table><br />", "</table>", $content["main"]);
$content["main"] = str_replace("</div><br />", "</div>", $content["main"]);