Tags:
create new tag
view all tags

Question

We have many topics that are glossary entries, and a Glossary topic that compiles them all together using a search. Is it possible to construct the SEARCH so that the results are styled?

Here is our SEARCH as currently implemented:

%SEARCH{ "__Back to\:__ GlossaryPublishingTerms" scope="text" regex="on" nosearch="on" nototal="on" excludetopic="%TOPIC%" header="" format="   $ $pattern(.*?Term\:[\n\r]*([^\n\r]+).*): $pattern(.*?Definition\:[\n\r]*([^\n\r]+).*)" }%

The SEARCH finds all of the glossary entries, then displays each on the page--with the Term on one line, and the Definition indented under it.

What we REALLY want is for either the Term and Definition to be formatted as a Definition List or for them to appear as they currently do, but with the Term in bold. I haven't been able to figure out how to do either.

As a side note, I've wanted for a long time for the Definition List's term to appear in bold. I haven't found where this is defined to be able to change it.

Thanks for your help.

Environment

TWiki version: TWikiRelease04x02x00
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Mac OS X 10.5
Web server: Apache 2.2
Perl version:  
Client OS: Mac OS X 10.5
Web Browser: Safari, Firefox
Categories: Search

-- DavidWolfe - 07 May 2008

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

You can define your own style for 'dt' tags. Or, if you don't mind modifying the delivered content (assuming you are using PatternSkin), edit the file \TWiki\pub\TWiki\PatternSkin\style.css and change this ...

strong, b {
   font-weight:bold;
}
... to this ...
strong, b, dt {
   font-weight:bold;
}

Of course if you modify the delivered content, that change will be lost next time you do an upgrade. So make a note of it smile

-- SeanCMorgan - 07 May 2008

Adding to Sean's suggestion, you can generate HTML with your search. Here is an example:

<dl>
%SEARCH{ ... format="<dt>$pattern(...)</dt><dd>$pattern(...)</dd>" }%
</dl>

You can style the definition list as needed.

PS: For an easy to query glossary, consider TWikiForms based application.

-- PeterThoeny - 08 May 2008

Thank you for your help. I'll try it out.

How might a TWikiForms application work? Or, work differently from how we currently do it? What we've done is used a setup like the FAQ on TWiki.org. We put a "Back to: . . . " line in each topic, then perform a search for that.

-- DavidWolfe - 08 May 2008

That worked beautifully! Thank you. I only had to stop and restart the webserver for the CSS change to become apparent.

-- DavidWolfe - 08 May 2008

Change status to:
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2008-05-16 - DavidWolfe
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.