Two ways of adding a graphic logo to the Backlight Top Pallet

Sample page using image logo in the Top Pallet

If you’re using the Top Pallet in your page template for your site title masthead but instead of a text title you want an image logo, this post is for you.

First, be sure to set up your page template to use the Top Pallet Title and disable the Primary Masthead.


In the Top Pallet tab of your page template set “Has Height” settings to “On.” You may want/need to adjust Padding-left. Depending on your preferred design, you may also need to enable Strict Width Enforcement setting.

Both methods below use phplugins and custom css. Neither has any particular advantage as far as I know and both methods have the same end result.

Image logo directly placed in the top pallet using the pallet_top_title phplugins hook

In this case, the image used needs to be 48px tall to match the height of the top pallet.

A little custom css was also needed to remove margin from a list item.
In this case, the phplugins code is replacing the default TTG code, using an image rather than text.

Here’s the phplugins code:

function pallet_top_title() { 
  echo '

  <li><a href="http://yoursite.com"><img src="https://yoursite.com/path-to-image.png"/></a></li>

  ';
  return false;
} // END

Of course, use the url to your own image. See a sample page here.
The code also links the image logo to your home page. If you would rather it didn’t, then remove the anchor element by removing <a href=”http://yoursite.com”> and </a>.
Here’s the custom css:

.page__pallet__top > .content > ul > li {
    margin: 0;  
}

Insert logo as a background image with custom css

With this method, the phplugins code replaces the default TTG code with a list item that has a custom class “top-pallet-logo.” A background image will be applied to the class using custom css.

The phplugins code:

function pallet_top_title () { 
  echo '

  <li class="top-pallet-logo"><a href="/"></a></li>

  ';
  return false;
}

This will replace the default TTG code for the top pallet title area. It includes a link to the home page. If you’d rather not have the image linked to the home page, then remove: <a href=”/”></a>

And the custom css:

/*Top pallet title logo via background image */

 .page__pallet__top > .content > ul > li {
    margin: 0;
    height: 48px;
}

/*logo as background image*/

.top-pallet-logo {
    background-image: url("https://yoursite.com/path-to-image.png");
    background-repeat: no-repeat;
    width: 192px;
    height: 48px;
}
li.top-pallet-logo a {
    display: block;
    width: 100%;
    height: 100%;
    }

Adjust top pallet height as necessary to accommodate the size of logo you want.
And here’s a sample page that places the Top Pallet title logo as a background image using css.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About this site

This site is: a repository of time-savers and best practices from a user's perspective, picked up from several years of using TTG plugins.
This site is not: a support site.
Read more here.

Subscribe to new posts

Tip Jar

If this site has saved you some time, kept your hair attached, or otherwise prevented you from tossing the mouse through the monitor, feel free to donate.

Categories


Highly recommended. This is my go-to Lightroom book. Click on the book image. (affiliate link)

Affiliate link!

Current TTG versions

Backlight  4 & 5

See the Backlight Modules page on your site for latest Backlight and module versions and changelogs.

You’ll also find the latest version number and download link for the Lightroom Publisher plugin.
(BL 3 and later)

 

Backlight 1 Versions

Backlight 1.2.4
Pages module 1.2.4
Cart Add-on 4.1.7
Client Response Add-on 7.1.3
Theater Add-on 1.2.6
Galleria Add-on 1.0.0
WordPress Add-on 1.2.6
Publisher 3.2.3

Backlight 1 has seen its end of life. See this post.

CE4 Versions

note: CE4 is no longer being developed or sold. See this post.

TTG-BE: 2.0.5a
Autoindex: 7.0.8
Cart: 3.1.4a
CRG: 6.1.3a
Gallery: 6.1.10
Pages: 7.0.15
Publisher: 2.3.3
Stage: 6.1.6
Theme for WordPress: 3.1.2