featdd / dpn_glossary

Glossary extension for TYPO3
http://typo3.org/extensions/repository/view/dpn_glossary
GNU General Public License v2.0
20 stars 30 forks source link

Possible typolink fallback for tooltiptext to first description text if empty #209

Closed jramke closed 9 months ago

jramke commented 9 months ago

Hey,

first of all, thanks for this aweseome extension.

For my usecase, I thought about having a fallback for the tooltiptext field to the first text entry of the descriptions field would be nice. Unfortunately i currently couldnt make it work with the getText function. I tried something like that:

{field:descriptions|0|text}
{field:descriptions|text}

Maybe you got a quick and simple idea, if not im just going to override the tca because i dont really need multiple descriptions and just use the tooltiptext for the main text.

Thanks :wave:

featdd commented 9 months ago

Hi @jramke,

I just had tried if this is even possible with TypoScript and it is, like this: {field:descriptions|0|meaning}

The problem is that the parserterm currently doesn't contain the descriptions in the data array provided to the content object renderer... This was made for performance reasons because normally the objects for the parser should'nt have to load all data like the media and so on. I'll have to take a look how to make this configurable properly, I will let you know if theres a solution for this.

Greetings Daniel

featdd commented 9 months ago

Hi @jramke,

I think I implemented a solution for this here: 6d64054407ea24aae49b51fc48c4f3ec36c0362f, maybe you can give me some feedback before I merge this. Just select the other repository in the constant editor and the descriptions will be available, you could even register your own repository and do even further custom stuff now.

Greetings and merry christmas Daniel

jramke commented 9 months ago

Hi @featdd,

wow, thanks for the quick answers and implementation. Unfortunately I won't be able to give you real feedback until the new year. I'll get in touch again then.

Happy holidays! Joost

jramke commented 9 months ago

hey @featdd,

just had time to check the new feature and it works great. Thanks for that.

But as you mentioned, there is a performance drawback when using the full Term model. So i used a custom model wich extends the ParserTerm model with just the needed descriptions.

I think thats a great feature for integrators. Looking forward to the release.

Thanks!

featdd commented 9 months ago

Hi @jramke,

thanks for the feedback, I will release it with the next update.

Greetings Daniel