|
Cookbook /
SectionEdit-Talk
Peter Kay June 14, 2011, at 12:56 PM
====
====
Well you can simply achieve this with the correct CSS code. Just change $HTMLStylesFmt['sectionedit'] after the include. Add float:right; into it or into your CSS file. Maybe I'll inlude that in a later version, we'll see. - Klonk
I included it in version 1.3.3 but removed it again in 1.3.4 as it brought more problems than it had benefits. Of course you can do it on your own and maybe you won't run in display problems (e.g. with %rframe%) - Klonk August 30, 2005, at 03:32 PM
====
Change the display text in your XLPage (see above which strings to use). Regarding permission just write (:if ! auth edit:)(:nosections:)(:ifend:) somwhere in your text. Placing this in the GroupHeader or GroupFooter does not work at the moment - Klonk August 31, 2005, at 01:28 PM
hm, and if I would write it in Site.GroupHeader it sould work for all groups? This would be extra nice but I'm not shure if this is the pmwiki way . ..noskule September 01, 2005, at 07:22 AM
AFAIK no, it shouldn't work then for the whole wiki only for the Site group. Currently I try to find a better way to check the GroupHeader and GroupFooter. - Klonk September 01, 2005, at 09:04 AM
With release of version 2.0 the above markup works in GroupHeader and GroupFooter and also within conditional markup. - Klonk September 28, 2005, at 08:51 AM
==== September 06, 2005, at 10:35 AM : 'Moved Edit Links below Sections' \\
I edited lines 243 to this ====
Hi Klonk, I absolutely enjoy this script. This is easy just add div.sectionedit a:hover{ color:#f00;background-color:#0f0;}. The used colors are just examples. - Klonk.
it's doesn't work. the output is <div class='sectionedit'><a href='http://pmwiki-2.0.11/index.php?n=Main.HomePage?action=edit&s=1&auto=y&from=Main.HomePage(approve links)'>
(Edit Section ↓)</a></div> and the "a" class is not define
A related quick tip: For 'stealthy' links, which are hidden unless you put the mouse near where you expect them to be try replacing:
/*** defines the layout of the section edit links */
SDV($HTMLStylesFmt['sectionedit'], "
div.sectionedit { text-align:right;font-size:smaller;clear:both;}
");
with
/*** defines the layout of the section edit links */
SDV($HTMLStylesFmt['sectionedit'], "
div.sectionedit { text-align:right;font-size:smaller;clear:both;}
div.sectionedit a { color: #ffffff}
div.sectionedit a:visited { color: #ffffff}
div.sectionedit:hover a { color: #999999}
div.sectionedit:hover a:visited { color: #999999}
div.sectionedit:hover a:hover { color: #0033cc}
");
====
Version 2.0 works great. Looks sharp!. I don't think it is a good idea to include it in the standard version, but I it should be possible. The only problem I see is when using MediaWiki style. I'll think about that - Klonk September 29, 2005, at 01:22 AM
OK, I looked at the code and decided not to do that. Giving such a feature would only make sense when it could be adjusted with different stuff e.g. make it possible to use ---- also for autosectioning. But then we run heavily into problems with MediaWiki style. What should be considered as borders for the sections? To include such a feature would be possible though but I want to avoid creeping featurism. Let's discuss on the mailinglist - Klonk September 29, 2005, at 01:56 AM
What is the latest on this? Is it now possible? I'd like to do pretty much the same thing (no edit heading for level 1 which is redundant to the way I have pages laid out, and clutters the head of the pages). Mainly what I'm looking at, I think, is starting the autosectioning from level 2 down - which could be done as navet was suggesting or perhaps imply another approach? Thanks for any info. - Don, 28 Oct. 2007
==== There seems to be a problem using SectionEdit together with Numbered Headers or Page Table Of Contents. With Numbered Headers the headers display correctly, but SectionEdit inserts the text %block margin-top=0px% before each of the links in the contents table. I bodged this to work by inserting another Sure, but how should the script know that? Every header in the wiki text (source) is used as a border for a section. And each header that is used as a border gets the %block margin-top=0px% which is a simple style and sets the margin. In my opinion the Numbered Headers script gets the whole header and displays it, but does not recognize when a style is applied try a header (with section edit deactivated) with e.g. %newwin% and you'll see it in the table also. - Klonk
With Page Table Of Contents the contents table is fine, but the headers are not rendered properly. Changing the order of the Includes in config.php doesn't seem to change anything. Mark Hodson? October 09, 2005, at 08:20 AM Currently I have tried the all 3 extensions of TOC (Page Table Of Contents, Numbered Headers, and the Quick Page Table Of Contents). All 3 of them don't work correctly with SectionEdit. This should be fixed. Other Wikis can handle both features well (just to metntion some: dokuwiki, Someone noticed this and wrote Slim Table of Contents (as noted above). While I prefer a different layout (not right-justified), the css is really easy to edit, and it does work with SectionEdit. ==== I had two sites implemented. one works perfectly. the other works with a warning Warning: Cannot modify header information - headers already sent by (output started at /data/httpd/pmwiki-2.0.12/cookbook/sectionedit.php:493) in /data/httpd/pmwiki-2.0.12/pmwiki.php on line 709 what gives? both sites have identical HTTPd/PHP This looks like some text was output at one location and not at the other. Please check the PHP-Setting regaring showing of errors/warnings. Maybe something differs there - Klonk November 07, 2005, at 08:29 AM
You are right there, both servers have the same error message in HTTPd error_log files. One also shows the message on HTML pages. One server was using startand packages from CentOS 4.1, the other uses Whitebox Enterprise Linux 3, both are clones of Redhat Enterprise Linux 3/4. How should it be fixed? the error logs are growing ... I have no idea... I don't have a server available that runs Linux currently, therefore it's difficult to reproduce it, as with windows and other linux server (including on my own homepage) work perfectly. FYI I locally installed PHP 4.4.0 and just changed the force_cgi-redirect setting and chnaged the reporting to show only errors and warnings, i.e. error_reporting = E_ALL & ~(E_NOTICE | E_USER_NOTICE) ; Please try and tell me whether this helps... - Klonk November 16, 2005, at 02:34 AM
I have another idea: edit sectionedit.php and remove at the very end the lines from ?> and following. The script only has 489 lines therefore I assume there are some empty lines after the ?>. As the ending ?> is not necessary anymore with PmWiki this might help (I just left it as I didn't encounter any problems yet) -Klonk November 16, 2005, at 02:38 AM
No. it does not help I configured PHP so that NO errors/warnings show up on web pages. however, it does show in HTTP error_log file. The 2nd trick does not work though. same errors Hmm, very strange. I got such errors only when I added some code to display varables, but not anymore when I removed those commands. Do you have the latest version of the sectionedit script? I noticed that I forgot to remove this additional display in a former version... - Klonk November 17, 2005, at 01:31 AM
==== Hi, using php 5 and Apache 2 on Windows, I get the following errors on the page Warning: array_merge() [function.array-merge]: Argument #2 is not an array in C:\Program Files\Apache Group\Apache2\htdocs\pmwiki\cookbook\sectionedit.php on line 264
Warning: array_unique() [function.array-unique]: The argument should be an array in C:\Program Files\Apache Group\Apache2\htdocs\pmwiki\cookbook\sectionedit.php on line 266
Warning: in_array() [function.in-array]: Wrong datatype for second argument in C:\Program Files\Apache Group\Apache2\htdocs\pmwiki\cookbook\sectionedit.php on line 287
Warning: in_array() [function.in-array]: Wrong datatype for second argument in C:\Program Files\Apache Group\Apache2\htdocs\pmwiki\cookbook\sectionedit.php on line 287
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\pmwiki\cookbook\sectionedit.php:264) in C:\Program Files\Apache Group\Apache2\htdocs\pmwiki\pmwiki.php on line 766
When I comment out the offending lines and references, everything seems to work ok. I don't use includes so it is not a problem for me but I thought I would raise the issue for someone to look into (I don't know any php otherwise I would!) Also, can anyone help me move the section edit links to the bottom of the section in the latest release? Dav Bacci 25th Jan 2006 Hi, using php 5 and Apache 2 on Mac X same problem, a php5 problem !! Trt editing the lines that show the "array" type error by adding "(array)" in front of the offensive variable. This will cast that variable as an Array, which should fix the problem. BenWilson February 05, 2006, at 12:37 PM Maybe you can specify this for PHP-Beginners... ;-). This here are the lines: $SectionEditIncludes = array_merge($SectionEditIncludes,$args['']); /*remove double page entries*/ $SectionEditIncludes = array_unique($SectionEditIncludes); what's to do? - Chris Hi, I'm not even a beginner with PHP, but I did it this way and stopped getting those warnings: $SectionEditIncludes = array_merge((array)$SectionEditIncludes,(array)$args['']); /*remove double page entries*/ $SectionEditIncludes = array_unique((array)$SectionEditIncludes); Jahvetti ==== SectionEdit works okay for me except under the following circumstances when the section being edited overwrites the whole page:
If instead, I replace (4) with: Hit "Save", then the page is saved successfully. test (Looking at the history seems to confirm that SectionEdit deletes everything bar the section being edited on "Save and Edit", then adds it all back on "Save".) Is this a bug or a feature? Marc 2006/06/27 Do you really have the version 2.0.3? (Please check in the PHP source) This bug should be fixed (at here the described problem does not occur). Maybe you should redownload the script, I uploaded the latest version again. -Klonk July 07, 2006, at 02:22 AM I have exactly the same problem with PmWiki 2.1.26 and sectionedit 2.0.3. One additional information: After a "Save and Edit" the whole page is replaced by the section, which can be verified by looking at the page with an second browser. This behaviour is very dangerous and annoying, though sectionedit is a really great feature. juergen 2006/09/16
Same with sectionedit 2.0.4. An additional information might be, that I have $SectionEditWithoutHeaders = true; and $SectionEditInIncludes = false; in my local.conf. juergen 2006/09/19
OK, I'll look into it (again(. How did you do it? "Save and Edit" then "Cancel"? Because this is the only way I can reproduce it. Please try "Save and Edit" (you could try it several times) and then leave then page with "Save". Do you still only see the edited section?? - Klonk September 20, 2006, at 03:22 AM
Please download evrsion 2.0.5. Now this problem should be (finally) fixed. Please try and report. Thanks. - Klonk September 20, 2006, at 04:03 AM
Tested with 2.0.5 and 2.1.0, both work fine. Many thanks ! juergen 2006/09/21
Jipieh!! Thanks for the report. So I finally found the bug! - Klonk September 21, 2006, at 08:46 AM
Found one little problem with 2.1.0, worked with 2.0.5, though. Preview dosn't work. Fixed it by removing the comment-character (#) in line 457. juergen 2006/09/22
Uups optimized too much, I fixed it in version 2.1.1 (with another improvement/bugfix) and uploaded it again - Klonk September 22, 2006, at 03:00 AM
In my installation (German) a bug appears, when I activate sectionedit. The second heading is no longer displayed as a heading, but with exclamation marks. If I insert an exclamationmark in the lines between all is okey. If I add &action=test all is also working If I use preview the same Only without action this problem is there?? Pages with headings created without sectionedit on are also displayed right, even if it is on! Many greetings hh(at)11h.de (4.Juli.2006) my testcode: testtest this line is no heading any longermORE TESTING mORE TESTING testDo you really have the version 2.0.3? (Please check in the PHP source) This bug should be fixed (at here the described problem does not occur). Maybe you should redownload the script, I uploaded the latest version again. -Klonk July 07, 2006, at 02:22 AM ==== Hi. First of all, thanks for your great extension! Now, it also happens to me the thing of "SectionEdit deletes everything bat the section being edited". Using version, 2.0.3. This is not so bad. The problem is, if I get to a sectioned page through eg. Main.mypage it works perfect, but, if I get to the page through Main.mypage?action=view , the "edit section" links do not appear. This I checked it consistently through various pages. Any idea to fix this? Inigo August 11, 2006, at 10:51 AM Use "Main.mypage?action=browse" then it works. Pm has changed this somewhen in the past. If you want to work it also with vie go to the end of sectionedit.php and locate "$action == 'browse'". Replace it with "$action == 'browse' | $action == 'view'" - Klonk September 18, 2006, at 08:35 AM Thanks, that was it! Inigo? October 04, 2006, at 05:16 PM ==== August 20 2006 Hello, I tried sectionedit with logon status: (:if authid:)====(:ifend:) and when I try to edit the section, it is empty (while it is not without the conditional markup). Any idea ? Nicolas, August 20, 2006, at 02:11 PM Put " Could this be made optional? For pages that I always edit, I have to choose to edit the entire page (to enter my password), then go back to select the section. I'd like to do this optionally per page, or site. ==== Found a new bug, introduced around 2.1. If the first line of a page is a heading I get a line like (:sectionedit Main.Test Main.Test:) at the top of the page. Insert something other above the heading to fix that. Tested with sectionedit 2.1.2 and a fresh install of pmwiki 2.1.26, no other cookbook extensions installed. juergen 2006/09/23 This is fixed with version 2.1.3. I had to change regex more than I thought it is necessary. - Klonk September 24, 2006, at 01:14 AM I have a similar problem (using pmwiki-2.2.0-beta58 and section edit 2.1.3). I also get a line like (:sectionedit Articles.TestGerman Articles.Test:) if the first line of a page is a heading or contains a footnote (created using the extendmarkup.php). Torsten July 20, 2007, at 02:26 PM Besides I just discovered that ((:nosectionsinincludes:) doesn't work for me. And I found out that the sectionedit works for the section that comes BEFORE the "Edit Section↓" when it is in an included page. i.e. on the page Test it works correctly (it works for the section that comes AFTER "Edit Section↓") whereas it modifies the section that comes BEFORE if the page Test is included on another page using (:include Test:). And as decribed further down in this discussion the second heading is not rendered as heading but displays with two exclamation in front of it (both on included and not included pages). But when I click on the "Edit Section↓" next to that second (not rendered) heading on pages that are included it doesn't open the markup for the section that comes before or after the "Edit Section↓" but the edit-markup for the whole included page. I hope anyone finds this information useful. Torsten July 20, 2007, at 02:58 PM
I have the same issue, thank you for the work around. jtankers October 3, 2007 ==== I am using SectionEdit with RequireAuthor. I find that when the unsuspecting author tries to edit and then save one section (using SectionEdit's 'Edit Section') without entering an author name, the message is displayed up on top saying the author name is required but in the edit window, the text for the whole page is loaded so when she does save it correctly she duplicates the whole page in the place just that section should be. I'm running a huge wiki for a University MBA program and I don't want to remove either the Edit Section functionality or the Require Author functionality. Do I assume correctly, that you mean the RequireAuthor setting in the config? What do you do exactly? "Save" or "Save and Edit" ? Please provide an exact procedure how to reproduce this problem, as it works here on my local installation. Do you use the latest version? - Klonk October 09, 2006, at 03:48 PM
sectionedit ate my form!I believe that I've found a bug in sectionedit (v2.1.3 - 2006-09-22) The following markup and template should produce a list of radio buttons - one for each group - and a button; all within a form, naturally. Page markup: (:pagelist fmt=#grpradio:) some more text Local template !!!fmt=#grpradio
list of all the group names
[[#grpradio]]
(:if equal {<$Group} :)
(:input form "{$PageUrl}":)
(:if ! equal {<$Group} {=$Group} :)
* (:input radio n {=$Group}:) {=$Group}
(:if equal {>$Group} :)
(:input submit value="Try It":)
(:input end:)
(:if:)
[[#grpradioend]]
However, with sectionedit.php active, the <form> is absent from the HTML. With sectionedit.php: <div class='vspace'></div><div class='fpltemplate'></div> <p class='vspace'>some more text </p> </div> Without sectionedit.php: <div class='vspace'></div><div class='fpltemplate'> <form action='http://niff/~admin/pmwiki/index.php?n=Site.LocalTemplates(approve links)' method='post'> <ul><li><input type='radio' name='n' value='Main' /> Main </li><li><input type='radio' name='n' value='PmWiki' /> <span class='wikiword'>PmWiki</span> </li><li><input type='radio' name='n' value='Site' /> Site </li></ul><p><input type='submit' value='Try It' class='inputbutton' /> </p></form> </div> <p class='vspace'>some more text </p> </div> To further test this, I installed a new version of PmWiki, with only the necessary changes to run the above test and the problem remained. One more thing: the <form> displays correctly when previewing the edit Marc November 22, 2006, at 07:36 AM Is there an opposite directive to
|