Re: [greenstone-users] Browsing classifier buttons

From richrobinson@gtcinternet.com
DateThu, 11 Nov 2004 13:45:47 -0600
Subject Re: [greenstone-users] Browsing classifier buttons
Michael,

Tried your method below. It works beautifully -- except when I'm browsing in
the classifier after which the break tag is placed (in this case,
Organization)! Then it refuses to break.

My coding in extra.dm is as follows, with your original response at the end -

_imageTitle_
{_gsimage_(_httpbrowseTitle_,_httpiconttitleof_,_httpiconttitleon_,titles,_textimageTitle_)}
_imageCreator_
{_gsimage_(_httpbrowseCreator_,_httpicontcreatof_,_httpicontcreaton_,creators,_textimageCreator_)}
_imagePeople_
{_gsimage_(_httpbrowsePeople_,_httpicontpeopof_,_httpicontpeopon_,people,_textimagePeople_)}
_imageOrganization_
{_gsimage_(_httpbrowseOrganization_,_httpicontorgof_,_httpicontorgon_,org,_textimageOrganization_)<br/>}
_imageDate_
{_gsimage_(_httpbrowseDate_,_httpicontdateof_,_httpicontdateon_,dates,_textimageDate_)}
_imageSubject_
{_gsimage_(_httpbrowseSubject_,_httpicontsubjof_,_httpicontsubjon_,subjects,_textimageSubject_)}
_imageLanguage_
{_gsimage_(_httpbrowseLanguage_,_httpicontlangof_,_httpicontlangon_,language,_textimageLanguage_)}
_imageFormat_
{_gsimage_(_httpbrowseFormat_,_httpicontformof_,_httpicontformon_,formats,_textimageFormat_)}


Hi Rich,

It isn't elegant in the slightest, but it can be done. It isn't easy because the
navigation bar is created dynamically in the C++ code (and there are reasons for
this).

You'll need to make a "macros" directory in your collection, then copy the
"extra.dm" file from the main "macros" directory into it. This allows you to
define macros that are collection-specific.

Next, decide where you want the split (let's say between Title and Source).
Then,
copy the _imageXXX_ macros from the base.dm macrofile into your extra.dm:

_imageTitle_
{_gsimage_(_httpbrowseTitle_,_httpiconttitleof_,_httpiconttitleon_,titles,_textimageTitle_)}

_imageSource_
{_gsimage_(_httpbrowseSource_,_httpicontsrcof_,_httpicontsrcon_,source,_textimageSource_)}

To put the split in, add a "<br/>" at the end of the _imageTitle_ macro:

_imageTitle_
{_gsimage_(_httpbrowseTitle_,_httpiconttitleof_,_httpiconttitleon_,titles,_textimageTitle_)<br/>}

If you try this you'll find that you get the spacer image on the next line,
which
looks funny. Get rid of it by commenting it out -- ie. adding "<!--" at the end
of
_imageTitle_ and "-->" at the start of the _imageSource_:

_imageTitle_
{_gsimage_(_httpbrowseTitle_,_httpiconttitleof_,_httpiconttitleon_,titles,_textimageTitle_)<br/><!--}

_imageSource_
{-->_gsimage_(_httpbrowseSource_,_httpicontsrcof_,_httpicontsrcon_,source,_textimageSource_)}

You're best off doing this when you've got an even number of buttons on the bar,
otherwise it will be unbalanced (this is getting worse by the minute!). You'll
probably also find that the two halves are too short now that they are split,
but
you can fix this by overriding the "_imagespacer_" macro to be the length you
need.

There are a couple more things you can do to the navigation bar without editing
code. If you want a pull-down list instead of a navigation bar (see the authen-e
collection) you can use

format NavigationBar "pulldown"

Or, you can change what appears between the buttons (to stack them vertically,
for
example) by overriding the "_imagespacer_" macro (see the garish collection).

Regards,

Michael

richrobinson@gtcinternet.com wrote:

> Hello all,
>
> If I have many browsing classifier buttons (Titles a-z, Authors a-z, Subject,
> and so on), is there a way to split them over two lines so they don't all
crowd
> one another?
>
> Rich
>