wyona / yanel

http://www.yanel.org
Apache License 2.0
10 stars 5 forks source link

xi:include : Make the called resource aware of it #1

Open baszero opened 13 years ago

baszero commented 13 years ago

Hi,

I am using xi:include in order to include the menu on the top of every page as well as the side bar navigation.

Yanel provides a mechanism in which the included snippet is not retrieved via real request from the browser but rather internally, so that the browser only sees the initial single request. This is achieved by prefixing the include URL by yanelresource:, e.g.:

So for each xi:include, Yanel internally creates another request and the respective resource gets triggered (in case of my example above, the resource is called which matches the realm path /de/sidebar.html.

Suggestion for improval: It would be great if the called resource would be able to find out whether the request is a normal external request (coming from the browser) or whether it is an internal request (coming via xi:include yanelresource:). This would help to control business logic that should be executed only once per external request.

E.g.:

boolean isInternal = getEnvironment().getRequest().isInternal();
dubslipper commented 13 years ago

Hi baszero,

Please take a look at "The Fork + Pull Model" at

http://help.github.com/send-pull-requests/

It would be helpful if you would send a pull request for the changes you would like to see.

Thank you

baszero commented 13 years ago

If I find some spare time to implement the stuff, I'll do that for sure. but I guess that for a Yanel insider like you, i'd be a quick task.

On Tue, Oct 11, 2011 at 7:37 PM, bumpsy < reply@reply.github.com>wrote:

Hi baszero,

Please take a look at "The Fork + Pull Model" at

http://help.github.com/send-pull-requests/

It would be helpful if you would send a pull request for the changes you would like to see.

Thank you

Reply to this email directly or view it on GitHub: https://github.com/wyona/yanel/issues/1#issuecomment-2368662