Jump to content

Search the Community

Showing results for tags 'search'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General Discussion
    • Announcements
    • Business Discussion
    • Business Services
    • Sell and Buy
  • Themes & templates
    • KVS default theme
    • KVS paysite theme
  • Educational / support
    • Technical Support
    • FAQ
    • Educational Series

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me

Found 3 results

  1. List of search queries is displayed by search_results block. Here is how you can put it into the main pages: {{insert name="getBlock" block_id="search_results" block_name="Similar Searches"}} Put it into Index and Common Videos List (renders categories, tags, models, content sources and etc.) page templates. After you add this block into page template and save, it will appear in the list of blocks on this page and you can edit its settings. Here is template code for this block that will render cloud of search queries: {{if count($data)>0}} <div class="box search-cloud"> {{foreach item="item" from=$data}} {{assign var="query" value=$item.query|replace:"-":"[dash]"|replace:"&":"%26"|replace:"?":"%3F"|replace:"/":"%2F"|replace:" ":"-"|replace:"[dash]":"--"|rawurlencode}} <a href="{{$lang.urls.search_query|replace:"%QUERY%":$query}}" style="{{if $item.is_bold==1}}font-weight: bold; {{/if}}{{if $item.size>0}}font-size: {{$item.size}}px;{{/if}}">{{$item.query}}</a> &nbsp;&nbsp;&nbsp; {{/foreach}} </div> {{/if}} In block parameters configure: items_per_page: the number of queries you want to be displayed. sort_by: sorting of the queries. var_category_dir = category var_tag_dir = tag size_from = 12 size_to = 16 Also make sure you put a cache time of 86400, as this block will be quite heavy. When this is configured, you can see query cloud is displayed on Index and other video pages. For tag and category pages it should be relevant to the displayed tag / category. On other pages it may render the same set of queries, as they won't have context object that can be used to display similar queries.
  2. In the new theme version we decided to add vanilla support for search suggestions. It can work in 2 modes: similar search mode, when suggestions are search queries that your other users submitted (default), and content mode, when search suggestions are grouped from models, videos and albums. Here are screenshots that show the difference: While this feature will be added into the upcoming new theme version, theme updates are never available for old projects and thus we decided to make this update available for everyone. Please go to Website UI -> Theme settings. If it says KVS Default (7.6) or above, then you don't need to do anything and this functionality is already included in your theme. Just scroll down theme settings to see this option: IMPORTANT. This functionality may heavily increase your database and overall server load. How to add search suggestions into older themes You can add this functionality to KVS default theme and to any other theme that uses jquery (all paid KVS themes are built using jquery). There is only one thing that may need to be adjusted if your theme is not KVS default theme, we will indicate that later. Step 1. Download this archive and unpack on top of your project FTP: https://kernel-scripts.com/updates/search_suggestions.zip This archive will create a new page named Search Suggestions. If you open this page in Website UI -> Pages section of your admin panel, in most cases it will be highlighted with orange color that indicates lack of filesystem permissions for editing this page settings in admin panel. This is OK in most cases, but if you want to adjust its options, for example suggestions sorting, you will have to set filesystem permissions for the files and directories mentioned in error details (666 for all files, 777 for all directories). Step 2. Update your theme CSS file with the following new styles: White skin (in KVS default theme you should update /static/styles/all-responsive-white.css file on FTP): .autocomplete-suggestions { border: 1px solid #999; background: #fff; overflow: auto; margin: 0 -60px 0 13px; } .autocomplete-suggestion { padding: 2px 5px; white-space: nowrap; overflow: hidden; cursor: pointer; } .autocomplete-selected { background: #f0f0f0; } .autocomplete-suggestions strong { font-weight: normal; color: #276fdb; border-bottom: 1px solid #276fdb; } .autocomplete-group { padding: 5px; font-weight: bold;} .autocomplete-group strong { display: block; } Dark skin (in KVS default theme you should update /static/styles/all-responsive-metal.css file on FTP): .autocomplete-suggestions { border: 1px solid #1b1b1b; background: #000; overflow: auto; margin: 0 -60px 0 13px; } .autocomplete-suggestion { padding: 2px 5px; white-space: nowrap; overflow: hidden; cursor: pointer; } .autocomplete-selected { background: #151515; } .autocomplete-suggestions strong { font-weight: normal; color: #276fdb; border-bottom: 1px solid #276fdb; } .autocomplete-group { padding: 5px; font-weight: bold;} .autocomplete-group strong { display: block; } You may need to adjust these styles later for better matching your site colors. But initially you can adjust #276fdb color, which refers to light blue highlight color on the above screenshots. Step 3. Go to Website UI -> Language files -> default and add the following texts at the end: urls.search_suggestions = /search_suggestions.php search_suggestions.similar_videos = Videos search_suggestions.similar_albums = Albums search_suggestions.similar_models = Models search_suggestions.type = searches The last option may be set to one of these values: searches (similar search mode) and mixed (content mode). Step 4. Go to Website UI -> Page Components -> include_footer_general.tpl and add the following code right before the closing </body> tag: <script src="{{$config.statics_url}}/static/js/jquery.autocomplete.min.js"></script> <script> {{if $lang.search_suggestions.type!='none' && $lang.urls.search_suggestions}} $('#search_form input[type="text"]').autocomplete({ minChars: 3, deferRequestBy: 100, serviceUrl: '{{$lang.urls.search_suggestions}}', {{if $lang.search_suggestions.type=='mixed'}}groupBy: 'type',{{/if}} paramName: 'q', onSelect: function(suggestion) { if (suggestion && suggestion.data && suggestion.data.url) { window.location = suggestion.data.url; } } }); {{/if}} </script> NOTE: if you theme is not KVS default theme, then you may need to change this selector to match your theme search input: #search_form input[type="text"] Step 5. If you need adjustments and customizations, you may want to check with plugin official documentation. Suggestions are configured to be max 20 per group and their sorting is set to popularity (most popular first). If you want to adjust these parameters, just go to Website UI -> Pages -> Search Suggestions for the needed controls.
  3. General sitemap structure in KVS KVS renders sitemap dynamically as a typical web page configured to produce XML format instead of HTML. You can find sitemap page in Website UI -> Pages -> [system] Sitemap: Due to specific sitemap structure limitations on the number of links, KVS breaks down sitemap into several sitemap indexes, rendering different entities: Videos Albums Playlists Tags Models Categories Sponsors Channels Sitemap indexes that can potentially generate more than 50k links are additionally broken down into paginated sitemaps. That's why sitemap page renders 2 blocks for some object types (videos, albums, playlists, models, tags): one block is for listing all pages (e.g. Sitemaps Videos), another block is for listing all objects per page (e.g. Links to Videos). For categories, sponsors and channels KVS considers that their amount is small, so they are rendered as single lists. Adding search queries into sitemap Since the number of search queries is potentially unlimited, you should consider adding them as 2 blocks similar to models. 1) Open Sitemap page for editing and add the following 2 blocks into it: {{insert name="getBlock" block_id="search_results" block_name="Sitemaps Search Queries"}} {{elseif $smarty.request.type=='search'}} {{insert name="getBlock" block_id="search_results" block_name="Links To Search Queries"}} Here are the highlighted locations where to add these blocks as their position is quite important: 2) Save page editor. After saving you can see that 2 new blocks were added to page structure with default settings: 3) Open Sitemaps Search Queries block for editing. Set its template to the following code: {{section start=1 loop=$nav.page_total+1 name=pages}} <sitemap> <loc>{{$lang.urls.sitemap}}?type=search&amp;from_links_search={{$smarty.section.pages.index}}</loc> <lastmod>{{$smarty.now|date_format:"%Y-%m-%d"}}</lastmod> </sitemap> {{/section}} Set Cache lifetime (s) to 86400. Set the following parameter values: items_per_page = 500 var_from = from_sitemaps_search sort_by = Query text Desc Save this block editor. 4) Open Links To Search Queries block for editing. Set its template to the following code: <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> {{foreach item=item from=$data}} {{assign var="query" value=$item.query|replace:"-":"[dash]"|replace:"&":"%26"|replace:"?":"%3F"|replace:"/":"%2F"|replace:" ":"-"|replace:"[dash]":"--"|rawurlencode}} <url> <loc>{{$lang.urls.search_query|replace:"%QUERY%":$query}}</loc> <lastmod>{{$smarty.now|date_format:"%Y-%m-%d"}}</lastmod> <changefreq>weekly</changefreq> <priority>0.6</priority> </url> {{/foreach}} </urlset> Set Cache lifetime (s) to 86400. Set the following parameter values: items_per_page = 500 var_from = from_links_search sort_by = Query text Desc Save this block editor. 5) Now you should have a fully working search sitemap inside your main sitemap index. Try opening your sitemap and look for "search" keyword: http://domain.com/sitemap.php If your database has search queries, you should see something like this in your sitemap: http://domain.com/sitemap/?type=search&from_links_search=1 http://domain.com/sitemap/?type=search&from_links_search=2 ....
×
×
  • Create New...