Custom Footer in Backlight

Custom footer via phplugins

This is a fairly straightforward use of phplugins but it requires some html to provide the structure for the footer as well as some custom css to style the social media icons. These icons are links to my social media sites, but you can just as easily use code for social sharing.

For the html, I’m using the TTG Responsive Grid to layout the text. It has the added benefit of being responsive and works very well on mobile devices.

One not so obvious thing that will also need to be done is to disable the bottom pallet. In your Backlight page template, go to Footer. Turn off the Bottom Pallet/Copyright.

Turn off Bottom Pallet

Note: if copying any of the code below, be sure to paste it into a plain text editor.

Instructions for Backlight 1 Okapi

Instructions for Backlight 1 Pangolin

Instructions for Backlight 2/3/4

For Backlight 1

Here’s the code I used in my Backlight 1 phplugins file. The html for the footer was taken directly from my Backlight 1.1.1 site (Okapi). I simply viewed the page source code and copied it. No coding magic here on my part, this is all Matt’s. I then needed to write some css to style things a bit. Be sure to use your own urls and your own beginning date for the copyright. If you’re not yet familiar with using phplugins, see the documentation here for Backlight 1. To implement custom css, see the documentation here.

NOTE: the html in this phplugins code is for Backlight 1 Okapi (pre-Backlight 1.2). See below for Backlight 1 Pangolin html code. For the Backlight 2 phplugins function, see the end of the post.

//Footer replacement

function ttg_footer_top( $style, $path) {

echo '
<div class="grid_12" id= "footer">

<div class= "col_8">
<p>All content &copy;1992-' . date("Y") . ' Your Name, all rights reserved.
</br>Powered by <a href="http://theturninggate.net">The Turning Gate</a>
</div>

 

<div class="social-media-profiles social-media col_4">

<ul class="clearfix">
<li class="social-bg rss"><a href="http://www.yoursite.com/blog/rss/" onclick="window.open(this.href); return false;" title="RSS"><i class="fa fa-rss" aria-hidden="true"></i></a></li>
<li class="social-bg instagram"><a href="https://www.instagram.com/your-profile/" onclick="window.open(this.href); return false;" title="Instagram"><i class="fa fa-instagram" aria-hidden="true"></i></a></li>
<li class="social-bg facebook"><a href="http://www.facebook.com/your-profile" onclick="window.open(this.href); return false;" title="Facebook"><i class="fa fa-facebook" aria-hidden="true"></i></a></li>
<li class="social-bg twitter"><a href="http://twitter.com/your-profile" onclick="window.open(this.href); return false;" title="Twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a></li>

</ul>

</div> <!-- #social-media-profiles -->

</div>
';
return false;
}



// END

And here’s the css I’m using to style the footer. Adjust colors, margins, and padding to your own needs:

/*Custom footer
==============================================*/
footer {
background-color: white;
border-top: 1px solid black;

}

.social-media-profiles ul {
float: right;
margin: 1.5rem auto;
max-width: 157px;
padding: 0;
position: relative;
}

.social-media-profiles ul li {
float: left;
list-style-type: none;
margin: 0 2px 4px;
padding: 0 4px
}

li.social-bg {
background-color: #008000;
border-radius: 5px;
}

li.social-bg a {
color: white;
}

li.social-bg a:hover {
text-decoration: none;
}

@media screen and ( max-width: 1023px ) {
#footer {
padding: 0 4px;
}
#footer p {
text-align: center;
}
.social-media-profiles ul {
float: none;
}
}

The css above gives all the social media icons the same colors. If you wish them to have individual background colors, for example, just remove the rule that controls the icon background-color and replace it with rules addressing the classes of each icon.

li.social-bg {
border-radius: 5px;
}
li.social-bg a {
color: white;
}

li.social-bg facebook{
background-color: #0000FF;
}

li.social-bg twitter {
background-color: #FDFFF4;
}


etc.....

You can do something similar for the icons themselves by individualizing the rules governing color.

Same thing, only with Pangolin code

NOTE For Backlight 2/3/4 users: the phplugins code posted above is for Backlight 1.

If you’re using Backlight 2, 3 or 4, make sure you’re starting with the phplugins-pangolin-sample.php file found in the /backlight/custom/phplugins/ folder (Backlight 2 and 3). For Backlight 4, get the file from /backlight/modules/custom-resources/phplugins/ and make this change in the code posted above:

In the first line, instead of using:

