Why would you want to create a <div> element inside the rich text editor? Could you ellaborate a bit on what you need to do and why you have chosen to use the rich text editor? Perhaps the issue can be handled in another way that is perhaps an even better solution.
When you define a style that can be chosen from the "style" dropdown then the class will be added to the marked element. That means that the style will either be added directly a paragraph or a span. (Sometimes a span is inserted with the class for some reason)...It's not possible to add elements by using the dropdown styles.
You can add the <div> by clicking the HTML button and adding it manually. If it's not being saved then you need to set tidy to false in the umbracoSettings.config file.
I'd like to do this too ... for example so that the editor (who may not be html fluent) to be able to put a section of text/headings etc within a styled box ... does anyone have a solution?
Hi Craig, from what i can remember you can let the user choose an item from the Media section (via macro paramters) but cant remember which paramter type it is, I suggest you create a quick temporary macro that has a long list of parameters ... one for each type of parameter type that exists .... just to see how each one of them works ....
FYI you can even create your own custom Parameter types by inheriting from the right interface (cant remember which one it is right now)
This problem has evolved. The div I need to add to the various pages needs to allow for more than just text now, so I'm at the point where I'm thinking about making something like a widget repository like this:
Content
- Home
- About Us
Widget Repository
- Contact Us (Call to Action)
- Our History (Action Box)
This means I'll be able to allow the client to edit the content in these boxes, however I still need a way of getting the two widgets in my example into the About Us page embedded in the content? Can I make a macro pull in a node from the widget repository to the TinyMCE?
Hi Craig, I have done something similair in the past where I have needed generic bits of content (as well as widgets) that shouldnt have a URL and are just used on mulitple pages (could be thought of as re-uasable content).
From the perspective of allowing the user to choose items, i normally seperate out the fields (ie not just 1 RTE) so i end up with a picker of some type (MNTP) this ends up giving me more control over what they can actually select and use.
The macro paramter does have a parameter type which allows for content selection, but as i mentioned i dont think you can control what they see in it (it may/should even use the users permissions to set the default node etc).
If you continue down the 1 RTE route it will be interesting to see the results so please update this post with the solution ... once you get it :)
As Asif points out above it would be nice to use a MNTP for this. However if you need to place the content of the widgets into the RTE then you need to use a macro with the content picker as a parameter, which is no problem to achieve since it returns the id of the selected box so you know what content to render.
However you should be aware that the content picker on has the disadvantage that you can't configure it to only show nodes from a certain tree in the content section. It shows all nodes in the top level of the tree. Using an MNTP gives you the option to to confgure the starting point so editors don't need to click through as many nodes and don't have to think that much about where to find them.
Let us know what solution you end up using and if you need some help figuring out how to grab the content etc.
Add div with class to TinyMce styles dropdown
Hi,
I'm setting up my TinyMce styles dropdown. I need a style that would generate the markup the following markup.
I created a style with the alias div.segment
However this doesn't seem to work. Nothing get's added to the content.
Any ideas how to get this to work ?
Hi Dawoe
Why would you want to create a <div> element inside the rich text editor? Could you ellaborate a bit on what you need to do and why you have chosen to use the rich text editor? Perhaps the issue can be handled in another way that is perhaps an even better solution.
When you define a style that can be chosen from the "style" dropdown then the class will be added to the marked element. That means that the style will either be added directly a paragraph or a span. (Sometimes a span is inserted with the class for some reason)...It's not possible to add elements by using the dropdown styles.
You can add the <div> by clicking the HTML button and adding it manually. If it's not being saved then you need to set tidy to false in the umbracoSettings.config file.
Looking forward to hear more from you.
/Jan
I'd like to do this too ... for example so that the editor (who may not be html fluent) to be able to put a section of text/headings etc within a styled box ... does anyone have a solution?
Also looking for a solution to this!
Client needs to be able to add content, in the form of a header, some text and an optional image inside a styled box on various pages.
Any ideas?
I have been in similiar situation before and ended up using a marco which accepts a few paramters and then returns the relevant HTML
Asif,
Just attempting that solution when I seen your post, however I have a feeling the optional image may give me a headache as I get further into it!
Hi Craig, from what i can remember you can let the user choose an item from the Media section (via macro paramters) but cant remember which paramter type it is, I suggest you create a quick temporary macro that has a long list of parameters ... one for each type of parameter type that exists .... just to see how each one of them works ....
FYI you can even create your own custom Parameter types by inheriting from the right interface (cant remember which one it is right now)
It's mediaCurrent that can be used to retrieve folder or files from the media section when used in a macro.
/Jan
Thanks guys!
This problem has evolved. The div I need to add to the various pages needs to allow for more than just text now, so I'm at the point where I'm thinking about making something like a widget repository like this:
Content
- Home
- About Us
Widget Repository
- Contact Us (Call to Action)
- Our History (Action Box)
This means I'll be able to allow the client to edit the content in these boxes, however I still need a way of getting the two widgets in my example into the About Us page embedded in the content? Can I make a macro pull in a node from the widget repository to the TinyMCE?
Hi Craig, I have done something similair in the past where I have needed generic bits of content (as well as widgets) that shouldnt have a URL and are just used on mulitple pages (could be thought of as re-uasable content).
From the perspective of allowing the user to choose items, i normally seperate out the fields (ie not just 1 RTE) so i end up with a picker of some type (MNTP) this ends up giving me more control over what they can actually select and use.
The macro paramter does have a parameter type which allows for content selection, but as i mentioned i dont think you can control what they see in it (it may/should even use the users permissions to set the default node etc).
If you continue down the 1 RTE route it will be interesting to see the results so please update this post with the solution ... once you get it :)
Hi Craig
As Asif points out above it would be nice to use a MNTP for this. However if you need to place the content of the widgets into the RTE then you need to use a macro with the content picker as a parameter, which is no problem to achieve since it returns the id of the selected box so you know what content to render.
However you should be aware that the content picker on has the disadvantage that you can't configure it to only show nodes from a certain tree in the content section. It shows all nodes in the top level of the tree. Using an MNTP gives you the option to to confgure the starting point so editors don't need to click through as many nodes and don't have to think that much about where to find them.
Let us know what solution you end up using and if you need some help figuring out how to grab the content etc.
/Jan
is working on a reply...