Not logged in. · Lost password · Register
Forum: General Help and Support Templates and Layout RSS
How to put the edit-form into a special div-box?
Avatar
3AtÜ #1
Member since Mar 2007 · 29 posts
Group memberships: Members
Show profile · Link to this post
Subject: How to put the edit-form into a special div-box?
Hi,
I want to put the text-edit-field (and also the toolbar buttons) of a page into a special place in my template. This area should only appear, when a user edits a page. How can I assign a special div-id only for the edit-form, so that my stylesheet moves the whole form on to the location, that I have assigned in my css ? The preview should be shown in the old place, where it belongs.

My design:

normal appearance

===================================================
|     Header                                      |
===================================================
|               |                                 |
|     Menu      |  Content                        |
|               |                                 |
|               |                                 |
|               |                                 |
|               |                                 |
|               |                                 |
|               |                                 |
===================================================
|     Footer                                      |
===================================================


edit appearance

===================================================
|     Header                                      |
===================================================
|    edit section                                 |
|                                                 |
|                                                 |
===================================================
|               |                                 |
|     Menu      |  Content  /preview              |
|               |                                 |
|               |                                 |
|               |                                 |
|               |                                 |
|               |                                 |
|               |                                 |
===================================================
|     Footer                                      |
===================================================


Thank you.
Greetings.
chi #2
Member since Jun 2006 · 1851 posts · Location: Munich Germany
Group memberships: Members, Super Mods, Wiki Managers
Show profile · Link to this post
Hi,

event though it`s eventually possible I think it`s not easy to achieve what you want because you have to modify DokuWiki source code to add a custom div. Also, the edit-form/preview is handled  by the tpl_content() function in the main.php of your template, thus, you can not easily separate the edit-form from the preview. Looking at your example, I think you like to use the browsers full width when you`re in edit mode. Another possiblity to achive that would be to hide your menu when you edit a page. You can do this by adding some PHP to the main.php of your template around your menu:

  1. <?php if($ACT != 'edit' && $ACT != 'preview') {?>
  2.   <div id="your_menu">
  3.   </div>
  4. <?php } ?>

chi
Please add [SOLVED] to the initial thread subject if you feel your question has been answered.
If my answer doesn't make sense maybe your question didn't either - just visit http://facepalm.org.
Avatar
3AtÜ #3
Member since Mar 2007 · 29 posts
Group memberships: Members
Show profile · Link to this post
Thank you very much. I'll pick up your idea and split the output of tpl_content() when dokuwiki is in edit or preview mode. The edit section ends with an </form>, so why not cut it there? I guess, that will work.

Cheers.
Avatar
3AtÜ #4
Member since Mar 2007 · 29 posts
Group memberships: Members
Show profile · Link to this post
Okay, I integrated the following into my template:

// we split the wiki output when page is in edit mode
ob_start();
tpl_content();
$wiki_output = ob_get_contents();
ob_clean();
if (($ACT == 'edit') || ($ACT == 'preview')) {
  $pattern = '/\<br\sid\=\"scroll\_\_here\"\s\/\>/';
  $split = preg_split($pattern, $wiki_output);
  $edit_area = $split[0];
  $wiki_area = $split[1];
} else {
  $wiki_area = $wiki_output;
}
Now I have two variables with the content.
$edit_area
is mostly empty and its div-id is not shown.
That seems to work.

Greetings.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-05-24, 10:17:58 (UTC +02:00)