Page 1 of 1

Creating new entry from WikiWord

Posted: Mon Oct 11, 2004 1:28 am
by randybrown
One of the things that has attracted my attention about s9y is the inclusion of WikiMarkup with the WikiText filter. There's one final touch which could be added when creating new links with a WikiWord:

I have set the Wikilinks New URL to the URL for editing a new document:

http://domain.tld/serendipity/entries?s ... ction]=new

But, to complete this, the TITLE field at the new entry form shoudl be filled in with the WikiWord. This will make the process more transparent and also remove the chance of typos.

I tried adding

Code: Select all

?title="WikiWord"
to the end of the URL, but this didn't work.

Also, the new page name (the WikiWord name) shoudl be written to the Wikilinks File.

Any possibility of a quick hack for this?

Re: Creating new entry from WikiWord

Posted: Mon Oct 11, 2004 10:50 am
by garvinhicking
Hi Randy!

There's an easy quick hack: Edit your serendipity_functions.inc.php file, find the function serendipity_printEntryForm() (it's line 2799 in my latest CVS checkout). At the function top, add this line (I added a few already existing lines so that you see where to insert it:

Code: Select all

    $serendipity['EditorBrowsers'] = '(IE|Mozilla)';
    if (isset($serendipity['GET']['title'])) {
        $entry['title'] = $serendipity['GET']['title'];
    }
    $draftD = '';
    $draftP = '';
    $categoryselector_expanded = false;
Then you can append the link ?serendipity[title]=WikiWord.

Have fun,
Garvin

Posted: Mon Oct 11, 2004 5:17 pm
by randybrown
Thanks, Gavin. Applying patch.... now.

Posted: Tue Oct 12, 2004 2:28 am
by randybrown
Oddest thing... when I apply the patch, s9y stops working. I've checked and double-checked, even looked at the server logs - there is no problem with the php.

An even odder thing, even after copying over a fresh

Code: Select all

serendipity_functions.inc.php
, s9y still doesn;t work.

Any clues.

Posted: Tue Oct 12, 2004 10:59 am
by garvinhicking
Uh, that really sounds weird. What do you mean by "stops working"? Don'T you get any output? Can't imagine what is going on there :(

Regards,
Garvin.

Posted: Tue Oct 12, 2004 4:39 pm
by randybrown
Yes, there's no output - blank window. Even after replacing the editted file with a fresh copy, there's nothing. I have to delete everyting and reinstall. But if I make the change again, the same thing happens.

That's why I used the word "odd..." Maybe, "puzzling" would be better. ;-)

Posted: Tue Oct 12, 2004 5:47 pm
by garvinhicking
I suppose it must be something with your editor! Check if you save with \n as separators, or if you wrongly upload the file as binary?!

Regards,
Garvin.

Posted: Tue Oct 12, 2004 6:36 pm
by randybrown
I'm using PSPad to edit and ftp the files. It has not caused problems with other php work I do.

Something which just came to mind: the file in question is 151K in size. I don't think I have editted files of that size in PSPad before and wonder if PSPad is botching it?

Will test in another editor.

But... I have replaced the file using WS-FTP too, with the same results. Odd. I'm sure it's something on my end.

Posted: Tue Oct 12, 2004 8:58 pm
by randybrown
I used TextPad to edit the file in a fresh install of the current beta. All went well. So, I am wondering if PSPad does, in fact, muck up larger files?

Next question:

Where do I append:

Code: Select all

?serendipity[title]=WikiWord
.. at the end of:

Code: Select all

http://domain.tld/serendipity/entries?serendipity[adminModule]=entries&serendipity[adminAction]=new 
?

Thanks.

Posted: Wed Oct 13, 2004 12:03 pm
by garvinhicking
Okay, looks like we have the evildoer in form of PSPad. But I don't know the tool :)

You need to append the link to read like this:

Code: Select all

http://domain.tld/serendipity/entries?serendipity[adminModule]=entries&serendipity[adminAction]=new&serendipity[title]=WikiWord 


:)

Regards,
Garvin.

Posted: Wed Oct 13, 2004 3:02 pm
by randybrown
Got it to work. Thanks.

Let me pass on some details:

This was not working at first. When I would click on the ? at the end of a WikiWord, s9y would simply reload the same page - it would nto advance to the edit page.

During install, I left the default setting in URL rewriting; for my server it was "Use Apache errorhandling." After changing that to "Use Apache mod_rewrite" all works well.

I don't know if this was a mistake on my part during install, or somethign which needs to be looks at in either documentation or the install process, but wanted to pass it along.

Thanks for your help Garvin.