5

We are facing a weird issue in experience editor, where we are getting following error - enter image description here

XHTML markup is incorrect near placeholder "header". For more information about this issue refer to Sitecore Knowledge base article https://kb.sitecore.net/articles/365101.

I know this error message shows when there some XHTML validation problem. But In our case its not related to XHTML validation.

The weird thing here is that if I change my placeholder key "header" (i.e. - "Header" or "header1") and update the presentation details, it resolve the problem. Don't konw what is problem with "header" placeholder key. here the code we are using on layout -

@Html.Sitecore().Placeholder("header")

We are using Sitecore version - 8.2 update 2

  • When you say "it resolves the problem" do you mean that the error disappears and the page looks exactly as expected, does the error disappear along with some of your renderings, or something else? When the error displays, are any renderings missing or are there additional renderings present that shouldn't be on the page? Do any of the renderings display an error/stack or look like they rendered incorrectly? If you look at your Presentation Details, do you have any renderings that have been added to the "header" placeholder? How about to "Header" or "header1"? – Zachary Kniebel Mar 3 '17 at 18:27
  • Hi @ZacharyKniebel - I mean to say if I change the placeholder key in the layout and update the header placeholder key in the presentation detail for the control which is using this placeholder key, then page looks as expected without error in experience editor. only problem is with "header" keyword for the placeholder key. for short term I have changed the placeholder key to "Header" to resolve this error. FYI - This error is only in experience editor, normal mode is working fine with any placeholder key. – Mahendra Shekhawat Mar 4 '17 at 13:44
  • I had a go at reproducing the error behaviour you describe - but I've not been able to come up with a way of making the UI do this myself. Are you able to post enough markup/other code to allow others to reproduce the problem? That might help us get to an answer for you... – JermDavis Mar 13 '17 at 17:17
  • Could you provide the full source for the layout. And is there a specific rendering you are trying to place into the header. If so, might be also helpful to have the full html source for that as well. – Dylan Young Jun 10 '17 at 14:25
3

This problem was related to some jquery function, in the header html, a section has id=”header” and some jquery functions are based on this id in a custom jquery file “jquery.layout.js”.Our placeholder key and the id jquery using was same so updated the id for the section in both html and js to resolve the problem. I have write a blog for this problem and provided some suggestion for creating placeholder key based on the discussion with Sitecore Support - https://sitecorexpblog.wordpress.com/2017/06/12/resolve-xhtml-markup-is-incorrect-near-placeholder-header-error-only-for-header-key/ Thanks Everyone for your support.

0

If your placeholder and rendering has the same name sitecore will generate two html tags with the same id, that will clash and give you invalid markup.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.