Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
evandixon Posted December 13, 2019 Posted December 13, 2019 I have a \IPS\Content\Item class that implements \IPS\Content\Searchable. I've successfully gotten it to display arbitrary content in the search snippet in expanded view: I have not, however, succeeded in getting anything in condensed view. Other content items have a "user posted a ___ in ___", but mine shows nothing: When I look at the other applications shown in this picture, this isn't stored in the snippet template. As far as I can tell, something's displaying the language item "x_created_(class)" or "x_created_(class)_in" here, but I don't know how to tell the system to do so for my content item. Simply making sure those language items exist isn't enough, and based on other parts of the site, I'd expect to see the placeholder if it was. Does anyone know what I need to do for this specific behavior? In case it's relevant, my content class does not have a container. Occasionally this results a quirk I can work around, and I don't know if this is another one.
evandixon Posted December 29, 2019 Author Posted December 29, 2019 Found the issue. \IPS\Content::searchResultSummaryLanguage is what adds that text, and the core system template "searchResult" only displays that if there's a container. So I need a container. After doing the bare minimum to get containers implemented, rebuilding the search index because the lack of containers was cached, and after fixing some undefined language stuff, it works:
Recommended Posts
Archived
This topic is now archived and is closed to further replies.