|
IncludeAble<< | Cookbook-V1 | >> Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.
ProblemOne night I woke up, looked at the screen and saw a missing feature. Right now, PmWiki is a standalone system, it produces it's own formatting, html headers etc. GoalThis project tries to make the wiki work as an include from another webpage. It could also be used to build another navigation system arround the wiki. Some people understand it better when you say it's like WebMenu, but the other way around. It's based upon PmWiki v 0.50. The philosophy is that both PmWiki and the user's web pages should be modified as little as possible. BTW, another approach to doing all of this, rather than redefining all of PmWiki's formatting variables, might be to simply define a new function/action to replace HandleBrowse/browse. The new function could do exactly what is desired. --<#> InstallationI'm trying to get the installation instructions together, at the moment the are not completed.
In actionTo show the idea and my experiments:
http://detached.be/test/ip.php(approve links) ProgressIt's almost done :)
Problems
Both WikiHelp and SearchWiki are broken. Probably because of not passing parameters correctly. Low priority.
The wiki needs a wiki.d in the current dir (the including page's dir, not the pmwiki.php dir). Also, to make your local.php work, you need a system link in the same fasion as wiki.d ...
We can define a function in the includewiki.php that does the page inclusion.
The user would then do
After an editing session, the browser finds itself in http://blah/yourfirstpage.php/Group/WikiPage(approve links) It can be solved by patching pmwiki not to do the redirect, and handle it with the loader script. (see the "Modify pmwiki" topic) Working stuff
Since the intention is to include the thing right in the middle/bottom of another page, the top nav bar is a bit intrusive. Low priority.
Could be done with
SolvedAfter editing the page, you get a This is a big problem. The way that the save (actually "post") operation works is that it saves the page to disk, then sends a Location: header back to the browser to tell it to reload the updated page from the server. But if pmwiki.php is embedded in another file and that file has already begun outputting things to the browser (text, etc.), then pmwiki.php has no way to tell the browser to reload the page after it's been saved. In theory pmwiki.php could just output the updated contents immediately rather than redirecting the browser to the page, but this causes a ton of serious browser cache problems (which is why PmWiki/PmWiki does it the way it does). I've commented on this a bit more in pmwiki-users. --<#> Solution: First of all, don't try this at home. I mean, at production servers... Yet. Unless you're nuts, like me. In your pages, add an include("includewiki.php"); at the very beginning. That makes two places where you need to include something to get this to work. I'm sorry, but that's the way it is for now. includewiki.php would then look like this:
Do this in your main page, wherever you want the wiki to be:
The following local.php can be used to remove both the extra http-headers pmwiki tries to send and the opening/closing html code:
Ughm. It's back... I don't understand the need for this patch -- and it's modifying function Redirect, not PrintFmt. I could also work on coming up with a modification to pmwiki.php so that this patch isn't necessary (I try to keep pmwiki.php so that people aren't having to patch it). --<#> It's not necessary, I just realised. It's a leftover from my trials to fix the redirect earlier... (just as a part of the includewiki.php) After some testing, it turns out this is a solution to the URL's after editing problem. I built it by accident! If the pmwiki is going to be included or embeded in other web pages, I thougt some powered by logos might be a good thing.
Good idea, credit where credit is due :) Also, make them linkable NotesI'm a little concerned that adding all this to a webpage will increase it's cpu requirements. It might still be very little compared to something like *nuke, but... Contributorsjoris@linux.be pmwiki-2.2.0-beta68 -- Last modified by {{}}?
|