Square Brackets in a hyperlink aem - aem

I need to use square brackets in my link in Richtext hyperlink.
Like
https://stackoverflow.com?employeeId=[[Employee_ID]]
When I pass this as a link, it removes the href and I get output as
Link

You will have to overlay the AntiSamy configuration, you should copy it to /apps/cq/xssprotection/config.xml and add the proper rules to allow the brackets.

Related

Changing the color of django specific tag braces in visual studio code

Using the instructions in this existing answer, I have managed to almost get the effect I want.
Below is the image showing the template scope for "{% %}" in Django.
However, in the screenshot, you can see that the only tag that has changed color is the "{% url %}" tag, and not hte bright yellow "{% %}" tags.
How can I change these specific tags to match the url? I'm at a loss as I've changed the template scope setting for the given value, but it's only changing the URL tags.
Be sure to check that you don't have Bracket Pair Colorization enabled, as this will overwrite any custom colours you have defined!
Go to your settings, and search for "Bracket Pair Colorization" to make sure you have it disabled, as disabling this might solve your issue!
Screenshot of the setting radio button

How do I replicate the tinymce link plugin's HTML markup behavior by adding succeeding text outside of the current node instead of inside?

When the user adds a link on selected text, it adds the URL markup only on the selected section and doesn't add the markup to any added text (after the markup is added) if the linked text is at the end of the string. This behavior differs from bold/italics/underline which adds added text to the bold/underline markup if the user adds more text at the end of a string.
I am implementing a custom button that should emulate the behavior of the link plugin. I have gone through the link/plugin.js file to no avail for which code block I need to re-use to get this behavior for my custom button.
How do I implement the link plugin's markup behavior? Are there any tinyMCE commands I should be using (setAttribs, etc)?
Video example of bold vs link plugin

How can I add static text to my MSCRM form?

I need to add static text on my form (can't use the xrm notification option) under specific terms I need to show and hide that text but I can't hold it in a field.
First I thought to use an Image with my text on the form, is there a better way to do that?
Like said in comments, HTML web resource is the way to go. You can embed the HTML in a form section/tab and hide them using conditional scripting in form load.
Reference

What is the best way to change the CSS of a content element in Typo3?

I am creating a webpage that lists the employees of a company. Every employee is supposed to get its own box with text on the left and a picture of them on the right. In order to do so I have used a 'Text & Images' content element for each employee.
However, the options for image alignment do not allow me to place the image to the right of the text using text wrap (all options are no-wrap options). What would be the best way to ensure the pictures do end up to the right of the text?
This is an example of a picture that is right aligned with wrap.
Additionally I would also like the style the border of each 'Text & Images' content element. How would I go about this?
When using the "Text and Images" content element, you have the following options about the position of the images and text:
Above, center
Above, left
Above, right
Below, center
Below, left
Below, right
In text, right
In text, left
Beside text, right
Beside text, left
both "In text, right" and "In text, left" wrap the image with text, as on the following example picture:
If you have less options, there is some TSConfig that is limiting the number of options; that could be something like
TCEFORM.tt_content.imageorient.removeItems = 17,18
About the CSS, you have several ways to include yours; for example you can add your own file using page.includeCSS as documented here or you can overwrite the TypoScript included by the Fluid Styled Content with your own (see plugin.tx_frontend._CSS_DEFAULT_STYLE ) on the Template Analyzer.
To include the default CSS, you have to include the Static TypoScript Fluid Content Elements CSS (optional) (fluid_styled_content) in your template, like on this picture:
Also, I would use an inspector to be sure that the CSS has not been accidentally overridden.

How to force a node inside tiny mce?

I'm using tiny mce for my project and want to validate the node inside the tiny mce. On click of a text element, let's say a paragraph with some id, I load editor for the element. But, sometimes if user replaces the whole content, the node and its HTML is lost. I want to retain this node and only the content is removed. The node can be a paragraph or heading or ul or ol.
EDIT :
I'm providing dummy text such as "Lorem epsum .....". User will be removing this dummy text and add his content.
EDIT2
I want to allow the user to change the content only and the surrounding HTML and styles should remain intact.
How can I accomplish this ?
This would check if node content is in editor, and if not will add it at the bottom.
var nodecontent;
if (!tinyMCE.activeEditor.getContent().match(/nodecontent/) {
tinyMCE.activeEditor.setContent(tinyMCE.activeEditor.getContent()+nodecontent);
}
You could make a new button in tinymce which gives you a pop-up asking for the ID or the title of a node. This button then puts a small piece of "code" in the tinymce textfield.
for example: ((id:10))
When loading a node, you can search if the current node has that "code" in it by a regular expression. If it has, load the content from the node with that ID from the database.
Hmmm, it will be very tricky to keep the surrounding html while the user is able to delete html elements in the editor. You would need to intercept each attempt where a user could delete your surrounding html (Copy/paste, delete, backspace, usage of the code-plugin, and so on...) and then handle it case for case.
Suggestion:
In case the surrounding html will never change you could give the user total control over the editor content through adding the surrounding html after the user submits/saves the editor content. To keep the style even without the surrounding html it might be sufficient to create a css class and apply it to the body element of the editors iframe. The body element is not deletable. I do not know if this is acceptable in your use-case (let us know).