Forum Discussion
AdamN
Khoros Oracle
I think this would be beneficial from a convenience perspective, but you can already accomplish basically the same thing. If you consider that an endpoint is essentially a stand-alone custom component, all you're really doing with an endpoint is rendering output from Freemarker code. If you find yourself wanting to use code "within the community" that you've already added to an endpoint, here's what I would suggest doing...
- Pull the common parts of your code into a Studio Macro. You can create Studio Macros on the same page as Endpoints in Studio. A Studio Macro is essentially just another custom component with the added benefit that it can be included in both custom components and Studio Endpoints (normal custom components cannot be included in Endpoints).
- From your endpoint, include your Studio Macro and reference the common code you added. You may want to create a Freemarker Macro (not to be confused with Studio Macro) or a Freemarker Function to make this easier.
- From your custom component, include your Studio Macro and reference the common code you added, similar to step number 2.
I hope this helps!
Inactive User
12 years agoCould you help me wrap my head around this? If I want to make a server to server call with the endpoint, and then want to use the resulting response with FreeMarker in a component (ie. use returned JSON data in a component without using javscript)... would that be possible? Thanks
Related Content
- 10 years ago
- 8 months ago