=)...ok, I did revert the "alias" thing^^...works fine without it...(saving changes to an existing resource and be redirected to it after saving...).
I have two other questions:
I added the &cancelid param and gave it an integer value, but the cancel button doesn’t redirect me to this page, not when I edit an exsisting resource (and cancel from there --> this will redirect me to the page I wanted to edit, which is fine) nor when I create a new one (and cancel from there --> this will just give me the blank /newspublisher.html page, with no form, just the template without any content...I thought from there it would redirect me to the cancelid? Am I wrong?)
[EDIT START] OK, I got it...the param &cancelid=`int` needs to be camelcased ie. &cancelId=`int`, I think this shouold be correced in the snippet comments and also in your tutorial =) or you define something in this direction in the snippet:
$cancelId = empty($scriptProperties['cancelid']) ? $defaultDocIdOrSomethingElse : $scriptProperties['cancelid'];
The problem I had now was that the cancel button was always redirecting to the defined ressource, but I just wanted a redirection if creating a new ressource is canceled, in the case the editing affects an existing ressource and I cancel, I would like to be redirected to this ressource again, more like a "oh shit, not this one, go back"-behavior =D, so I had another look into the code and added the following second condition to the if statement in the NewsPublisher-Snippet @line 122:
if (!empty ($cancelId) && $_POST['np_existing'] == '') {
I’m still a biiig noob in PHP so I couldn’t get access to the "existing"-thing from the newspublisher.class.php file, not via $this->existing (Fatal error) nor via $np->existing (no acces to protected function) so I did it the ugly way^^...What I also noticed is, that the np_existing hidden input value isn’t set when no form is submitted (logically =D), so a ’false’ doesn’t help...am I missing something or is it only possible to create a new ressource when calling the NewsPublisher-Ressource directly with
http://www.domain.tld/newspublisher.html?? If this is the case, how about another button (maybe below the "Edit" Button) which says "Create"? Just to make the UI a little more comfortable...
[EDIT END]
A similar problem occurs when I save a new created ressource...I just see an empty page (no content, but with the template) instead of the new ressource displayed (what I expected =D).
[EDIT START]I found the param &postid=`int` (which is missing in the tutorial too =D), so I gained a bit of control, but not as I wanted, because now it always redirects me to the defined id and not the the newly saved (existing) ressource...I only want to be redirected to the NEW created ressource instead of being redirected to the emtpy /newspublisher.html page...I tried around, but with no success...any ideas how to solve this?
[EDIT END]
Another "issue" which is maybe not that easy to solve is the "parent"-resource field which is displayed as a text-field for an integer. Can you think of a way to give the user a selection of what’s available (best would be the title of the ressources)? Even I as the developer of the site do not know which container has which ID...this is impossible, so I have to go into the backend anyways to look up the parent ID...
The "wrong template"-issue on installation was my fault! Had nothing to do with the transport package which does not create the NewsPublisher-Ressource (this one I had to create manually [which is definitly ok! by the side], according to your tutorial). In one of my brain-fart-moments (they show up often as it seems =P) I changed the template of the NewsPublisher-Document to 0 (blank) which has the effect, that there’s no <head>-tag which line 362 needs (I think so) to inject the newspublisher css...