I tried this... oddly, it DID load the esp, but as text... so in functions.esp i have test function:

function test() {
        return "HELLO";
}

I actually get the code spit out as a string, rather than executed...

-Josh

On Sep 26, 2008, at 8:13 AM, Bertrand Delacretaz wrote:

On Fri, Sep 26, 2008 at 12:27 AM, Joshua Oransky <[EMAIL PROTECTED]> wrote:

...How can I create reusable code snippets?...

In esp scripts you should be able to use the load() function:

<% load("somerelativepath/somescript.esp"); %>

see examples under

http://svn.eu.apache.org/repos/asf/incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/esp-load

main.esp includes included-a.esp which in turn includes included- b.esp.

Details are in the corresponding test case
http://svn.eu.apache.org/repos/asf/incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/EspLoadTest.java

-Bertrand

Reply via email to