I've created a Plugin on CKEditor inside of Drupal 7, which inserts the following HTML code:
<ol class="advenum"><li></li></ol>
This is to create a better styled ordered list.
However, in the Editor, everything works fine. The class is there, and even after save, the class is being saved in the database and if I edit the text again, it is still there - so far so good.
But now when I visit the page which has just been saved, the class is being stripped away. I don't know wether there is some kind of filter in drupal 7, however I think I did not activate anything.
The WYSIWYG Profile is "Rich Text" and I did not activate either simple source formatting or advanced content filtering. How can it be?
Thanks for help!
I just found out what was the case:
I went at Administration > Configuration > Content Authoring > Text formats, where I configured "Rich Text":
At the enabled WYSIWYG-Filter, I entered at "HTML elements and attributes" the string #[class], and below at "Rules for Class Names" I entered the class itself for it is the only class which has to work like this.
Related
I have a drupal site built by a freelancer, there are few things which were confusing.
When I click the edit button for a node, I see the CkEditor - I tried adding HTML tags and some css to tags. Then I saved it. I found few more changes have to be done, so I clicked the edit button on the respective node and I found the tags/css I added were missing.
Similarly I clicked the edit button for some other node and I did not do anything, I just clicked the save button. The output was completed distorted(because few css was missing and some tags were missing too).
P.S - Am very new to Drupal and this might be a basic question. Please bear with me.
Set the text filter to "Full html" then click on "source" to insert html tags and css. Otherwise (surely a better solution) install the Ace editor, a very useful module with a syntax highlighter for html, php, and more.
I am having a big time issue with solving a problem. I have a placeholder called main for the content region of the page. I was building that region in the cms. Everything was going great until I attempted to add an embedded video contained in an iframe. When I save django cms completely removed the iframe and left an empty div. So I attempted to use prettyphoto light box to open the video by clicking on an image. The code I added to the page through the cms is:
<a rel='prettyPhoto[youtube]' href="https://www.youtube.com/embed/mqVZF_yb8C0?autoplay=1&start=1765&iframe=true" data-rel="prettyPhoto">Click Image</a>
When I saved, django cms completely removed the data-rel attribute from the link which is obviously needed for the js. So I went a step further and adapted the code of the data attribute to:
rel="prettyPhoto"
and the cms also removed that attribute! Also anytime I add an html5 tag like article of section it hates that too! What gives here? Am I doing something wrong? Any advice would be appreciated.
Aaron,
Thanks.
Please see the discussion at https://github.com/divio/django-cms/issues/1529. We use html5lib to clean the contents of the text plugin (this cannot be turned off for security reasons).
What you'll want to do is write a custom plugin (possibly one that can be embedded inside text plugins).
TinyMCE 3.5.8
I merely need to create a button (and module) that acquires a user-entered value from a popup and places it between two tags, e.g., [bib][/bib]
I am having trouble finding a "step-by-step" for doing this, including what files, where code goes, etc. This must be rather simple?
I have replaced all of the occurrences of "example" with my module name in the "Example" module, but that is where my information ends.
If someone would be so kind !
P.S.: It would be even better if the form field would javascript validate for "integer", but maybe I ask too much?
download the tinymce development version
use tiny_mce_dev.js instead of tinymce.js for developement in order to get more usefull error messages
create an own tinymce plugin (this is not that difficult) that opens a popup
get the content of a popup field
insert it at the right place in the editor
You should have a look at other tinymce plugins (in the plugins directory under the tiny_mce dir) to get to know how some things work. There are many plugins, some of them use popups.
I.E. the searchreplace popup
Right now I've been implementing User Interface 2012 and after some hurdles it works just fine. I've been looking to optimise the usability of any UI-editable fields, and run into a related challenge.
Within a component there are several fields that are not mandatory, and as such should not be displayed when they are empty. As soon as an editor enters UI and selects the component holding said fields, several labels such as <add text> and <add internal link to component media> appear.
I am looking to change these labels to something more descriptive of their content, because additional html will be added to the page when a field is not empty.
For example (using Razor Mediator):
#if(Component.Fields.location != null) {
<span class="row">
<strong>Where:</strong>
<span>#RenderComponentField("location", 0)</span>
</span>
} else {
<tcdl:ComponentField name="location"></tcdl:ComponentField>
}
When the location field is empty, it just says <add text>. I would like to change that to <Add location to event>.
I've tried putting something between the tcdl-tags, but they display even when not editing in UI2012. I've been searching the SDL Live content sites but I cannot find any reference to it. Anyone have an idea?
There is no supported way for customizing placeholder text of the empty field. But you could try to write an extension, which overrides the following method:
Tridion.Web.UI.SiteEdit.ComponentField.prototype.setPlaceholderType
This method is responsible for setting up the placeholder text.
I was looking for the same when I was checking this, but I don't think that is doable easily AFAIK. I went little bit deep and found that the labels are part of resource file Tridion.Web.UI.Editors.SiteEdit.Strings.resx EmptyTextField. I did not pursue the option to fiddle with this because it would not be the supported way, nor documented and on top of it I still don't have the flexibility of adding my own text for the each field.
Back to your question, I was tossing up an idea (not necessarily answer to your question) and want to share here so the experts could provide some valuable suggestions. I did not try this option (i felt too much work) and this is in my long todo list and might have some drawbacks as well.
Create Schema Fields with "default values" (e.g; "Add location to event"). the default text will be displayed in your UI.
Write Your templates in a way that if the Schema field value is same as default
##if(Component.Fields.location.value == [Compare the schema field definition - default value of the field]) {
//--> Note: I could not find a straight API for this.. but I am assuming it should be there.
#RenderComponentField("location", 0)
} else {
<span class="row">
<strong>Where:</strong>
<span>#RenderComponentField("location", 0)</span>
</span>
}
Perform above condition check based on target type UI enabled, since we do not want to display the default text for live target etc.
Also, posting Tridion Idea as enhancement request will be great. I will do it in next few days if none exist already.
I like the approach as it'd be a quick way to give author's instructions at the field level. We use the description field to typically provide this type of help in the CME.
For inline editing, content types (SDL Live Content - login required) is another option since they define schema (and prototype component), template, instructions, and "save-to" context. You can offer dummy text that authors replace.
Tips:
Add sample content and/or instructions (Lorem Ipsum) in the prototype component.
Add additional instructions in the content type description.
Select storage location other than the prototype component's folder.
Let us know how it goes. :-)
I pointed to USER LOGIN word of the User Login block on the front page using Firebug. There is a blue square around the word (USER LOGIN) indicating that it is inside a file called HTML.js. Where is that file on the DRUPAL 6 structure. I want to change this word by changing this file and then I re upload it. Is this possible. I would appreciate any reply.
You can either go the whole way and modify the entire login form or you can modify the text specifically. The text you are probably looking for is in the user login block in [root]/modules/user.module (line 743):
$block['subject'] = t('User login');
However, there are a few caveats:
If you're using a theme other than Garland, this text might not be the text you need to modify.
Modifying core is bad. If you have to upgrade (and you will), you'll have to reapply this change.
To do things the right way you would need to create a theme and style the login form. The easiest way would be to copy the Garland theme from [base]/themes to /sites/all/themes, change the .info file and modify it using the techniques in the links above.