Highlighted

siteUrl value in Blogs in AEM communities

Avatar

Avatar

pushkars5519813

Avatar

pushkars5519813

pushkars5519813

03-02-2019

Hi all,

In my publisher and dispatcher the {{siteUrl}} value I get is //content/sites/blogs/en.html instead of /content/sites/blogs/en.html. Because of this all my links go to https://content/sites/blogs/en.html and gives me an error.

I want to understand from where is it's value getting picked? I don't have much understanding of hbs.

Thanks in advance.

Replies

Highlighted

Avatar

Avatar

Gaurav-Behl

MVP

Total Posts

1.1K

Likes

226

Correct Answer

281

Avatar

Gaurav-Behl

MVP

Total Posts

1.1K

Likes

226

Correct Answer

281
Gaurav-Behl
MVP

04-02-2019

Couple of pointers to debug:

  • check the configuration node properties under your communities site which is '/content/sites' in your case. You should find configurations/properties on that node. It's probably a combination of siteRoot + url or cq:IsCommunitySite (defined at root) or something similar, if not exact key-value pair as siteUrl = <something>
  • the js that gets loaded and initializes the SCF object is http://localhost:4502/etc.clientlibs/clientlibs/social/commons/scf.a47a6a108c7f64b963e8a538fa7fed59....  which is /libs/clientlibs/social/commons/scf or /apps overlay. In we-retail, the code is in /apps/social/console/components/hbs/sitepage/weretail.hbs and set at the element $(".scf-js-site-title") which is utilized by other components. It could be in one of these js that is substituting the HBS expression.
Highlighted

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

04-02-2019

Agree with Gaurav - this sounds like something is not configured properly.

Highlighted

Avatar

Avatar

pushkars5519813

Avatar

pushkars5519813

pushkars5519813

05-02-2019

Thanks for you reply. But this hasn't resolved the issue.en_configuration.png

I checked all the /content/sites and /content/sites/blogs node properties/configuration and still couldn't understand from where is that {{siteUrl}} getting it's value.

I did find cq:IsCommunitySite and it's value is set to true. Also siteRoot is empty. But siteId value is getting picked from here itself, I have changed and rechecked it.

I am attaching the screenshot of my configuration.

Highlighted

Avatar

Avatar

Gaurav-Behl

MVP

Total Posts

1.1K

Likes

226

Correct Answer

281

Avatar

Gaurav-Behl

MVP

Total Posts

1.1K

Likes

226

Correct Answer

281
Gaurav-Behl
MVP

05-02-2019

Could you try to configure siteRoot and see if that gets picked up as siteUrl or  check if  siteUrl = SiteRoot + urlName

or

create a new property siteUrl similar to siteId and pass on a value in it and test.

Highlighted

Avatar

Avatar

pushkars5519813

Avatar

pushkars5519813

pushkars5519813

05-02-2019

That may or may not work but my concern is it shows me correct URL in my local publisher and QA publisher but incorrect URL(i.e //content/sites/blogs/en.html, extra '/') in staging publisher and dispatcher.

Highlighted

Avatar

Avatar

Gaurav-Behl

MVP

Total Posts

1.1K

Likes

226

Correct Answer

281

Avatar

Gaurav-Behl

MVP

Total Posts

1.1K

Likes

226

Correct Answer

281
Gaurav-Behl
MVP

05-02-2019

I may not be able to help you with that except sharing the fact that double slashes (//) are appended when you want share the url that is protocol independent.

If this works fine for you in QA publish but not in STAGE publish then probably, HTTPS related configurations enabled either at AEM server level or in the Communities configuration or at apache which is the root cause. You may want to debug further in those specific configurations.

HTH

Highlighted

Avatar

Avatar

apanghal

Employee

Avatar

apanghal

Employee

apanghal
Employee

05-02-2019

please check if you have externalizer or context path set differently on STAGE publish than QA publish where its working fine.