Add a company logo to the view above K2 Smartforms’ Tab feature

by | Feb 16, 2015 | BlogPosts, Tech Tips | 2 comments

Here’s a simple tip for a question I get asked on a regular basis by clients from all industries… How to edit a K2 Smartforms project so that the company logo appears in the banner view above the tab feature. Therefore making sure that the relevant branding doesn’t appear below the tabs, plus how to ensure that this view didn’t have to be inserted on every page individually.

Here’s an example in Image 1 using the Datalytyx logo, where you can see that the branding logo – embedded in as a banner in a view – appears below ‘Tab 1’ and ‘Tab 2’:

2015.02.16 - Blog - ScreenCap1

There is a neat little trick that pushes the banner above the tabs, which means you only have one instance of the view on your form.  You do this by inserting a snippet of jQuery into a literal control. Firstly, you want to create a data label and associate it with an expression. In your expression, insert the following snippet (see Image 2):

<script> $(“.tab-box.tabs-top”).prepend($(“.view:first”)); </script>

2015.02.16 - Blog - ScreenCap 2

The result will be that the banner sits in a view above the tabs, as demonstrated in Image 3:

2015.02.16 - Blog - ScreenCap 3

This will appear automatically on every tab. Similarly, with the following snippet, you can add a footer which sits below the main body of the form so it is persistent regardless of which tab you are viewing

<script>

$(“.tab-box.tabs-top”).append($(“.view:last”));

</script>

Image 4 displays the resultant footer:

2015.02.16 - Blog - ScreenCap 4

2 Comments

  1. Hi,
    This is just what I’ve been looking for. However I have 2 Header views & 2 footer views, that I’d like to sit outside the Tabs, is this possible please?
    Cheers,
    Ian

    Reply
  2. There is a reason for tabs to be dealt with as control.

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *