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
--
DavidWolfe - 07 May 2008
Answer
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
--
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