-
Notifications
You must be signed in to change notification settings - Fork 48
Remove layout when using ajax requests #185
Comments
Hi, Regards, |
Hehe, yeah i thought something like that. The reason i think is that i include the partial two times, one in my primary layout which is rendering a hole modal from bootstrap. And the second time into a blank layout that should refreshing the modal-content, if the request was successfully. |
In your view try this:
This piece of code logically only render the view. |
Hey, i try it out, but did not resolved for 100%. i actually consider about something like $this->viewModel()->setTemplate(); Edit: I edit your message to remove some information about your website, even if it's for test. |
SetTemplate method only change the template you choose in your document, I think you must terminate the view. |
You're right, I can't use the setTerminal method in view, I will check it and commit when I have time. |
Thank you a lot, let you time with it. I have the feeling that i allready annoying every day with something. X__X |
Wrong feeling, I'm happy to do that :) |
Hi again, I think we can't disable the layout directly in the view :/ I don't find solution, except in adding empty layout like you did. Regards, |
Aaarrrggghhh :( No problem, i tried out some options too and i agree with you, there is currently no solution. I wanna try out some other ways if i have time, maybe a "Ajax-Module" or something else. At work they wanna use ajax and i wanna use your CMS, so i need to find something :D Regards, |
Otherwise I can add a control in IndexController with a condition that saying "if it's ajax request: setTerminal on ViewModel"? |
It is a good idea. It should be the users choice if they wanna terminate the layout for ajax or not, because some ajax request can be made for changing layout options, for example 3 color variations of layout or something else. In my opinion we should add a checkbox or something like that on "Document information" for created documents with some description (Terminate Layout [only needed for ajax] => on/off). Something like this with a combination of your control and condition idea, that let the cms dynamically, what do you think? |
Otherwise, I can add a condition in the IndexController (or you can) with if the request is ajax and there's a post or get variable named "terminate layout" exists, execute this code $viewModel->setTerminal(true); ? |
yeah you are right. that's cool. |
Works perfect, thank you again for your awesome work. |
Hey,
the different layouts that i create have "Identifier" to. Is there any possibility to render a layout into a layout, like a partial.
$this->layout('name-of-identifier');
do not work.
The text was updated successfully, but these errors were encountered: