Odd behavior for commented out placeholders

  • 1
  • Problem
  • Updated 3 years ago
  • Not a Problem
I am not certain I would call this a bug, more a curiosity regarding the behavior of the placeholders and the HTML view for the editor.

I have been tinkering with making it easier for other people to curate some of the interactive displays that I have been building, and one of the issues that I have been struggling with is the fact that adding completely new interactive elements to the display simply can not be done through just the design view in the editor. Regardless of how much I am able to automate through the JS there are some parts of at least the html that have to be done manually.

Anyway, I was building commented out templates for these kinds of interactive parts of the presentation. Guides that can be easily copied and used (requiring only a few manual tweaks to IDs). In the process of creating these templates I thought to include commented out placeholder divs. The idea was to make relevant placeholders "appear" in the design view whenever one of the templates was used to add new content.

To my surprise, even when commented out (the placeholder divs were added directly to the HTML editor and directly into commented sections so they were never 'active') these placeholders still appear in the design view of the editor as though they were active.


Is this expected, or intended behavior for the editor and the placeholders? And more importantly do you know of a way to avoid this. Ideally I would still like to make use of this template approach, it is a relatively simple way to deal with turning over complex displays to people with limited knowledge of html/css/js but I do not want to create excessive clutter in the design view as that could cause confusion as well.
Photo of Joseph Mayberry

Joseph Mayberry

  • 1,206 Points 1k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Blake Freeman

Blake Freeman, Official Rep

  • 36,116 Points 20k badge 2x thumb
Joseph,

This is interesting! I'll take a look at this and ask around if it's intended. I'll check back with you when I have some answers.
Photo of Donna Peplinskie

Donna Peplinskie

  • 7,142 Points 5k badge 2x thumb
Joseph,

If you remove theĀ placeholder="true"attribute from the placeholder, this will remove clutter from the Design view and kick out empty Placeholders.

Thx.
Photo of Joseph Mayberry

Joseph Mayberry

  • 1,206 Points 1k badge 2x thumb
I was also able to do the same thing by adding an extra space in my <div> tags (to make them <d iv> tags - I am trying to allow the placeholders to be added back in with minimal edits required in the html). I think my surprise, and the resulting question, was from the fact that commenting out the entire div did not accomplish the same thing as removing the placeholder tag.

I am not certain I fully understand why it doesn't, but there are workarounds that will work.

Thanks for the quick responses.