Expand my Community achievements bar.

Single quotes converted to double quotes in sightly

Avatar

Level 5

Hi all,

In sightly if I try to use single quotes its getting converted to double quotes. Same thing renders fine in JSP.
<meta name='tags' content='tag1,tag2' />
converted to
<meta name="tags" content="tag1,tag2" />

I need something like 

 <meta name='tags' content='tag1, tag2' data-content='["tag1", "tag2"]' />

Any Sightly Specific solution ? I know we can include a JSP in sightly but any solution in sightly itself.

8 Replies

Avatar

Community Advisor

Hi,

Here you can find sightly specific style guide.you should use " " with meta tag.

https://www.netcentric.biz/blog/aem-sightly-style-guide.html

<meta name="author" content="Erik Grijzen" />

 

- Prince

Avatar

Level 5

But I need single quotes as per some requirement for analytics.

I need something like 

 <meta name='tags' content='tag1, tag2' data-content='["tag1", "tag2"]' />

Avatar

Level 10

Hi,

As prince stated, you have to use double quotes(" ")   with meta tag.

See this GITHUB code as same as the mentioned URL by prince. - https://github.com/Netcentric/aem-htl-style-guide

~Ratna

Avatar

Level 5

Ratna Kumar wrote...

Hi,

As prince stated, you have to use double quotes(" ")   with meta tag.

See this GITHUB code as same as the mentioned URL by prince. - https://github.com/Netcentric/aem-htl-style-guide

~Ratna

 

I need something like 

 <meta name='tags' content='tag1, tag2' data-content='["tag1", "tag2"]' />

Double quotes neccessary for tag1 and tag2 in data-content attribute

Avatar

Community Advisor

hey,

You can try this. if you haven't tried yet.

<meta name="tags" content="tag1, tag2" data-content="['tag1', 'tag2']" />
 

- Prince

Avatar

Level 5

Sorry to say, but the analytics team wants double quotes inside and single quotes outside as I mentioned above. 

Not sure why they need it that way. Even I agree with you all but the requirement is weird.

So  I just wanted to know if there is a possibility to output the way I mentioned.

Or else I will point back to them saying its not possible. We need to follow HTL style guide and double quotes are required as per it.

Avatar

Employee

What version of AEM are you using? Just tried this on AEM6.2, and I don't see the conversion happening.

Avatar

Level 5

Feike Visser wrote...

What version of AEM are you using? Just tried this on AEM6.2, and I don't see the conversion happening.

 

6.1