Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parent Tag #19

Open
controlnocontrol opened this issue Aug 3, 2018 · 4 comments
Open

Parent Tag #19

controlnocontrol opened this issue Aug 3, 2018 · 4 comments

Comments

@controlnocontrol
Copy link

Is it possible to specify a parent tag?

E.g. something like:

"example": {
	"args": {
		"parentClass": "parent"
		"tag": "div",
		"class": "child"
	}
}

will produce

<div class="parent">
	<div class="child">text</div>
	<div class="child">text</div>
	<div class="child">text</div>
</div>
@controlnocontrol
Copy link
Author

controlnocontrol commented Aug 3, 2018

This syntax might be cleaner and allow choice of tags and classes as well as multiple nesting:

"example": {
	"args": {
		"tag": "div",
		"class": "parent",
		"args": {
			"tag": "p",
			"class": "child"
		}
	}
}

@jasonmckinney66
Copy link

This would also be helpful for customizing unordered lists:

"check bullet": {
	"args": {
		"tag": "ul",
		"class": "checked",
		"args": {
			"tag": "li"
		}
	}
}

@carlcs
Copy link
Owner

carlcs commented Sep 27, 2018

@ohbiko thanks for the interesting suggestion. Do you know if Redactor allows nested block level elements at all, and how the Formatting feature (h1, p, etc.) behaves when a nested element, for example div in div, is selected? I have a feeling that the API doesn’t really support it.

@carlcs
Copy link
Owner

carlcs commented Sep 27, 2018

@jasonmckinney66 I also came across this issue recently that you can’t configure a button to add classes to a ul tag. According to docs this should work, but it does not.

"specialList": {
  "api": "module.block.format",
  "args": {
    "tag": "ul",
    "class": "align-right"
  }
}

You can also replicate with a formattingAdd configuration, which uses the same API.

https://imperavi.com/redactor/docs/settings/formatting/#s-formattingadd
https://imperavi.com/redactor/docs/api-modules/

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

No branches or pull requests

3 participants