en:user:berry_baskets
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
en:user:berry_baskets [2019/10/02 01:39] – [Metadata] kjdon | en:user:berry_baskets [2019/10/02 02:18] – [Using dc.Title instead of Title in Berry Basket display] kjdon | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Berry Baskets (Greenstone 3) ====== | + | ====== |
- | A berry basket functionality has been implemented in Greenstone 3. This allows the user to collect up a set of interesting | + | A favourites/berry basket functionality has been implemented in Greenstone 3. This allows the user to collect up a set of interesting |
- | ===== Activating Berry Baskets ===== | + | Favourites - a star is displayed for each document in browsing and searching lists. Clicking the star will add/remove that document from the favourites list. |
- | The library administrator can enable the Berry Basket functionality | + | Berry Baskets - little berries are displayed |
- | The user can turn on this feature in the Preferences | + | The basket itself is displayed |
+ | |||
+ | ===== Activating Favourites/ | ||
+ | |||
+ | By default, Favourites | ||
+ | |||
+ | The library administrator | ||
+ | < | ||
+ | < | ||
+ | <option name=" | ||
+ | <option name=" | ||
+ | </ | ||
+ | </ | ||
+ | Set both to false to disable this completely. | ||
+ | |||
+ | While the functionality is active, it is not turned on for the user by default. (It will be for 3.10 and later). The user can go to Preferences, | ||
+ | |||
+ | To make it turned on by default, set a paramDefault in web/ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
===== Customizing Berry Baskets ===== | ===== Customizing Berry Baskets ===== | ||
Line 30: | Line 52: | ||
If you want to customise the display, take a look at the javascript code. web/ | If you want to customise the display, take a look at the javascript code. web/ | ||
- | === Using dc.Title instead of Title in Berry Basket display === | + | === Example: |
By default, the berry basket entries display Title metadata. If the linked item is a section, it will also display the book Title (root_Title). | By default, the berry basket entries display Title metadata. If the linked item is a section, it will also display the book Title (root_Title). | ||
Line 36: | Line 58: | ||
If we have a collection that doesn' | If we have a collection that doesn' | ||
- | 1. Edit web/ | + | 1. Edit web/ |
< | < | ||
< | < | ||
Line 68: | Line 90: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | This will now display dc.Title instead of Title for the title link to the document in the full view. | ||
+ | However, as dc.Title is not defined as one of the standard metadatas, it also gets added to the end of the display. To prevent this, either add it to the default_metas list at the top of the file, or modify generateDocDisplay further. | ||
+ | < | ||
+ | Replace: | ||
+ | for (var metaItem in doc) { | ||
+ | if ( !default_metas.includes(metaItem)){ | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | |||
+ | with: | ||
+ | for (var metaItem in doc) { | ||
+ | if ( !default_metas.includes(metaItem) && metaItem != ' | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | In the text and email view, all metadata is displayed in a list: First the hard-wired ones, then any that are not in the default list. So the dc.Title metadata just gets added to the list. If you added dc.Title to default_metas list as mentioned above, then you need to manually add it to the display to get it to appear. | ||
+ | |||
+ | For example, in populateUrlsAndMetadata(), | ||
+ | < | ||
+ | if (doc[' | ||
+ | metadata += " | ||
+ | } | ||
+ | </ | ||
+ | |||
en/user/berry_baskets.txt · Last modified: 2023/07/24 01:44 by kjdon