Skip to content

Conversation

@lucasconstantino
Copy link
Contributor

Most times we can handle a wrapper div around the panel content just fine, but there are some specific cases where that's not true. I've come across a case where wrapper would make some Bootstrap style selector not match my markup, so I decided to create a option on panels called "html", that would be expected to be true by default, but if set to false would cause for no wrapper being generated around the panel's content.

Although I'm already using this in a project of mine, I think there is much room for improvement here.

@recidive
Copy link
Owner

How this differ from the "bare" property when set to false on panels?

@lucasconstantino
Copy link
Contributor Author

The "bare" will make use of the panel-content.html template. This will make use of the panel-content-no-html.hml.

// panel-content.html
<div ng-if="panel.content" ng-bind-html="panel.content" ng-class="panel.classes"></div>
// panel-content-no-html.html
{{panel.content}}

This was really a specific use case I had, because the "div" that surrounds the panel content was making Bootstrap css selectors fail.

@recidive
Copy link
Owner

Got it, well, "html" (true or false) sounds to me more like if it's to be rendered as html or scaped as plain text.

I believe we still can do something with the bare property which does something very similar to what you're trying to accomplish.

For the Bootstrap selectors, welcome to the game. That was the purpose of the ckReplace directive in the first place. There are a lot of places we need to get rid of wrapping divs to make bootstrap selectors work. I still believe something in AngularJS core is missing for replacing tags with content instead of appending content to them.

@sebas5384
Copy link
Contributor

Yeah! for me html=true is a pre rendered html maybe we can find something
other thing in the middle with the bare property?

Abs,
Sebas.

2014-07-10 18:22 GMT-03:00 Henrique Recidive notifications@github.com:

Got it, well, "html" (true or false) sounds to me more like if it's to be
rendered as html or scaped as plain text.

I believe we still can do something with the bare property which does
something very similar to what you're trying to accomplish.

For the Bootstrap selectors, welcome to the game. That was the purpose of
the ckReplace directive in the first place. There are a lot of places we
need to get rid of wrapping divs to make bootstrap selectors work. I still
believe something in AngularJS core is missing for replacing tags with
content instead of appending content to them.


Reply to this email directly or view it on GitHub
#129 (comment).

@recidive
Copy link
Owner

We can try making the "bare" property use your panel-content-no-html.html. The only purpose of the wrapping div when bare is set to true is to render the classes, but this can be done on a wrapper down on the html content.

Maybe you should rename the template panel-content-bare.html? I believe there are a lot of places in core where we use bare, specially on the admin button groups, we just need to make sure this won't break.

@recidive
Copy link
Owner

recidive commented Sep 2, 2014

It looks like you can still set panel.template, this will be used instead of panel-content.html. Is this not sufficient for your case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants