Loading...
 
 Error
  • Contact the site administrator. The index needs rebuilding.
Development

Development


Here's a free feature for you, include in next version? (Damian?)

posts: 24

Hi there,

Editing blog posts gives you the option to either 'save' (saves the data, but doesn't return you to the blog listing) or 'save & exit' (saves the data, returns you to the blog listing). The first option is very handy to quickly save what you have written while continue adding more text. This is basically what you would also do in Word, to prevent complete data loss if the computer might crash.
I wondered if I could do the same with wikipages, as they can get rather lengthy and this feature therefore is a lot more useful there.

So... with Damian's pointer and the challenge accepted to hack my way through, I have come up with an extremely easy fix that will give the wiki pages the same functionality.

If you like what you see, you could add it to the next release or something. Because this forum post doesn't allow me to publish real code, please e-mail me for more details. But, you're the developers, I hardly think you need my exact pointers biggrin

tiki-editpage.tpl
- First of all, I have renamed 'save' to 'quick save' and 'save & exit' to 'save'. I find this easier to understand (also in the blog section).
- In the table area where it shows the preview etc. buttons, I created an extra one and named it quick_save.

tiki-editpage.php
- Where it says "if $_REQUEST%22save%22)" I have added "or isset($_REQUEST%22quick_save%22".
- At the end of this if clause, I find the header function, which redirects to tiki-index.php. I have created a if clause, that determines whether 'save' was requested or 'quick_save'. The first redirects to tiki-index.php, the second redirects to tiki-editpage.php.

That is all! Hope you like it.

Regards,
WillemB

posts: 2881 United Kingdom

Perfect!

Well Done! Your a proper Tiki Developer now biggrin So how about that SourceForge account and CVS access question wink


posts: 2428 Czech Republic
hmmm. isn't it the same as preview ? what does it (quick) save to the wiki page history ? new version or minor edit ?

posts: 24

@luciash d' being ?
No it's not the same as preview. Preview doesn't do anything, except show you what the page will look like IF you save it like that. Quick save actually does save the contents. You don't leave the edit page so you can continue editing. Like I said, it's perfect if you write long wiki pages like I do and don't want to risk a computer crash / power failure and lose everything you just wrote (but didn't save!). So quick save is just that, a quick save. If something bad happens you lose only what you have changed since the last (quick) save. Like I said before, when you write a long document in Word, it is a good idea to save your file every now and then. We've all had those crashes and everything is lost. I'm just offering the exact same option here.

As far new version or minor edit, nothing changes. If you tick minor edit and quick save, it's a minor edit. If you don't tick minor edit and quick save, it's a new version. You are free of course to change the code and always make it a minor edit when you click quick save.

I'm still happy with it, whether you appreciate it or not biggrin

@Damian Parker
Now that sounds very complicated...