g2:howto
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| g2:howto [2006/01/14 23:41] – how do I know the current version fgm | g2:howto [2020/11/23 17:23] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | Back to [[g2: | ||
| + | ====== 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" | ||
| + | |||
| + | 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 ? ===== | ||
| + | |||
| + | ==== Context ==== | ||
| + | |||
| + | The predefined alphabar block provides a standard form alphabar, listing all initials in the alphabar setting with a link to the page for each initial. The block configuration page allows setting of both the alphabar and line-length wrapping. | ||
| + | |||
| + | However I does not allow for bar where, for instance, some initials would be merged (like grouping the numbers together under "#", | ||
| + | |||
| + | ==== Solution ==== | ||
| + | |||
| + | The quick fix is not to use the predefined block, but to create a custom block using the function supplying the predefined block with data: _g2_alphabar(), | ||
| + | |||
| + | Creating a merged initial (like # for numbers) is probably best done by creating a link to a page of your own, possibly a page or story node, on which you'll query G2 to return the entries of your choice. | ||
| + | |||
| + | A better approach is available if you're writing a specific theme for a site : your job is to write the < | ||
| + | |||
| + | ===== How do I create a constant text linking to a random definition ? ===== | ||
| + | |||
| + | ==== Context ==== | ||
| + | |||
| + | The predefined " | ||
| + | |||
| + | However, for some layouts, one can wish to have the blocks not display the entry, but a link with a constant text like " | ||
| + | |||
| + | ==== Solution ==== | ||
| + | |||
| + | 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(), | ||
| + | |||
| + | |||
| + | ===== How do I know which revision of G2 my site is using ? ===== | ||
| + | |||
| + | * This is available in admin/ | ||
| + | |||
| + | ===== 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 " | ||
