froot Posted January 27, 2022 Share Posted January 27, 2022 I have some html in a body field of a page including some <a> tag. For some reason the last bit of the link appears in the head in some meta tag and it breaks the page, the text appears on top of everything else. It must have to do with a faulty parsing of the html, meaning the closing of the <a> tag break the entire html but I have no idea how to fix it. The body is a CKEditor field. So it's like: <p>whatever whatever, <a href="https://www.domain.com/whatever" rel="noreferrer noopener" target="_blank">blablabla</a>.</p> and then I see on top of the page above all other content: blablabla. " /> Any ideas? Link to comment Share on other sites More sharing options...
virtualgadjo Posted January 27, 2022 Share Posted January 27, 2022 hi, honestly, hard to answer without seeing the whole page source code but you can bet that when this kind of thing happens you have somewhere either an unclosed tag (hence the whole page source code) or, and it happens more often than you could imagine, something like two body tags ("like" because it happens with a few other important tags too) just an example of when this kind of thing happens, using markupregions and forgetting an html head in another template than the _main.php => two html head and opening bodies => a little mess ? hope it may help looking for the issue origin have a nice day 2 Link to comment Share on other sites More sharing options...
Gideon So Posted January 27, 2022 Share Posted January 27, 2022 Hi @fruid Try to validate your page with https://validator.w3.org/. Gideon 2 Link to comment Share on other sites More sharing options...
Kiwi Chris Posted January 28, 2022 Share Posted January 28, 2022 I've sometimes had this kind of issue when I intended to assign something to a variable to output later, and instead output it with an echo statement. Also HTML code in a template will immediately render instead of being assigned to a PHP variable if you don't use PHP output buffering. Check the source code of the output. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now