Rich Text Box: Option to select multiple styles from drop down
I need to provide option to Editors to select multiple styles during content formatting in RTF. Is there any out of the box option available for selecting multiple classes for any element?
In case there is no out of the box way, anyone implemented any work around and share his experience?
cme web8.5 gui-extensions
add a comment |
I need to provide option to Editors to select multiple styles during content formatting in RTF. Is there any out of the box option available for selecting multiple classes for any element?
In case there is no out of the box way, anyone implemented any work around and share his experience?
cme web8.5 gui-extensions
add a comment |
I need to provide option to Editors to select multiple styles during content formatting in RTF. Is there any out of the box option available for selecting multiple classes for any element?
In case there is no out of the box way, anyone implemented any work around and share his experience?
cme web8.5 gui-extensions
I need to provide option to Editors to select multiple styles during content formatting in RTF. Is there any out of the box option available for selecting multiple classes for any element?
In case there is no out of the box way, anyone implemented any work around and share his experience?
cme web8.5 gui-extensions
cme web8.5 gui-extensions
edited Dec 18 at 9:02
Atila Sos
2,7232720
2,7232720
asked Dec 17 at 14:27
Mukesh Kumar
2,509615
2,509615
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
As per Jonathan, and here this is not possible.
Concatenating class names in the current control will work (I've done this as a one-off for a client) but be very clear on the limitations of scaling.
I would also be wary of templating (or per the link above XSLT'ing) changes to change the actual content as this will become confusing for the end user very quickly as when they re-edit the content the selected styles will not match those in the drop-down and you'll soon be asking them to dip into the source tab.
I would suggest that an extension of the existing functionality is really required (maybe even as an Idea) - the drop-down control simply doesn't cut it and needs to be replaced with a multi-select option.
add a comment |
I don't think that there is a way to specify more than one CSS class on a single HTML element in the rich text.
Given that these come from FormatAreaStyles.css, you could, for example add an option like class1---class2
(giving you HTML something like <p class="class1---class2">Content here</p>
in your rich text source) and then transform this in your templating code (to <p class="class1 class2">Content here</p>
). This could be done using 'Find and replace' or a regex.
Obviously this doesn't scale well if you're looking at adding (combinations of) lots of classes, but would work for two or three classes on a limited number of elements.
Alternatively, you could look at using something like a Custom URL (on the field name in the Component), but this could become very fiddly.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "485"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftridion.stackexchange.com%2fquestions%2f19606%2frich-text-box-option-to-select-multiple-styles-from-drop-down%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
As per Jonathan, and here this is not possible.
Concatenating class names in the current control will work (I've done this as a one-off for a client) but be very clear on the limitations of scaling.
I would also be wary of templating (or per the link above XSLT'ing) changes to change the actual content as this will become confusing for the end user very quickly as when they re-edit the content the selected styles will not match those in the drop-down and you'll soon be asking them to dip into the source tab.
I would suggest that an extension of the existing functionality is really required (maybe even as an Idea) - the drop-down control simply doesn't cut it and needs to be replaced with a multi-select option.
add a comment |
As per Jonathan, and here this is not possible.
Concatenating class names in the current control will work (I've done this as a one-off for a client) but be very clear on the limitations of scaling.
I would also be wary of templating (or per the link above XSLT'ing) changes to change the actual content as this will become confusing for the end user very quickly as when they re-edit the content the selected styles will not match those in the drop-down and you'll soon be asking them to dip into the source tab.
I would suggest that an extension of the existing functionality is really required (maybe even as an Idea) - the drop-down control simply doesn't cut it and needs to be replaced with a multi-select option.
add a comment |
As per Jonathan, and here this is not possible.
Concatenating class names in the current control will work (I've done this as a one-off for a client) but be very clear on the limitations of scaling.
I would also be wary of templating (or per the link above XSLT'ing) changes to change the actual content as this will become confusing for the end user very quickly as when they re-edit the content the selected styles will not match those in the drop-down and you'll soon be asking them to dip into the source tab.
I would suggest that an extension of the existing functionality is really required (maybe even as an Idea) - the drop-down control simply doesn't cut it and needs to be replaced with a multi-select option.
As per Jonathan, and here this is not possible.
Concatenating class names in the current control will work (I've done this as a one-off for a client) but be very clear on the limitations of scaling.
I would also be wary of templating (or per the link above XSLT'ing) changes to change the actual content as this will become confusing for the end user very quickly as when they re-edit the content the selected styles will not match those in the drop-down and you'll soon be asking them to dip into the source tab.
I would suggest that an extension of the existing functionality is really required (maybe even as an Idea) - the drop-down control simply doesn't cut it and needs to be replaced with a multi-select option.
answered Dec 17 at 15:45
Dylan .. Mark Saunders
7,2481132
7,2481132
add a comment |
add a comment |
I don't think that there is a way to specify more than one CSS class on a single HTML element in the rich text.
Given that these come from FormatAreaStyles.css, you could, for example add an option like class1---class2
(giving you HTML something like <p class="class1---class2">Content here</p>
in your rich text source) and then transform this in your templating code (to <p class="class1 class2">Content here</p>
). This could be done using 'Find and replace' or a regex.
Obviously this doesn't scale well if you're looking at adding (combinations of) lots of classes, but would work for two or three classes on a limited number of elements.
Alternatively, you could look at using something like a Custom URL (on the field name in the Component), but this could become very fiddly.
add a comment |
I don't think that there is a way to specify more than one CSS class on a single HTML element in the rich text.
Given that these come from FormatAreaStyles.css, you could, for example add an option like class1---class2
(giving you HTML something like <p class="class1---class2">Content here</p>
in your rich text source) and then transform this in your templating code (to <p class="class1 class2">Content here</p>
). This could be done using 'Find and replace' or a regex.
Obviously this doesn't scale well if you're looking at adding (combinations of) lots of classes, but would work for two or three classes on a limited number of elements.
Alternatively, you could look at using something like a Custom URL (on the field name in the Component), but this could become very fiddly.
add a comment |
I don't think that there is a way to specify more than one CSS class on a single HTML element in the rich text.
Given that these come from FormatAreaStyles.css, you could, for example add an option like class1---class2
(giving you HTML something like <p class="class1---class2">Content here</p>
in your rich text source) and then transform this in your templating code (to <p class="class1 class2">Content here</p>
). This could be done using 'Find and replace' or a regex.
Obviously this doesn't scale well if you're looking at adding (combinations of) lots of classes, but would work for two or three classes on a limited number of elements.
Alternatively, you could look at using something like a Custom URL (on the field name in the Component), but this could become very fiddly.
I don't think that there is a way to specify more than one CSS class on a single HTML element in the rich text.
Given that these come from FormatAreaStyles.css, you could, for example add an option like class1---class2
(giving you HTML something like <p class="class1---class2">Content here</p>
in your rich text source) and then transform this in your templating code (to <p class="class1 class2">Content here</p>
). This could be done using 'Find and replace' or a regex.
Obviously this doesn't scale well if you're looking at adding (combinations of) lots of classes, but would work for two or three classes on a limited number of elements.
Alternatively, you could look at using something like a Custom URL (on the field name in the Component), but this could become very fiddly.
answered Dec 17 at 14:49
Jonathan Williams
12.6k1651
12.6k1651
add a comment |
add a comment |
Thanks for contributing an answer to Tridion Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftridion.stackexchange.com%2fquestions%2f19606%2frich-text-box-option-to-select-multiple-styles-from-drop-down%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown