sightly/HTL/AEM: using "tel:" on an href parameter (a tag) doesn't work - aem

help please. I have this very simple code.
<sly data-sly-test.temp1="tel:+61-8-8201-3343"></sly>
my link
it works fine if using "mailto" as target but when using "tel", the href tag is empty (inspected the tag using firebug while on view as published).
Also as can be seen in the sample code, my last line displays the value. The value displays fine when using "mailto" and "tel".
If I change my code to
<a href="tel:123-456-789">
${properties.linkTitle}
</a>
The href tag is populated properly.
any ideas what I am doing wrong? Thanks
edit:
based on suggestions from this link, I modified both:
/libs/cq/xssprotection/config.xml
/libs/sling/xss/config.xml
and restarted my local AEM instance but nothing would work.

The link checker transformer is removing your tel: link, because the prefix is not known in it's configuration. All links are checked and the invalid are removed when the template is rendered.
You have to extend the CQ Link Checker Service configuration by adding "tel:" as new "Special Link Prefix".
In order to to this just copy the configuration from /libs/cq/linkchecker/config/com.day.cq.rewriter.linkchecker.impl.LinkCheckerImpl to your config folder e.g. /apps/myapp/config and edit the property service.special_link_prefix

Related

AEM Link Checker: How to prevent the Link is removed if it is INVALID

I have a request from PM to prevent AEM automatically removing the invalid link in Publisher.
Here are from AEM Document :
Internal links are validated as soon as the content author adds an internal links to a page. If the link becomes invalid:
It is removed from the publisher. The text of the link remains, but
the link itself is removed.
It is shown as a broken link in the
authoring interface.
I tried with many settings but it didn't work for me. Anyone knows the anwser?
I really appreciate your help.
Thank,
Duc
You can add x-cq-linkchecker="valid" attribute in the tag to make sure that links are always mark as valid by AEM. In this case link checker will check the link but will mark it valid. ( For Ex:- <a x-cq-linkchecker=”valid” …>)
You can optionally use x-cq-linkchecker="skip" attribute in the tag as well. In this case link checker will not even check for validity for link. ( For Ex:- <a x-cq-linkchecker=”skip” …>)

AEM RTE with standard Hyperlink plugin cached on dispatcher do not get shortened for second , third links on same line

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));
}

TYPO3 News Extension Pagionation doesn't work

I use the news extension in TYPO3 and so far it's almost fine.
The only problem I have is the pagination. If I click e.g. on the pagination page 2, the link get some extra string like &tx_news_pi1[%40widget_0][currentPage]=2 but the outcome is always the same like on the first page. So do I have to do something in the settings to get this working or does anyone of you have an idea where the mistake could be?
I looked up at github and google but couldn't find any helpful information for my problem which is kind of unbelievable...
Another thing is I would try to do an AJAX pagination when it's working. I saw the topic on the TYPO3 site (https://docs.typo3.org/typo3cms/extensions/news/AdministratorManual/Templates/AjaxBasedPagination/Index.html) and followed the instructions of installing typoscript_rendering, inserting the list plugin as content element, changed the template path and inserted the js.file. But the thing here is when I set the template path to the indexAjax.html I get the following error
Undeclared arguments passed to ViewHelper GeorgRinger\\News\\ViewHelpers\\Widget\\Ajax\\PaginateAdditionalParamsViewHelper: page
When I look in the AjaxPagination.js given by link above the variable ajaxUrl is always undefined, because it wants to grab the data which causes the error message above I think. Hopefully somebody of you can hint me to the right solution..

How can I render a link on a Powermail confirmation/submit page?

I'm trying to place a link on the submit page of my powermail setup.
You'd think this is a simple task, but bear with me.
My Powermail form has 2 hidden fields which are prefilled with a page ID and a page title.
These belong to the page I later want to return to, after having sent the mail. By putting these values in the form, I hoped to have access to them whenever I need them in the process.
I prefill these hidden fields from TypoScript like so:
plugin.tx_powermail {
settings {
setup {
prefill {
// Hidden "back to" page ID. This is the page you may want to return to after sending a mail.
backto = TEXT
backto.data = GP:backTo
backto.if.isTrue.data = GP:backTo
backtotext = TEXT
backtotext.noTrimWrap = |Back to ||
backtotext.data = GP:title
backtotext.if.isTrue.data = GP:title
backtotext.htmlSpecialChars = 1
}
}
}
}
1. Approach
Given that Powermail claims you can now use Fluid ViewHelpers in your content sections, I though, great, let's use the PageViewHelper, like so:
{f:link.page(pageUid:'{backto}')}
But where does my link text go? More inline notation to the rescue!
{backtotext -> f:link.page(pageUid:'{backto}')}
Rendered Result
Seems like the inline notation is not fully supported. I thought I was smart by simply using:
{f:link.page(pageUid:'{backto}')}{backtotext}
But this leaves the <a> tag open, which has very undesirable effects...
So - No link for me!
2. Approach
So I thought I would simply construct the link in TypoScript and render it on the page via
{f:cObject(typoscriptObjectPath:'lib.myBackLink')}
But I can't see any way to access the variables from the (sent) Powermail form in TS. So I don't have access to the page ID or title.
3. Approach
So I thought, if the default PageViewHelper only wants to render its children as its content, maybe I can roll my own ViewHelper that accepts the content as a parameter!
But how would I make that ViewHelper known to the system so that I can use it in my customized Powermail templates?
I've only used Fluid inside of my extensions before. It was obvious how Fluid would look up the correct ViewHelper by name, by what if I want to use a ViewHelper in my fileadmin folder hierarchy?
4. Approach
So, why not just use a normal link by using {backtotext} in the RTE?
TYPO3 realizes, that that is an illegal reference, and quickly turns the link into:
And the resulting output will simply not be a link.
So, that doesn't work either.
OK, so I change the target to {backtotext} (removed a slash). Now the URL is no longer recognized as internal and is marked with data-htmlarea-external="1". This causes my link to actually be fully evaluated and rendered (yay).
But it is now treated like an external link, RealURL no longer affects it and it is subject to external link _target behavior.
Why is this so difficult? What am I not understanding?
In RTE you have to use <link ###pageid###> instead of <a href="...">.
Have a look into the RTE DB field contents (or hit the no RTE checkbox) on how to use the link elements.
As it turned out, none of the previously attempted solution actually worked.
To get things over with, I just replaced the web section in the PowermailAll template, like so:
Section for Web view
<f:section name="web">
</a>
</f:section>
And then I used the following in my Submit Page content:
{f:link.page(pageUid:'{backto}')}{backtotext}{powermail_all}
Problem solved. I guess...

Meta descriptions of frontpage items not working in joomla 1.5

When I view the page source the meta tags are fine, however when I try to share the website link (the problem is only with frontpage item) on Facebook, the preview points to "Joomla! ..." text.
I have also changed
Changed the global config file (that only ensures all other pages work fine except the frontpage item)
hardcoding the MetaDesc tag in *.php files.
Maybe I'm missing something very basic?
Have you tried removing the Generator meta tag from Joomla? The only meta data tag I know of that starts Joomla! is the generator tag. In Joomla 1.6 onwards you can remove this by adding a line to your template. In 1.5 however you have to edit the following file.
\libraries\joomla\document\html\renderer ~ line 84
As mentioned earlier, the Google problem should be solved by waiting for a while.
Facebook seems to need custom meta tags in order to work properly. There is a thread about it here. Also worthwhile checking out facebook developers section.
Your home website not show metadescription and keyword although you config it in Global Configuration .
Menu manager -->Home is Front Page Blog view.Try insert metadesc and keyword in file
I try using get values from configuration.php.But it not working with 2 parameter MetaDesc, MetaKeys.
Edit file yourwebsite\components\com_content\views\frontpage\view.html.php
$config = & JFactory::getConfig();
$document->setDescription($config->getValue( 'config.MetaDesc'));
Sumary I fix my problem like that,
Edit file yourwebsite\components\com_content\views\frontpage\view.html.php
$document->setMetadata(“keyword abc here”);
$document->setDescription( "Description about your website" );
Hope this help someone have some problem's.My name is vanhien771354
www.nhipcau.us