Question about delegates - trying to manipulate fields in entry edit page.
This is an open discussion with 5 replies, filed under General.
Search
Yes you are, though the EntryPreRender
delegate doesn't provide the page object in its context. Instead you would get the page object like this Symphony::Engine()->Page
. Once you have the page object you can traverse its XMLElement objects and look for fields etc. you want to alter/remove/hide.
If you want to structure your publish pages using tabs, you might want to check out Nick Dunn's publish tabs
extension. For hiding fields author roles
might the right extension.
Thanks for that, I was able to make a little progress. However, when trying to access child elements of the edit form im having some trouble.
For some reason the 'getChildren' method returns an empty array, any idea?
//Get page content. $page = $this->symphonyEngine->Page; $form = $page->Form; //works var_dump($form); //returns empty array var_dump($form->getChildren());
Nevermind, managed to fix this. I Had to re-enable the extension after changing the delegate to 'AdminPagePreGenerate'.
That one always trips people up. :D
Took me a good hour of playing around. Head now hurts, lol.
Create an account or sign in to comment.
I'm just playing around with the extensions class at the minute with the intention of eventually creating my first extension.
At the moment i'm trying to manipulate the 'publish/edit/' page, using the 'EntryPreRender' delegate. I'd like to possibly hide a given field and add in some extra markup to change the layout of the page(tabs etc).
Is this possible? Am I on the right track?
Thanks.