User Tools

Site Tools


g2:howto

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
g2:howto [2005/12/29 22:44] – Custom alphabar using theme fgmg2:howto [2020/11/23 17:23] (current) – external edit 127.0.0.1
Line 2: Line 2:
  
 ====== G2 HOWTO. Or "How do I ..." ====== ====== G2 HOWTO. Or "How do I ..." ======
 +
 +===== How do I obtain teasers ? =====
 +
 +Also: "all my teasers are empty. What is happening ?".
 +
 +G2 by default does not create teasers from the body of the definitions (node body): it uses the "Entry expansion or translation" field, which can very well be empty for glossaries containing a mix of acronyms (with expansions) and normal terms (without expansions).
 +
 +So, there are two main possibilities if you want to have teasers on all G2 definition nodes:
 +
 +  * create the teasers in that field yourself. This is the normal solution for this module
 +  * use hook_form_alter to auto-generate a teaser from the body, typically using node_teaser()
 +
 ===== How do I create an alphabar unlike the predefined block ? ===== ===== How do I create an alphabar unlike the predefined block ? =====
 +
 ==== Context ==== ==== Context ====
  
Line 8: Line 21:
  
 However I does not allow for bar where, for instance, some initials would be merged (like grouping the numbers together under "#", for instance). However I does not allow for bar where, for instance, some initials would be merged (like grouping the numbers together under "#", for instance).
- 
- 
- 
  
 ==== Solution ==== ==== Solution ====
Line 32: Line 42:
 The trick is not to use the predefined block, but to create a custom block using the function supplying the predefined block with data: _g2_random(), which returns data for a pseudo-random entry. With the result of this function, it is possible to create the link you want and format it just as you wish. The trick is not to use the predefined block, but to create a custom block using the function supplying the predefined block with data: _g2_random(), which returns data for a pseudo-random entry. With the result of this function, it is possible to create the link you want and format it just as you wish.
  
 +
 +===== How do I know which revision of G2 my site is using ? =====
 +
 +  * This is available in admin/settings/g2, at the bottom of the page: the whole CVS $Id$ variable is provided for your information
 +
 +===== How do I add a complete definition to my front page  ? =====
 +
 +==== Context ====
 +
 +The idea here is to enliven a home page with some reading taken from a G2 glossary, in addition to the manually edited home page.
 +
 +==== Solution ====
 +
 +This is simple: just chose the block you'll be using: WOTD or random, set it to display as long a body as you wish, and position it in the "content" placement, instead of the sidebars, header or footer. Then set the block for display only at a specific URL, and make that URL be the one you're using for your front page, typically front_page.
g2/howto.1135896284.txt.gz · Last modified: 2020/11/23 17:23 (external edit)