Skip to content

Instantly share code, notes, and snippets.

@philcon93
Last active February 2, 2017 22:54
Show Gist options
  • Save philcon93/d13d327474b1660e4323f84686c7c537 to your computer and use it in GitHub Desktop.
Save philcon93/d13d327474b1660e4323f84686c7c537 to your computer and use it in GitHub Desktop.

Calins Search

<div class="page-title row row-verticalcenter">
<div class="col-xs-12">
<section class="page-search">
<form class="search-wrapper">
<i class="icon-search"></i>
<input type="text" id="search" name="page-search" style="width: 100%;" class="search-lg clearable" required="" placeholder="Enter keyword to search for a page 🔥">
</form>
</section>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="nComplexTable">
<div id="results" class="nComplexTable-row">
[%CONTENT_MENU type:'rambrand' sortby:'sortorder' show_empty:'1'%]
[%PARAM *level_1%]
<div class="col-xs-12"><h5>[@name@]</h5>
<hr>
[%IF [@NEXT_LEVEL@]%]
<ul class="article_index">[@next_level@]</ul>
[%/IF%]
</div>
[%/ PARAM%]
[%PARAM *level_2%]
<li><a href="[@url@]" target="_blank">[@name@]</a></li>
[%/ PARAM%]
[%/ CONTENT_MENU%]
</div>
</div>
</div>
</div>
<script>
jQuery.expr[':'].Contains = function(a, i, m) {
return jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase()) >= 0;
};
$('#search').keyup(function() {
var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase();
$("#results li,#results div").hide();
$("#results li:Contains('"+val+"'),#results div:Contains('"+val+"')").show();
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment