As G2 Glossary apparently doesn't include by default a page that would list all terms in the glossary, I am trying to construct one using Views. I've created a Table View that contains the fields Node:Title and Node:Body (Teaser). The idea would be to have a list of terms and a teaser view of the definition, with a "Read more" link.

However, for some reason the teaser wasn't displaying. So I went and looked at the database, and it seems that none of the G2 nodes have teasers! So now I'm wondering:

  • Why is this?
  • Is this normal?
  • How do I change this so I get teasers on my G2 entries?

Comments

fgm’s picture

Here are the answers to your questions:

  1. this is because you didn't input teasers.
  2. Yes. By design, G2 doesn't auto-fill teasers: these are taken from the "Entry expansion (for acronyms) or translation:" field, instead of being generated from the definition field
  3. Several suggestions:
    1. input them :-) Seriously, if your are doing a glossary, you'll probably find it useful to have two levels of definition, a short one in the teaser field, and the standard definition in the node body. This is especially true for glossaries, maybe more so than for usual dictionaries (remember it's called G2 Glossary for a reason)
    2. use hook_form_alter to trap the submission form and compute a teaser from
      the definition if the field used for the teaser is empty
    3. create a patch to G2 that defines an additional setting for such teaser generation (disabled by default) : this could become a useful feature for non-glossary dictionaries

BTW, the fact that G2 does not supply a full list of the nodes is actually a feature, to avoid overloading the server with huge lists (G2 is geared toward larger glossaries). If you want such a list, you can invoke _g2_initial($initial) in a foreach loop on initials, or even just _g2_initial(NULL) for the whole list.

Have you looked at the doc on http://wiki.audean.com/g2/featureset ?

pathscollide’s picture

Thanks very much for your comprehensive response and for the work you're doing on this module. I did look through the (useful) G2 documentation wiki, but didn't see anything indicating that the "Entry expansion (for acronyms) or translation" field was used as a teaser (you have to admit, it isn't obvious).

Points 2 and 3 are interesting but beyond my current technical capacities (and those of most users, I would imagine). Regarding the last point, would it not be possible to include the option of displaying a paged list of glossary entries (and thus not have to retrieve the whole glossary at once?) I think that would be easier for the less technically-able webmaster than figuring out how to theme a view. Of course, it would also be less flexible than using a view.

In any case though my glossary is not "huge," I decided to use G2 because its features are so much better (for my purposes) than those of glossary.module. So thanks for that.

fgm’s picture

Thanks for your comment regarding the module doc. Since it is on a wiki, I suggest you register on it and update the doc :-) Seriously, I think you're right and the doc needs to include this information. It is obvious from the module code, but I keep forgetting not all webmasters read a module's code before installing it.

Regarding the paged list you mention, I'm not sure how it could be made useful: there are already pages for each initial at <g2 base>/initial/<initial>, and an alphabar to display the list of initials. How would this differ ?

fgm’s picture

Status: Active » Fixed

Fixed the docs at http://wiki.audean.com/g2/howto to explain about teasers.

Anonymous’s picture

Status: Fixed » Closed (fixed)