2012-04-19, 02:55:33
alienee2 Wrote:Re: i18n Search Results - "Raw" output
...
In order to get the markup to output correctly, i need to have the 'raw' output of the i18n search results for the special pages; i was able to do it fine, by removing lines 63, 67, 105 and 110, from i18n_search/searchresults.php; [those are the lines that output the containing list elements (ul, li, /li, /ul)]
But i am wondering if there is a better way to do this, maybe using a function in the theme folder...?
Or, if there were an additional parameter in the i18n search results code, likewhich would by default be off, and you could have the results display without the containing list elements, by specifying this parameter; so this wouldn't affect anyone unless they specifically had a need for it...Code:... 'rawOuput'=>1
...
That's an interesting idea, but there are some problems, e.g.:
- Special Pages intentionally only replaces the content of the <li>, as it must also display in a default search over the whole site, where special pages would be mixed with other special page types and standard pages, which do not have a special render "component"
In most cases I'd say you should be able to render a <ul> exactly as you want, if the page content is contained in a div with the page slug as id or class.
But there might be cases where this is not enough, so I would rather suggest a parameter tagClasses=1 which would add all tags of an indexed item (page) prefixed with tag- as classes into the <li>. This way you could format your search items with CSS depending on the tags (e.g. colorize all items with li.tag-important) or special page types (e.g. li.tag-_special_news for news).