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
Comment #1
fgmHere are the answers to your questions:
hook_form_alterto trap the submission form and compute a teaser fromthe definition if the field used for the teaser is empty
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 aforeachloop 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 ?
Comment #2
pathscollide commentedThanks 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.
Comment #3
fgmThanks 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 ?Comment #4
fgmFixed the docs at http://wiki.audean.com/g2/howto to explain about teasers.
Comment #5
(not verified) commented