December 13, 2019 in Developer Connection
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.
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:
This topic is now archived and is closed to further replies.
Started 1 hour ago
Started 2 hours ago
Happy go Lucky
Started 3 hours ago