Failure on saving article in Joomla 3 - joomla

Per the title, the original text is
<hr id="system-readmore" />
After I saved, it became:
<hr id=\"system-readmore\" />
OR
<hr id=\"\\"system-readmore\\"\" />
Where does the problem come from?

This is happening because of magic quotes is on your server. You need to turn off the magic quotes in your php.ini.
magic_quotes_gpc = Off
You may refer this link: http://www.ostraining.com/blog/joomla/joomla-3-magic-quotes/ .
You may also do with .htaccess file add the following code to it’s own line:
php_value magic_quotes_gpc off
I hope that may solve your problem.

Related

HTML:Image won’t display

My image won’t display for no reason. I am a noob but I can’t figure it out. The image loads from the url so I know it’s not that. So I’m pretty sure it’s my problem with the coding.
<body>
<img src=https://www.dropbox.com/s/rm27v6s4nj885qu/IMG_0071.PNG?dl=0
Height=300Width=250>
</body>
Your URL is pointing to non-image resource. It's actually pointing to an HTML document.
In URL, change www by dl and remove ?dl=0.
This is valid image URL :
https://dl.dropbox.com/s/rm27v6s4nj885qu/IMG_0071.PNG
Alternatively, you can replace dl=0 to raw=1. This is also valid image URL:
https://www.dropbox.com/s/rm27v6s4nj885qu/IMG_0071.PNG?raw=1
Not always required but as a good practice I'll suggest using quotes for values. Also as mentioned in comments seperate attributes from each other with white space.
<img src="https://dl.dropbox.com/s/rm27v6s4nj885qu/IMG_0071.PNG"
height="300" width="250"/>
<!--OR-->
<img src="https://www.dropbox.com/s/rm27v6s4nj885qu/IMG_0071.PNG?raw=1" height="300" width"250"/>
source : Mickel's Tutorial
I hope, you must use the url of image, But you are referring the url preview pane of dropbox.
It is the actual url for image.
You also need some improvisation with your code, as below
<body>
<img src="https://uc215f04ebb05efbc98d874fefb2.previews.dropboxusercontent.com/p/thumb/AA767gGwgVfZ9rVS7PJbtIOR3eQsWN4mrXjNjVJH3JKjhI5eE7JOd-eQJwydUx1gPkpE3zkAnMSN3-1KEtFN86x-CdWnREg0mQ6hm7APBCuifux1ECDivRuLkrikn1sY_r20EmBWucKHyy-Ps5VPB8ehkUB6x0y9kSb3QzYpP8fOo7IeyR6IaCYZ66mxrJiUiUtzTAV3ddESpRV7lSRaumsSyVPc4k1RbUBS3-_JDnP8Qv6M42x2g7bZDy9vdhhIOZaO585_XQHegapCJ-8bnwLGt-VEy9nud0avi_gzMSpXxx3EXt_NYTWMfFqfstb2HFMVb7WK7jxkSRSX5eE5ck3Q0bdEPAKp1aPnClU2KqI-OgUea6ApGp4G0H4Q3l3UyOjfomtn-SndAAaUzPbaU1HK/p.png?fv_content=true&size_mode=5" height="300" width="250" />
</body>
It will work without any issue. You are not referring proper url that the actual issue.
Also, keep tag properties in quote "" if required.
Like
<img src="url" height="200" width="300" />
Thanks.

Typo3 close and start a new paragraph <p> in each <br /> in bodytext at news extension

I'm using Typo3 9.5.14 and CkEditor to add and edit news articles, i see in frontend that it is closing and starting a new paragraph at every in the bodytext area here an example :
<p>
Text somthing <br />
Text somthing 2 <br />
Text somthing 3 <br />
Text somthing 4 <br />
</p>
After save, i see in frontend is converted to this;
<p>Text somthing </p>
<p>Text somthing 2 </p>
<p>Text somthing 3 </p>
<p>Text somthing 4 </p>
But in source it is still in the original code even after save.
Is it really because CKEditor and how can i prevent this ?
This is causing the problem of adding new spaces between each line of text.
Possibly switch to direct source editing?
The other reason could be you need to allow tags in the editor configuration. Like this :
TYPO3 9.5.4 CKEditor RTE deletes style attributes
Hope it helps you
EDIT:
Does this setting still work in TYPO3 9? maybe that is it:
https://docs.typo3.org/m/typo3/reference-coreapi/7.6/en-us/Rte/Transformations/Tsconfig/Index.html#dontconvbrtoparagraph
I come back with the solution i find, i have uninstalled the obsolete extension rtehtmlarea, and this solved the problem.

How to use <br> instead of <br /> in CKeditor

