Forum Discussion

peterlu's avatar
peterlu
Champion
12 years ago

endpoint path

endpoint url looks like this

http://domain.com/hinterlands/plugins/custom/salescontainer/hinterlands/my-custom-endpoint

 

The endpoint name is "my-custom-endpoint"

 

Is there any freemarker object exposed that we can use to print out "/hinterlands/plugins/custom/salescontainer/hinterlands/" (the system path) ?

So I don't need to hardcode it?

 

Peter

  • Hi peterlu,

     

    I don't think there is a context object that exposes this but what I would suggest would be to use a freemarker macro so that you can simply use the macro in your components and you still have only one place where you hardcode (define) the string.

     

    Hope that helps,

  • peterlu

    You can use this code to get Endpoint URL's.

    <#assign endpointUrl = webuisupport.urls.endpoints.name.get("my-custom-endpoint").build() />

    ${endpointUrl}