Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

front_end_layout setting does not utilize RequestHandler #42

Open
bmcclure opened this issue Aug 6, 2011 · 1 comment
Open

front_end_layout setting does not utilize RequestHandler #42

bmcclure opened this issue Aug 6, 2011 · 1 comment

Comments

@bmcclure
Copy link

bmcclure commented Aug 6, 2011

When front_end_layout is set, it overrides RequestHandler's setting of the layout to 'ajax' if it is loaded via an Ajax request.

I could not figure out why all of my /users/ pages had the default layout, even when loaded via an ajax overlay. I turned out it was because I set the front_end_layout setting to 'default'.

How can I utilize the 'default' layout for normal requests, and the 'ajax' layout for ajax requests, without modifying Spark Plug's internal code? That is how the rest of my site works, but I can't figure out how to use the same thing for Spark Plug.

Thanks.

@bmcclure
Copy link
Author

bmcclure commented Aug 6, 2011

I found a simple way around the issue, in app_controller's beforeFilter:

if ($this->RequestHandler->isAjax) {
Configure::write('front_end_layout', 'ajax');
}

(sorry if there are mistakes, just wrote it from memory)

I closed the issue by mistake when I commented--I still think it's something SparkPlug should handle itself, however if this is the intended behavior then the issue can be closed.

Thanks!

@bmcclure bmcclure closed this as completed Aug 6, 2011
@bmcclure bmcclure reopened this Aug 6, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant