Jump to content

Theme customization: creating sections with featured videos on index or other page


Tech Support
 Share

Recommended Posts

There are multiple ways you can do that in KVS. The proposed best way for most users is to use admin flags to set up featured videos section. This approach can be used not only for featured videos / albums, but also for creating other similar sections when you need to manually select content that should appear in them: preview gallery on index page, contests, featured content and similar.

First you need to go to Categorization -> Flags and create a new flag under videos group. You can set any title / external ID, title is only used in admin panel for you, while external ID will be used to refer to this flag when configuring list_videos block to filter only videos with such flag. Here is what we've entered:

  • Title: Featured video
  • External ID: flag_featured_video
  • Admin panel: enable Use this flag as administrator's flag for content

flag_settings.thumb.png.b94110c100490303362a6c0aa1b71e79.png

Now you can go to individual videos and set this flag in Administrator's flag field. All videos you apply to this flag will be subjects to display in featured block on your site:

video_admin_flag.png.1709dfeeb4ec429c67520ff7e6dd20d5.png

Finally you need to show them on index page (or other page if you need so).

In order to do that go to Website UI -> Pages -> Index page and add list_videos block into desired place of template where you want to display featured videos:

{{insert name="getBlock" block_id="list_videos" block_name="Featured Videos"}}

After you save page changes, KVS will create a new block on this page named "Featured Videos". You can now edit settings of this block by clicking on block name in pages list:

index_featured_videos.png.beb893267d77db420cce9e58a342aee4.png

You should set up block template and configuration parameters. You can use the following block template, which will render list of videos in most KVS themes without any issue:

<div id="{{$block_uid}}">
	{{assign var="list_videos_title" value="Featured Videos"}}
	{{include file="include_list_videos_block_common.tpl"}}
  
  	{{assign var="pagination_no_links" value="videos"}}
	{{include file="include_pagination_block_common.tpl"}}
</div>

For parameters you should use:

  • items_per_page: set the number of featured videos you want to display, e.g. 12
  • show_with_admin_flag: here is where you configure this block to filter only videos marked with Featured flag, set flag_featured_video here to refer the flag ID you've created for this
  • sort_by: select sorting you need

index_featured_videos_params.png.236bf039ef7fe5c1cf9f2fa5b4beb953.png

Make sure you also set cache lifetime in this block settings. If content of this block is not changed often, set it to 86400 seconds, which means 24 hours.

After you save this block settings you should be able to see featured videos block on your page with the videos you selected by using admin flag.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...