Forum Discussion

KPNOnline's avatar
KPNOnline
Mentor
10 years ago

Get endpoint url in freemarker

Hi Guys,   We have multiple environments running, all with a different URL..   On all the environments, we use a custom endpoint.. They are the same (code is just copied to other environment),  b...
  • DougS's avatar
    10 years ago

    You can use the community.urls.communityPrefix freemarker call (see the documentation on the commuinty freemarker context object) to get the the community id (it renders as '/' + ${communityid}, so if you community id is etgtr99956 then this will return as /etgtr99956).

     

    Another thing to note is that your communities all have an apache rewrite rule in them that rewrites /plugins/... to /${communityid}/plugins/...

     

    That doesn't really help with the second variable.  For that I would recommend creating a variable or function in a macro that you include in all of your components and endpoints that can be used in constructing every endpoint url.

     

    -Doug