-
AuthorPosts
-
Sherlock Friend
Sherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
July 28, 2008 at 3:15 am #131418Hi all !
There are many users get error when enter content to their site. There are 2 error usually appear :
1. Missing html tag –> causes cashing layout .
2. Error bold text in content.
About missing html tag :
This is problem ussually appears when you copy content form other site and paste to your site, so please take care when copy and check again in html source.
About error in bold text :
I have looked into questbg’s site and anaivelisse’s site and detect the problem :
After have a deep inspect, I have found that the problem came from other article and affect to other articles as we’ve seen. When you make an bold text for a title in a article, I guess you select those text and the page break too, that caused HTML error. For details, the HTML was: <strong><hr… Now I have correct the error to put <strong> tag after <hr> instead of before and problem fixed.
I hope you will mind the selection of text in the future.
Thank you2 users say Thank You to Sherlock for this useful post
bossep Friendbossep
- Join date:
- April 2008
- Posts:
- 262
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 50
- Thanked:
- 15 times in 3 posts
July 28, 2008 at 3:18 pm #262731Hello hainn and others,
I agree with you that pasting content, especially from MS World for instance is a bad idea.
I strongly recommend to paste in the content as pure text and I do that.
However we all have at least the default WSIWYG editor in Joomla and perhaps some other like JCE and it is hard to tell your clients that they can’t use ANY headlines or list items for instance in the beginning of the page (before or close to the <hr.. = Read More).This is due to the simple fact that our text is just plainly truncated at the max character point leaving orphan tags if we ware stupid enough to put them in, leaving us with broken code on our front page.
This could easely be avoided by using the strip_tags() PHP function that you had implemented in the first version of Teline II.
It is farly easy to avoid formatting when you are the only editor of the article but in my case I need to have reporters editors to send me text etc by email and then carefully paste it in to the site. This is NOT accaptable in a production site in my opinion.
I do accept that we can’t take care of something like the <hr.. tag inside another tag programmatically (perhaps strip_tag() will take care of it as well) but other exotic tags like <p.., H1.., <LI.. should be taken care of. By the way, you could also supply the strip_tags function with a list of allowed tags.
The function is in a few helper files but it does not work. Here is an example from the: Modules=>mod_janews_fp=>helper.php line 24-53:function replaceImage( &$row, $align, $autoresize, $maxchars, $showimage, $width = 0, $height = 0 ) {
global $database, $_MAMBOTS, $current_charset;
$regex = "/<img.+srcs*=s*"([^"]*)"[^>]*>/";
preg_match ($regex, $row->introtext, $matches);
if(!count($matches)) preg_match ($regex, $row->fulltext, $matches);
$images = (count($matches)) ? $matches : array();
$image = '';
if (count($images)) $image = $images[1];
$align = $align?"align="$align"":"";
if ($image && $showimage) {
if ($autoresize && function_exists('imagecreatetruecolor')
&& ($image1 = modJANewsHelper::processImage ( $image, $width, $height ))) {
$image = "<img src="".$image1."" alt="{$row->title}" $align />";
} else {
$width = $width?"width="$width"":"";
$height = $height?"height="$height"":"";
$image = "<img src="".$image."" alt="{$row->title}" $width $height $align />";
}
} else $image = '';$regex1 = "/<img.*/>/";
$row->introtext = preg_replace( $regex1, '', $row->introtext );
$row->introtext = trim($row->introtext);$row->introtext1 = strip_tags($row->introtext);
if ($maxchars && strlen ($row->introtext) > $maxchars) {
$row->introtext1 = substr ($row->introtext1, 0, $maxchars) . "...";
}
// clean up globals
return $image;
I do think that by re-implementing this function we would take care of a lot of problems our user are facing on the front page.
Bosse
bossep Friendbossep
- Join date:
- April 2008
- Posts:
- 262
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 50
- Thanked:
- 15 times in 3 posts
July 28, 2008 at 3:26 pm #262733Did this help with the é, ä, å, ö problem? Reported in http://www.joomlart.com/forums/topic/bug-fix-tread-ja-teline-2/ tread?
and http://www.joomlart.com/forums/topic/bug-swedish-characters-not-displayed-correctly-in-ja_news/August 10, 2008 at 10:15 am #264769Maybe I am just a nut, but I find the best way to get content into an article is by simple HTML. I despise any WYSIWYG Editor that comes with Joomla as it ruins the design (content layout) that I have devised. Furthermore, I have disabled the WYSIWYG from the Configuration file and will not allow my reporters to use such program.
It seems by doing this, it has prevented me from jumping off of a bridge and coming into some of these problems that I see others having. Though, when someone does C/P from Microsoft Word, the system will pick up the font used in that program and translate it no matter what, at least that’s what I found happenening when I still used Joomla 1.0.x. I haven’t used 1.0.x since October, and the reporter doing this has since moved on. I was always against the usage of the program, but some just didn’t understand why.
bossep Friendbossep
- Join date:
- April 2008
- Posts:
- 262
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 50
- Thanked:
- 15 times in 3 posts
August 10, 2008 at 6:09 pm #264792I do agree with you Aedin,
The WYSIWYG is a BIG problem in Joomla and with the current setup of JA-News you can basically not use any of it.
So here plain text is ware to go at least for all text above the read more.
About reporters. I don’t think you could or should expect reporters to be web designers or even expect them to know anything about HTML. So some limited possibilities for formatting should be there like putting in a photo and creating a head line making text bold, etc. I do think that the editor in this forum could be a good one. This text is pasted directly from MS world.
For JA_News: I am working on a solution ware we remove all unwanted tags from the text but allowing some. This should be set up in the back end and be something like allowed tags. Then it is up to the admin to save formatting happy reporters from them selfs.
BosseAugust 10, 2008 at 6:40 pm #264793Hey bossep,
The HTML my reporters use are not advanced codes. I would never expect them to do that, lol. They use the basics. The more advanced stuff is the usage of a photo, which I’ve given them a template for and all they do is copy/paste the format into their next article and adjust for the new content. It has successfully worked out in the 3 years I’ve been using Joomla/Mambo. Though I should mention, the knowledge of HTML was a requirement before I hired anyone.
I like JA News, but I’ve found myself only using it on a limited basis. In fact, I broke it after hacking it and I’m quite pleased with what I got, even though it is broken, lol.
aardcom Friendaardcom
- Join date:
- February 2008
- Posts:
- 183
- Downloads:
- 66
- Uploads:
- 3
- Thanks:
- 46
- Thanked:
- 30 times in 4 posts
June 1, 2009 at 11:47 pm #306467You may be able to solve some of the issues for “reporters” by setting the default editor for the site to “none” and then using the override (under user management) for the administrator’s default editor to WYSIWYG or whatever else is preferred. The admin can then turn this on and off as needed for the task at hand.
July 30, 2009 at 8:57 am #312660<em>@bossep 72807 wrote:</em><blockquote>I do agree with you Aedin,
The WYSIWYG is a BIG problem in Joomla and with the current setup of JA-News you can basically not use any of it.
So here plain text is ware to go at least for all text above the read more.
About reporters. I don’t think you could or should expect reporters to be web designers or even expect them to know anything about HTML. So some limited possibilities for formatting should be there like putting in a photo and creating a head line making text bold, etc. I do think that the editor in this forum could be a good one. This text is pasted directly from MS world.
For JA_News: I am working on a solution ware we remove all unwanted tags from the text but allowing some. This should be set up in the back end and be something like allowed tags. Then it is up to the admin to save formatting happy reporters from them selfs.
Bosse</blockquote>
Its seems that Bosse somehow resolved the issue. Its a pity that he doesn’t share his solution with us….:( -
AuthorPosts
This topic contains 8 replies, has 5 voices, and was last updated by gazoline 15 years, 3 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum