When adding relative path for a link to text in a rich text component, the '.html' is append on saving. The Day CQ Link Checker Transformer has the property Strip HTML Extension enabled. By doing this I would expect the .html to be remove but it is not.
How would one prevent the .html appending on relative paths added to rich text components?
Also, if it is an external url and the protocol is not present, the http:// is pre-appended by default when the required is to be https://. How to make it pre-append https:// instead of http://
Related
I have added Link plugin to TinyMCE.
However, when I use a URL from the same site the TinyMCE is displayed, it does not retain the URL as it is in the URL field in the 'Insert/Edit link' dialog box (This happens when I click 'Save').
How can I retain the full address (including the protocol as I have typed) in the URL field?
Note: I need to retain this URL as it is with the protocol as I sanitize the URLs which have no protocol mentioned. Thus, I really need to have the URL exactly as I type in the URL field.
There are a variety of configuration options that tell TinyMCE how to deal with URLs. The documentation for these settings can be found here:
https://www.tiny.cloud/docs/configure/url-handling/
In particular I believe you want these two settings:
relative_urls : false,
remove_script_host : false
I have created a TinyMCE Fiddle to show these in action: http://fiddle.tinymce.com/xVgaab/1
If you comment out the two settings referenced above you will see the behavior of the link href changes.
When I load file.html to TinyMCE, just content in body tag is available. I would like to be able to edit whole html site content with TinyMCE without striping html, head, meta, script tags, or other tags. How is this possible please?
There is a plugin called fullpage that will allow you to do what you want:
https://www.tiny.cloud/docs/plugins/fullpage/
Issue image I’m having this issue when Using a standard RTE plugin hyperlink feature in AEM.
Clicking on the < ahref> links work correctly where it routes me to a correct shortened URL (/usa-en/delete/smart-factory.html) as expected.
However hovering on the link or view source of the markup generated seems to an issue where links shows an absolute path with (/content/te-com/usa/en/pages/….) which is impacting our SEO.
In fact Only the first link is getting shortened and all other links show an absolute path (/content/te-com/... path) when I hover over the links. I suspect that the cached links have an issue with the path getting shortened.
Node storage in JCR:
<p>Hello one and two. </p>
Generated HTML markup from source :
<div class="global-rte-std-bold global-labels parbase section"><p>Hello one and two. </p>
However when I add a shift + Enter when using the RTE a tag is added and the URL somehow gets shortened for all the links as expected as shown in the below markup. Node storage is still the same as above like the one without shift+enter
Markup Generated (observe that the URL's are shortened):
<div class="global-rte-std-bold global-labels parbase section"><p>Hello one and<br>two. </p>
Also we have the below rewrite rule in Apache that actually comes into effect when I click the link. I suspect the cached URL's with RTE have this issue.
RewriteRule ^/?usa-en/?(.*)$ /content/te-com/usa/en/pages/$1 [PT,QSA].
Note : We have not customized the RTE plugin and its a standard Hyperlink plugin we have been using on AEM 6.2
Code used here is a simple
I wonder how it works correctly with a shift + Enter and not when I have the links on the same line.
Any help on this would be appreciated. Thanks
When you link an internal page/asset with RTE editor then url shortening does not work. I came across the same situation and for this I had to write custom Sling rewriter to transform the link so that resourceResolver.map(path) works fine.
#Override
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
int hrefIndex = atts.getIndex("href");
String href = atts.getValue("href");
atts.setValue(hrefIndex, resolver.map(href));
}
I have a little problem with implementing in-page HTML anchors while also having bookmarkable URLs via hashbang. The description is easy:
I visit some URL of my application: http://www.mypage.com/Test.html#!mycontent
On this page there is a lot of text and I need some HTML anchors for navigation. In old-style HTML I'd write AnchorText.
But when I click this link in my GWT application, the URL changes to: http://www.mypage.com/Test.html#myAnchor
GWT Platform recognized the change and throws me back to my DefaultPlace. That's clear because it can't associate the URL to a presenter.
So now the (simple) question is: How can I use in-page navigation while also having hashbang URLs?
How do you construct your anchor?
In case you are doing it statically, why now just add the ! to the href?:
AnchorText
Update:
Ok Instead of an normal Anchor you can use a Hyperlink or InlineHyperlink and set the targetHistoryToken value to #!myAnchor:
<g:InlineHyperlink ui:field="diversityLink" targetHistoryToken="!#myAnchor">MyAnchor</g:InlineHyperlink>
I have defined some external links to store URLs to which other pages can link to. This way a change of URL by a backend user is reflected sitewide.
I wish to extract these URLs to text to put them them into a newsletter as that would be a better practice than redirecting through the site. How could I go about this ?
You may use a placeholder in the rte link dialog (I assume you use the rte to write your newsletter) and then replace this placeholder in a custom hook (search for contentPostProc-all). There you can read your typoscript config or from any other place (own db table, csv, whatever).
You may also use the browse link dialog hook to add your custom links. Take what fits best for you.