It's 2017 and it's the age of HTML5! In HTML5, the line break is <br>, NOT <br />. But for the life of it, I can't get CKeditor to ditch <br /> in favor of <br>.
The incorrect <br />'s are giving me all sorts of problems. Among them:
Failed code validation
(In Firefox) Using JavaScript's innerHTML on a code block that was created with <br />'s, returns <br>'s instead - which messes up comparisons about changes.
I found this old forum entry about the issue (in a related program, not in CKeditor itself):
http://ckeditor.com/forums/Support/are-not-validated-W3C-validator-How-change
But the suggested fix (changing config.docType in the config file) does NOT WORK!
I tried a bunch of different docTypes's, in both the top-level config.js and in core/config.js .
In top-level config.js , I tried:
config.docType = '<!DOCTYPE html>';
In core/config.js, I tried:
docType: '<!DOCTYPE html>',
But nothing works! :(
I also tried to hunt down instances of <br /> in the multitudes of files, but didn't find any in the core part of CKeditor. I presume that the <br /> string gets created dynamically??
How can I get CKeditor to spit out <br> rather than <br /> ?
Thanks!
Yay, it took some hardcore Googling (hard to phrase the search), but I found the answer! I hope this will help others.
Simply add:
CKEDITOR.on( 'instanceReady', function( ev ) {
// Output self-closing tags the HTML5 way, like <br>
ev.editor.dataProcessor.writer.selfClosingEnd = '>';
});
What it does, from what I understand, is to wait for the core plugin "HTML Output Writer" to be loaded - and when it is, it modifies the "writer", which is a property of each editor instance. The above way applies the change to all editors, but it could also be done to individual editor instances (though I find it hard to imagine why anyone would want to do the latter.)
For more info, from the CKEditor4 documentation:
How Do I Output HTML Instead of XHTML Code Using CKEditor?
All right, CKEditor rocks! :D

ckeditor removes <br/> when br is in allowed content

When I add br to ckeditor allowed content and adding <br> tag it is being changed into <br />
But when I add <br/> it is being removed.
Why is it being removed when br is in allowed content? Any suggestions?
There are some bits missing from your post, not sure why, or what you were trying to say.
If what you were saying is that you wanted to add, say, clear="all" to your <br /> tags, you can use this to update your allowed content:
config.AllowedContent = "br[clear]";
Separate individual elements with ;.
Here is the reference to the AllowedContent rules in the documentation:
http://docs.ckeditor.com/#!/guide/dev_allowed_content_rules
I keep this bit in comments above my AllowedContent declaration as a reminder:
elements [attributes]{styles}(classes)
If that's not what you were asking, forgive me, again, there are some parts missing from your post. If you can update it and let me know I'll revisit this answer.
== EDIT ==
Ok, I just looked at the edit of the post, and it seems you had "naked" <br /> tags in your question, which turned into actual line breaks.
What you're seeing is that the editor is forcing valid HTML. BR tags should always be formatted as such: <br /> (notice the space)

How to mix href within jstl code

When I use the below jstl code
<a href="http://mysite.com?id="<c:out value="${myid}"/>/><c:out value="${myid}"/></a>
the output is :
"1234"
The value 1234 corresponds to the variable value of myid but the url being generated is
"http://mysite.com?id=" so no value for myid is being generated as part of the href.
How can I amend the href so that entire href is displayed :
"http://mysite.com?id=1234"
instead of :
"http://mysite.com?id="
Ultimately, JSP/JSTL generates HTML. You're familiar with basic HTML, right?
Look closer at the generated HTML output by rightclick, View Source in browser. You'll see:
<a href="http://mysite.com?id="1234/>1234</a>
Is that valid HTML? No, you're closing the attribute value too soon with " at wrong place and you're closing the tag too soon with />. Look, the Stack Overflow HTML syntax highlighter also got confused. Instead, it should have been:
1234
Fix the HTML generator (i.e. the JSP/JSTL code) accordingly so that it generates the desired HTML:
<c:out value="${myid}"/>
Unrelated to the concrete problem, the <c:out> is only helpful in preventing XSS attack holes when redisplaying user-controlled input and actually the wrong tool to inline URL parameters. If you can guarantee that ${myid} is always a number (because it's a Long or Integer), you can even just leave it entirely out, making the code prettier to read:
${myid}
If the ${myid} is however not a guaranteed to be a number (because it's a String), then you should use <c:url> and <c:param> to properly URL-encode it:
<c:url value="http://mysite.com" var="myURL">
<c:param name="id" value="${myid}" />
</c:url>
<c:out value="${myid}" />
<c:url> tag is used to create an url. It is helpful in the case when cookies is turned off by the client, and you would be required to rewrite URLs that will be returned from a jsp page.
<c:param> tag may used as a subtag of to add the parameters in the returned URL. Using these parameters encodes the URL.
<c:url value="http://mysite.com" var="myURL">
<c:param name="id" value="${myid}" />
</c:url>
<a href="${myURL}" />${myURL}</a>
Read more from here.

Resources