Akenefick
4 years agoGenius
Trying to retrieve community URL with context object
I am using the following in a custom component:
${community.urls.communityPrefix}
It adds /sejnu66972 to the URL and the link doesn't work. I'm not sure what that is. I can use the actual URL but I would like it to work in both stage and production. Any help would be appreciated.
Beginning your URLs with the /t5 (i.e. the relative URL) is generally what I do as well since it will then work in both my Stage and PROD environments. For example, the hyperlink "/t5/welcome/bd-p/welcome" could automatically become "https://community.example.com/t5/welcome/bd-p/welcome" in PROD and become "https://community.stage.example.com/t5/welcome/bd-p/welcome" in Stage.
(More information can be found in the Understanding SEO-Friendly URLs article.)