![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
![[site community profile]](https://www.dreamwidth.org/img/comm_staff.png)
Keywords are not listed separately for styling the icons page in S2
Title:
Keywords are not listed separately for styling the icons page in S2
Area:
styles
Summary:
In the S2 code for the IconsPage, there is an array of icons which contains the user's icons (as Icon objects) listed in the order specified. Each Icon object has an array containing the icon's keywords. When the IconsPage's sort order is the order in which the icons were uploaded, each Icon object has exactly one element in that array no matter how many keywords the icon has, and that one element contains all of the icon's keywords concatenated together.
Instead of this, the array should have one element per keyword, with each element containing one keyword.
Description:
The IconsPage styling was implemented last year (http://dw-styles.dreamwidth.org/18631.html) but it hasn't been used much; all of the system styles are still using the old icons page.
Here is the code from the core2 which concerns itself with the icon keywords:
if ($.keywords) { """<div class="keywords">"""; var int keyword_count = 0; print safe "<span class='label'>$*text_icons_keywords</span> "; """<ul>"""; foreach var string kw ($.keywords) { $keyword_count++; """<li>"""; print safe $kw; if ($keyword_count < size $.keywords) { print $*text_icons_keyword_sep; } """</li>"""; } """</ul></div>"""; }
This, to me, pretty strongly implies that the keywords array was intended at some point to hold multiple elements which should be looped through in order to display each keyword separately. There's a string to hold the separator between the elements and everything! I would like it to hold each keyword in a separate element here, when the icons have multiple keywords to be displayed; I think it makes a lot more sense than forcing a comma concatenation in a one-element array.
(Side note: when the sort order is by keyword, the icons appear multiple times in the $.icons array, each time with just the applicable keyword in their $.keywords array, which seems fine to me. I am not suggesting changing the behavior for the keyword-sorted icons.)
This suggestion:
Should be implemented as-is.
9 (22.5%)
Should be implemented with changes. (please comment)
0 (0.0%)
Shouldn't be implemented.
0 (0.0%)
(I have no opinion)
31 (77.5%)
(Other: please comment)
0 (0.0%)
Edited to fix formatting