Search

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.

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.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details