]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/bugs/misctemplate_does_not_respect_the_current_page___40__if_any__41__.mdwn
Fix display of sidebar when previewing page edit. (Thanks, privat)
[ikiwiki.git] / doc / bugs / misctemplate_does_not_respect_the_current_page___40__if_any__41__.mdwn
index 58cf9d737a1f1454c968b392c6b7e5b602a5e80e..f1e4649ff4fccffabf5b61d50513bb4127ff18c5 100644 (file)
@@ -18,6 +18,12 @@ But it causes some nasty bugs for plugins that use the pagetemplate hook. It is
 * -> Problem: 404, the browser goes to "/bar/foo" 
 * -> Was expected: the browser goes to "/foo"
 
+> You must have a locally modified `page.tmpl` that omits the "TMPL_IF DYNAMIC"
+> that adds a `<base>` tag. That is needed to make all links displayed by
+> cgis work reliably. Not just in this page editing case.
+> The [[version_3.20100515]] announcment mentions that you need to
+> update old `page.tmpl` files to include that on upgrade. --[[Joey]]
+
 ### A second example
 
 * create "/bar/sidebar.mdwn" with "world"
@@ -28,6 +34,11 @@ But it causes some nasty bugs for plugins that use the pagetemplate hook. It is
 * -> Problem: the sidebar now shows the foo link (it is the root sidebar!)
 * -> Was expecte : the sidebar displays "world"
 
+> I think it's a misconception to think that the page editing page is the same
+> as the page it's editing. If you were deleting that page, would you expect
+> the "are you sure" confirmation page to display the page's sidebar?
+> --[[Joey]]
+
 ### A last example
 
 * with the web browser edit the page "bar"
@@ -36,6 +47,13 @@ But it causes some nasty bugs for plugins that use the pagetemplate hook. It is
 * -> Problem: the sidebar still displays the foo link
 * -> Was expected: the sidebar display "goodby"
 
+> In the specific case of previewing, it is indeed a bug that the
+> right sidebar is not displayed. And replacing the regular sidebar 
+> with the one from the previewed page is probably the best we can do..
+> displaying 2 sidebars would be confusing, and the `page.tmpl` can
+> put the sidebar anywhere so we can't just display the preview sidebar
+> next to the rest of the page preview. --[[Joey]]
+
 ## Some superficial hacking
 
 With the following workaround hacks, I manage to solve the 3 examples shown above:
@@ -47,4 +65,10 @@ With the following workaround hacks, I manage to solve the 3 examples shown abov
 <pre>my %params=@_;
 shift->(page => $params{page}, destpage => $params{destpage}, template => $template);</pre>
 
-I do not guarantee (I do not even expect) that it is the proper way to solve this bug but it may help developers to find and solve the real problem. 
+I do not guarantee (I do not even expect) that it is the proper way to solve
+this bug but it may help developers to find and solve the real problem. 
+
+> Oh, it's pretty reasonable. I don't think it breaks anything. :)
+> I modified it a bit, and explicitly made it *not* "fix" the second example.
+> [[done]]
+> --[[Joey]]