function ttg_footer_top ($style, $path) {

Use:

function footer_top () {

I’ll post the entire function, including the html, at the end of this post.

Here’s the Pangolin html for the phplugins file. Be sure you customize it with your specific url and/or profiles:

<div class="grid_12" id= "footer">

<div class= "col_8">
<p>All content &copy;1992-' . date("Y") . ' Your Name, all rights reserved.
</br>Powered by <a href="http://theturninggate.net">The Turning Gate</a>
</div>

<div class="social-media-profiles social-media col_4">
<ul>
<li><a target="_blank" href="http://www.yoursite.com/blog/rss/" class="social_media fa fa-rss"></a></li>
<li><a target="_blank" href="https://www.instagram.com/your-profile/" class="social_media fa fa-instagram"></a></li>
<li><a target="_blank" href="https://www.facebook.com/your-profile/" class="social_media fa fa-facebook"></a></li>
<li><a target="_blank" href="https://twitter.com/your-profile" class="social_media fa fa-twitter"></a></li>
</ul>

</div> <!-- #social-media-profiles -->

</div>

And here’s the Pangolin custom css:

/*Custom footer with Pangolin social media code*/

footer {
background-color: white;
border-top: 1px solid black;

}

.social-media-profiles ul {
float: right;
margin: 0 auto 1.5rem;
max-width: 157px;
padding: 0;
position: relative;
}

.social-media-profiles ul li {
float: left;
list-style-type: none;
margin: 0 4px 4px;
padding: 0 4px;
background-color: #008000;
border-radius: 6px
}

.social-media-profiles a.social_media {
text-decoration: none;
color: white
}

#footer {
	padding: 12px 0;
}

@media screen and ( max-width: 1023px ) {
#footer {
padding: 0 4px 12px;

}
#footer p {
text-align: center;
}
.social-media-profiles ul {
float: none;
}
}

Adjust any widths, colors, etc. to your own needs.


Backlight 2/3/4

Again, if you’re using Backlight 2/3/4, make sure you’re starting with the phplugins-pangolin-sample.php file.

In Backlight 2 and 3, this file is found in the /backlight/custom/phplugins/ folder.

For Backlight 4, get the file from /backlight/modules/custom-resources/phplugins/.

Make this change in the code posted above:

In the first line, instead of using:

function ttg_footer_top ($style, $path) {

Use:

function footer_top () {

Below is entire phplugins function for Backlight 2 users. See documentation for phplugins in Backlight 2/3/4  here. The css above can be used. Be sure you customize it with your specific url and/or profiles.

And a final note for Backlight 3/4 users. Backlight 3/4 uses Font Awesome 5. The code included here uses the syntax for Font Awesome 4 and will not work correctly in Backlight 3. You have two options. You can go to the Font Awesome site to see and implement the version 5 syntax or, and the easiest option, visit your Backlight page template and under Advanced Setup, scroll down to the bottom under Iconography and enable the Font Awesome 4 shim.

//Footer replacement

function footer_top() {

	echo '
		<div class="grid_12" id= "footer">

			<div class= "col_8">
			<p>All content &copy;1992-' . date("Y") . ' Your Name, all rights reserved.
			</br>Powered by <a href="http://theturninggate.net">The Turning Gate</a>
			</div>

			<div class="social-media-profiles social-media col_4">
			<ul>
			<li><a target="_blank" href="http://www.yoursite.com/blog/rss/" class="social_media fa fa-rss"></a></li>
			<li><a target="_blank" href="https://www.instagram.com/your-profile/" class="social_media fa fa-instagram"></a></li>
			<li><a target="_blank" href="https://www.facebook.com/your-profile/" class="social_media fa fa-facebook"></a></li>
			<li><a target="_blank" href="https://twitter.com/your-profile" class="social_media fa fa-twitter"></a></li>
			</ul>

			</div> <!-- #social-media-profiles -->

		</div>
	';
return false;
}	

5 thoughts on “Custom Footer in Backlight”

    1. Note that the social media profile code was taken from Backlight 1.1.1. I’ll probably be modifying this post with code that uses the new Pangolin-based code. I won’t remove the current code shown, but add the alternate code.
      ….and done! Pangolin code included at the end of original post.

  1. Hello Rod,
    I am looking for a way to have two Copyright notices, one in English and the other in French, controlled by the language selector switch in Backlight.
    Do you think I could use/adapt the code supplied here?

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