We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You need to opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
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 have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list 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:
Topic revision: r5 - 16 May 2008 - 00:32:59 - DavidWolfe
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback