00658: Extra <dt> tag in searchresults output

Summary: Extra <dt> tag in searchresults output
Created: 2006-02-01 19:18
Status: Open
Category: Bug
From: DaveG
Assigned:
Priority: 25
Version: 2.1 beta22
OS:

Description: The searchresults output has changed a little from b13. Each line item now has an empty <dt> tag:

    <dt> </dt><dd><a class='wikilink' href='<url>'><desc]</a></dd>

Whereas previously only the groups lines on the results page had the <dt> tag. This causes a problem where users have updated wikitext.dt CSS tag to include specific styling, as there is now no difference between pages and groups on search results.


I reversed the order of my additions to this page so the newest ones are now at the top. --Hagan


The following could be made possible if an (:options:) markup were to become available.

The CSS selectors:

$HTMLStylesFmt['defaultpagelist'] = '
  .defaultpagelist ul { padding-left:0px; list-style:none; }
  .defaultpagelist ul ul { padding-left:40px; } ';

The template block:

[[#default]] (:options class=defaultpagelist:)
(:if ! equal {=$Group} {<$Group}:)

*[[{=$Group}]] /%%
(:if:)
**[[{=$Group}/{=$Name}]]%%
[[#defaultend]]

--Hagan


Waylan has suggested #3 below without the division, since the div wouldn't (or perhaps shouldn't) be necessary.

[[#default]]
(:if ! equal {=$Group} {<$Group}:)

*%block list-style=none%[[{=$Group}]] /%%
(:if:)
**%block list-style=none%[[{=$Group}/{=$Name}]]%%
[[#defaultend]]

He adds

I noticed that the result is wrapped in
   <div class='fpltemplate'>

Any easy way to change that class in the markup? That would provide
for some easy styling hooks. One thing I like about nested lists is
the ease of styling each level - eliminating the need for the div
Hagan suggested.

The CSS would then look something like this:

   MyClass ul {...}

   MyClass ul li {...}

   MyClass ul ul {...}

which would eliminate the need for the %block list-style=none% in the markup.

So I guess it would be

[[#default]]
(:if ! equal {=$Group} {<$Group}:)

*[[{=$Group}]] /%%
(:if:)
**[[{=$Group}/{=$Name}]]%%
[[#defaultend]]

See the Test.PageListTemplates Waylan created for testing.

Hagan


The first page link for each group is preceded by an extra empty <dd> </dd> (empty definition-list definition) as well. Removing all of the empty definition-list-terms and definition-list-definitions doesn't appear to affect the appearance of the list.

Is this a case where the presentation effect is favored over document semantics (similar to using headings for font effects)? There are many examples of "termless definitions" used for indenting on pmwiki.org.

Put another way: The list of search results really is an unordered list, isn't it?

Hagan


On further inspection, the "termless definitions" appear to be a semantic kludge to achieve a presentation effect. (Or am I missing something?)

The following default renders the same as the beta22 default (in the default skin and LeanSkin) except it's an unordered list, not a definition list with missing terms and definitions.

[[#default]]
(:if ! equal {=$Group} {<$Group}:)

[[{=$Group}]] /
(:if:)
*%block list-style=none%[[{=$Group}/{=$Name}]]%%
[[#defaultend]]

Better yet might be to

[[#default]]
(:if ! equal {=$Group} {<$Group}:)

>>searchresults<<
[[{=$Group}]] /
(:if:)
*%block list-style=none%[[{=$Group}/{=$Name}]]%%
[[#defaultend]]
>><<

or

[[#default]]
(:if ! equal {=$Group} {<$Group}:)

>>searchresults<<
*%block list-style=none%[[{=$Group}]] /
(:if:)
**%block list-style=none%[[{=$Group}/{=$Name}]]%%
[[#defaultend]]
>><<

with appropriate CSS selectors in the stylesheet.

Hagan