Template talk:Reflection2

From WikiEducator
Jump to: navigation, search

An attempt at a Reflection Template that is similar to eXe's Reflection template. I seems to be defaulting to the Expand mode which is not what I want. Kruhly 05:03, 3 March 2007 (CET)

The template works properly (ie the answer is hidden) when called from another page. Kruhly 05:08, 3 March 2007 (CET)

Added a header variable called header. If header == 1, then the template uses <h1 ...> Reflection</h1> else the template uses <h2 ...>Reflection</h2>. Need to look into a switch statement to see what different levels work. Also could look into comparing to strings like section, subsection, subsubsection instead of numbers. The template looks like the eXe template but it is not very elegant.

Kruhly 06:36, 6 March 2007 (CET)

Changed the #ifeq: statement to a #switch: statement so we have control over 3 levels in the TOC for the template. Using "=" did not seem to work in the #switch: statement so I stayed with numbers for the arguments (See usage on Template:Reflection2). Kruhly 07:06, 17 March 2007 (CET)

Changed the default to 0 -- not in TOC. This template is similar to Template:Activity. -- Kruhly 22:36, 17 March 2007 (CET)

Syntax with the header inside the decoration was causing the edit buttons to get confused. Moved the #switch statement outside the decoration, and made the header visibility=hidden so that it only shows up in the TOC not above the decoration. Note: The carriage return after the <h1 ...> is crucial for this template to work properly. If "Reflection" is placed on the same line as <h1 ...> the TOC gets two entries and an edit link appears in the decoration. The edit does not work and can cause the user to lose changes. -- Kruhly 07:08, 19 March 2007 (CET)

Even the syntax with the #switch outside the decoration causes the righthand section edit links to get confused. This is documented at Help:Section#Editing_sections_of_included_templates. To help reduce the risk of lost data, __NOEDITSECTION__ has been added to the cases, header = {1,2,3} so that section editing is not available. Limited testing on User:Kruhly/Sandbox has shown that this works for the time being (ie the original behavior still exists for header=0, and header = {1,2,3} lists the template in the TOC). It would be nice to figure out a way around this limitation so that section editing could be available for all cases. -- Kruhly 20:41, 19 March 2007 (CET)
Made the TOC part of the template a new template called Template:PutInTOC. It takes arguments of Depth={0,1,2,3,4,5,6} and can generally be used in other pedagogical templates. The same is invoked because of the confusing behavior of the section [edit] links. Kruhly 04:00, 25 March 2007 (CEST)
There are no threads on this page yet.