Forum Discussion
luk
8 years agoBoss
I think you could do it with a little JavaScript, conceptually:
- Each search result has a page link where it leads to the topic, the URL of the link contains the board id, which you probably can use to distinguish between external and internal TKB?
- If so, you can loop trough all search results, check the page-link for each result and add a CSS class in the appropriate place to target the :before element (that is the icon)
something like this (entirely untested) could do it:
jQuery('.lia-message-subject-wrapper .page-link').each(function() {
var $link = jQuery(this);
// for internal links
if ( $link.is('[href*="<your.internal.tkb.board.id>"]') ) {
$link
.parents('.lia-quilt-message-search-item')
.find('.lia-component-discussion-style-icon .lia-fa-icon')
.addClass('is--internal');
}
// for external links, of course handling one type of links is enough,
// you just style one differently (most likely) and leave to other one alone, your choice!
if ( $link.is('[href*="<your.external.tkb.board.id>"]') ) {
$link
.parents('.lia-quilt-message-search-item')
.find('.lia-component-discussion-style-icon .lia-fa-icon')
.addClass('is--external');
}
// now you need to add CSS styles accordingly to change the color of your icon, e.g. this would do it
/*
.SearchPage .lia-fa-icon.is--internal:before {
color: red;
}
.SearchPage .lia-fa-icon.is--external:before {
color: green;
}
*/
});does that work for you?