Template talk:Auto images
Width Problem
There's a width mismatch between two consecutive auto images, with the second one's cont parameter set as "yes". here is an example. Windroff (talk) 20:20, 18 August 2013 (UTC)
- Good catch! It seems to arise when there are a different number of images in each row. I'm not yet sure whether it's a rounding issue, in which case it is likely to be difficult or impossible to fix because of the limitations of the template language or whether there's a logic error in the width calculations. I'm investigating. Peter coxhead (talk) 21:50, 18 August 2013 (UTC)
- I've implemented a fix, which seems to work on all the cases I've tested. I'm never sure if there are any browser-specific features in the display of images in this way, so please let me know if you see any consecutive sets which don't line up properly. Peter coxhead (talk) 22:56, 18 August 2013 (UTC)
- By the way, it can't be guaranteed to work within 1 pixel either way because of inevitable rounding errors – each row of auto images does the calculations independently so may not come up with exactly the same total width allowing for rounding. Peter coxhead (talk) 22:59, 18 August 2013 (UTC)
- Thank you very much. It works with all combinations I tested so far. Windroff (talk) 23:11, 18 August 2013 (UTC)
Caption alignment
I added a parameter to the template sandbox to set caption text alignment. You can see comparative results in the testcases page. It saves quite a lot of typing for transclusions with many images. Windroff (talk) 21:48, 7 April 2014 (UTC)
- Seems a very good idea. I'll move the change to the real template. Peter coxhead (talk) 10:04, 8 April 2014 (UTC)
- Thank you. I changed the parameter name to the respective HTML property name, because it sets alignment for the footer in addition to image captions, and it's more intuitive this way. Windroff (talk) 15:02, 8 April 2014 (UTC)
- Ok, I like brevity myself but it's perhaps clearer now. Peter coxhead (talk) 21:09, 8 April 2014 (UTC)
- Thank you. I changed the parameter name to the respective HTML property name, because it sets alignment for the footer in addition to image captions, and it's more intuitive this way. Windroff (talk) 15:02, 8 April 2014 (UTC)
Float
I added a parameter to the template sandbox to float the template. You can see comparative results in the testcases page. It should not interfere with existing transclusions that use the div enclosure workaround. Windroff (talk) 21:48, 7 April 2014 (UTC)
- @Windroff: what is the difference between
|align=
and|float=
? seems confusing to have both? If the intent is to wrap text as well, then we should add a|clear=
option? Frietjes (talk) 01:58, 10 April 2014 (UTC)
- @Frietjes: The goal is to let text wrap around the table without having to do it with HTML.
|align=
was already there and it may be in use in several transclusions; it moves the table to the requested side and sets the opposite margin so there can be no text wrapping.|float=
acts like the CSS float property (wrapping text around)- To avoid confusion the template could be changed so if
|float=
is set (e.g. to "yes") the table would float to the side set by|align=
, leaving the usual no-wrap behavior when unset. Windroff (talk) 05:12, 10 April 2014 (UTC)- personally, I would like to see
|align=
and|float=
do the exact same thing, if both parameters are available, and have an option for|clear=none
to avoid text-wrapping, but text-wrapping would be the default. with only 202 transclusions, we can just check all the uses and fix them to make sure there are no actual changes in the layout. Frietjes (talk) 18:37, 10 April 2014 (UTC)- okay, I added float, with possible values of 'left', 'right', 'center', and 'none', and a tracking category for align. if float is not set to one of these four values, then the template should function the same as before. but, this should allow us to get rid of the div hacks in the articles, as well as most clear hacks. the old
|align=left
should be essentially equivalent to the new|float=none
(just like images with none). I will wait for the tracking category to populate, then check the transclusions that use align. Frietjes (talk) 19:30, 10 April 2014 (UTC)- @Frietjes: Thanks. Perhaps "none" should have a more descriptive alias ("clear_left" ? ) and another choice ("clear_right" ? ) should be added for automatic inclusion of the {{clear right}} template. Windroff (talk) 21:09, 11 April 2014 (UTC)
- @Windroff: just matching the syntax of {{multiple image}} and standard picture syntax, which seems like a good idea if editors already know standard picture syntax? however, I have no problem with adding more options for
|align=
and/or|float=
. the whole {{clear right}}/{{clear left}} template thing is confusing since you probably just want to clear both. Frietjes (talk) 21:17, 11 April 2014 (UTC) - by the way, I didn't find any usage of the non-wrapping text feature with align right in the articles that I checked, so it seems like it's not going to be needed much in practice. Frietjes (talk) 21:23, 11 April 2014 (UTC)
- I just added two explicit nowrap options to the aux template sandbox. Could {{clear left}} be replaced by margin:auto or is it really needed? Windroff (talk) 21:39, 11 April 2014 (UTC)
- looks good. as far as I can tell, left, right, center, and none cover all the existing usage, but I may have missed one. aligning right with no text wrapped seems very rare, if not entirely not needed. Frietjes (talk) 16:54, 12 April 2014 (UTC)
- I merged the changes, adding "right_nowrap" only for the sake of completeness. I also updated the documentation, removing the "embedding text" section because it's the default behavior now. Windroff (talk) 22:08, 12 April 2014 (UTC)
- looks good. as far as I can tell, left, right, center, and none cover all the existing usage, but I may have missed one. aligning right with no text wrapped seems very rare, if not entirely not needed. Frietjes (talk) 16:54, 12 April 2014 (UTC)
- I just added two explicit nowrap options to the aux template sandbox. Could {{clear left}} be replaced by margin:auto or is it really needed? Windroff (talk) 21:39, 11 April 2014 (UTC)
- @Windroff: just matching the syntax of {{multiple image}} and standard picture syntax, which seems like a good idea if editors already know standard picture syntax? however, I have no problem with adding more options for
- @Frietjes: Thanks. Perhaps "none" should have a more descriptive alias ("clear_left" ? ) and another choice ("clear_right" ? ) should be added for automatic inclusion of the {{clear right}} template. Windroff (talk) 21:09, 11 April 2014 (UTC)
- okay, I added float, with possible values of 'left', 'right', 'center', and 'none', and a tracking category for align. if float is not set to one of these four values, then the template should function the same as before. but, this should allow us to get rid of the div hacks in the articles, as well as most clear hacks. the old
- personally, I would like to see
Layout
I modified the table's layout to make it look more like {{Multiple image}} and plain images, and to let each row of pictures seamlessly merge with the previous one. Changes are in the template sandbox. You can see comparative results in the testcases page. Windroff (talk) 06:16, 17 April 2014 (UTC)
- To clarify, so far as I can see, this change is solely to the numbers in the calculation of ht. I can only say that I arrived at the original numbers by a lot of trial and error, including viewing on different browsers and different operating systems. For example, the values I used at first, which worked under Firefox under Mac OS X (my normal combination), did not work for IE under Windows 7. I'm certainly not saying that other values such as yours won't work, but I would urge great caution in changing these values until you have checked complex layouts with as wide a range of browsers as possible. There are significant differences in the way in which browsers handle some kinds of layout. Peter coxhead (talk) 08:45, 17 April 2014 (UTC)
- While there's a rationale behind the change of numbers, I see no improvement over the originals in the cases I tested so far. As for the layout changes, they are here {{Auto images/aux/sandbox}}. Windroff (talk) 20:57, 17 April 2014 (UTC)
- I'm not quite sure what you're saying about the version you left in the sandbox. Are you saying that as a whole it isn't an improvement over the originals? It would be useful to see a page with complex sets of images laid out using the current template version and the sandbox version. Then we need to check them with different browsers and operating systems. When I was developing this template, I found that apparently small or even irrelevant changes altered appearance on some systems. Peter coxhead (talk) 09:08, 18 April 2014 (UTC)
- I mean that your original numbers also work well for the modified template in aux/sandbox, so I restored them (although because these numbers are bigger, the table gets slightly reduced due to ht being smaller) Update: I set the padding numbers to "4" (2 to the left, 2 to the right) to fix a width mismatch between rows with different number of images (testcases "Complex 2" and "Complex 3")
- Please have a look here. There are several examples using both the current template and the sandbox versions, including a quite complex case at the end. More should be added to compare the final appearances. Windroff (talk) 21:24, 18 April 2014 (UTC)
- The narrower margin version at Template:Auto images/testcases#Float left doesn't work in Safari, Firefox or Chrome under Mac OS X 10.9. Instead of "Echinopsis candicans" over two lines, I see "Echinops candican", with only part of the following "i" and "s". So the wider margins seem to be necessary. The problem only occurs with italic caption text, so far as I can see: this is slanted to the right, and so goes beyond the right bounds of the image above. (It probably depends on the font used as well.)
- Which browsers and platforms have you checked? Peter coxhead (talk) 08:58, 21 April 2014 (UTC)