Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted March 12, 20222 yr I am trying to generate a shorter preview text for a Commerce package in a plugin template, but I can’t figure it out. Doing a strip_tags on $item->description has no effect, since the product description is a translatable item. And $item->truncated(), which I see being used in some theme templates doesn’t seem to work from the plugin. (Call to undefined method IPS\nexus\Package\Product::truncated()) Anyone got any ideas?
March 12, 20222 yr You could try: $desc = \IPS\Member::loggedIn()->language()->get("nexus_package_{$item->id}_desc"); strip_tags($desc); substr($desc,0,1024); etc
March 12, 20222 yr Probably $item->description() or ->content() will do it. Not tested. Edited March 12, 20222 yr by Adriano Faria