Reload a stack with a page list using AJAX
PermalinkI'm trying to find out if it's possible to reload a stack onto a page using AJAX. The thing I'm going for is a stack with a page list that is reloaded after a certain action is performed.
For example, say a select box is clicked to choose a filter for the page list. After the value of the select box has changed, I need to reload the stack with the page list in it and apply the filter.
I can get as far as grabbing the select box's value and posting it through to a PHP file. However, I'm having trouble loading that stack in that PHP file. The first error I get is that it can't find the class for 'Stack'.
I'm guessing that there are a bunch if includes that I'm missing, but I don't know what I need to be pulling in before I try to get and display the stack along with the page list inside it.
\concrete\single_pages\dashboard\blocks\stacks\view.php
\concrete\controllers\single_page\dashboard\blocks\stacks.php
You can copy part of the view.php for previewing the stack into your controller.
Or check my Stack Manager add-on. It's getting a stack's content from the controller every time you select a different stack.
good luck !
- edit -
I see now that you want to load it into a normal page. But the technique is quite the same.
Might also wanna check:
\concrete\blocks\core_stack_display\controller.php and
\concrete\blocks\core_stack_display\view.php
Look at the code for saving blocks in the core, that might help you