Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

siteUrl value in Blogs in AEM communities

pushkars5519813
Level 1
Level 1

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.

7 Replies
Gaurav-Behl
Community Advisor
Community Advisor

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.
smacdonald2008
Level 10
Level 10

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

pushkars5519813
Level 1
Level 1

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.

Gaurav-Behl
Community Advisor
Community Advisor

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.

pushkars5519813
Level 1
Level 1

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.

Gaurav-Behl
Community Advisor
Community Advisor

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

apanghal
Employee
Employee

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