Tuesday 16 November 2010 2:39:20 am
Thank you for your input. I Copied the function NewButton that is available at kernel/content/action.php into a new file and made en extension of it. I am using the class blog_list as the root class for blog_post. So I did it like this: IF post to blog_list (node class I am are posting to) Loop through childs IF name of child is a blog_folder and name is YEAR Loop trough that node and its childs IF name of child is a blog_folder and name is MONTH Set the node to this NodeID The ELSE to the second IF is: ELSE create blog_folder named YEAR FETCH id of that NODE create blog_folder named MONTH Fetch ID of that NODE set $node = eZContentObjectTreeNode::fetch($node); Then the normal action script will proceed as normal, just that I switched ID to where the post should be created to the MONTH ID instead of the root folder ID. I've made an extension and named it ezcreateobject and made a view of createSubFolders. I am no extension expert so I will just post a link to my solution and if someone with more knowledge could make it better and then maybe post a project on it. Link: http://s61762.gridserver.com/ezextensions/ezcreateobject_new.zip This is a very hard coded version, this should be done more through INI-files and hidden form attributes, but it will get people like myself started and probably find a quick solution to things at hand. Thanks again for your input. Best regards, Håkan Bergman
|