siteUrl value in Blogs in AEM communities

Avatar

Avatar
Ignite 1
Level 1
pushkars5519813
Level 1

Likes

2 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Ignite 1
Give Back
Boost 1
View profile

Avatar
Ignite 1
Level 1
pushkars5519813
Level 1

Likes

2 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Ignite 1
Give Back
Boost 1
View profile
pushkars5519813
Level 1

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

Avatar

Avatar
Boost 250
MVP
Gaurav-Behl
MVP

Likes

250 likes

Total Posts

1,147 posts

Correct reply

283 solutions
Top badges earned
Boost 250
Establish
Give back 300
Give Back 50
Give Back 5
View profile

Avatar
Boost 250
MVP
Gaurav-Behl
MVP

Likes

250 likes

Total Posts

1,147 posts

Correct reply

283 solutions
Top badges earned
Boost 250
Establish
Give back 300
Give Back 50
Give Back 5
View profile
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.

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

04-02-2019

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

Avatar

Avatar
Ignite 1
Level 1
pushkars5519813
Level 1

Likes

2 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Ignite 1
Give Back
Boost 1
View profile

Avatar
Ignite 1
Level 1
pushkars5519813
Level 1

Likes

2 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Ignite 1
Give Back
Boost 1
View profile
pushkars5519813
Level 1

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.

Avatar

Avatar
Boost 250
MVP
Gaurav-Behl
MVP

Likes

250 likes

Total Posts

1,147 posts

Correct reply

283 solutions
Top badges earned
Boost 250
Establish
Give back 300
Give Back 50
Give Back 5
View profile

Avatar
Boost 250
MVP
Gaurav-Behl
MVP

Likes

250 likes

Total Posts

1,147 posts

Correct reply

283 solutions
Top badges earned
Boost 250
Establish
Give back 300
Give Back 50
Give Back 5
View profile
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.

Avatar

Avatar
Ignite 1
Level 1
pushkars5519813
Level 1

Likes

2 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Ignite 1
Give Back
Boost 1
View profile

Avatar
Ignite 1
Level 1
pushkars5519813
Level 1

Likes

2 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Ignite 1
Give Back
Boost 1
View profile
pushkars5519813
Level 1

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.

Avatar

Avatar
Boost 250
MVP
Gaurav-Behl
MVP

Likes

250 likes

Total Posts

1,147 posts

Correct reply

283 solutions
Top badges earned
Boost 250
Establish
Give back 300
Give Back 50
Give Back 5
View profile

Avatar
Boost 250
MVP
Gaurav-Behl
MVP

Likes

250 likes

Total Posts

1,147 posts

Correct reply

283 solutions
Top badges earned
Boost 250
Establish
Give back 300
Give Back 50
Give Back 5
View profile
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

Avatar

Avatar
Give Back 5
Employee
apanghal
Employee

Likes

9 likes

Total Posts

21 posts

Correct reply

8 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Boost 5
Boost 3
View profile

Avatar
Give Back 5
Employee
apanghal
Employee

Likes

9 likes

Total Posts

21 posts

Correct reply

8 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Boost 5
Boost 3
View profile
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.