Since the last release of my WordPress plugin Splashscreen version 0.20, there’s been many requests for new features. You may also want to read the original post for version 0.10 for completeness. One of the most requested feature was to allow search engine bots to get the blog content so they can traverse the website properly.
Ask and ye shall receive… version 0.30 of the plugin, that is.
To control the new feature, I’ve added some new options in the settings as shown below:
When this option is enabled, the splash screen will be an overlay on top of the content of your blog page. In other words, your blog will still be there, but the splash screen will be on top of your page. This way, the search engine bot can still “see” your blog, even though your visitors cannot while the splash screen covers the contents.
If you turn this option off, you will get the non-overlay version of the splash screen which will NOT have your blog contents “under” the splash screen. I kept this feature in the plugin for backward compatibility for people who are using it right now.
The new overlay splash screen is made up of a background and a dialog-type box with links, as shown below.
Normally, you would want the background to be opaque (cannot see-through) so this option should be enabled. However, for some bloggers, you may want to have the background transparent so that you can see a little of what is on your blog. Of course, this would not be a good idea for “adult” websites, but for people using this plugin for non-adult websites and wanting to force the users to agree to your “terms of service,” you might want to tease them with a preview of your blog.
Overlay Background Color:
This is the color of the background using normal CSS specifications (e.g. #000000, rgb(0,0,0), black). If you don’t know what CSS colors are, see this article.
The rest of the options are the same as in version 0.20. However, if you are using the new “overlay” feature, you must use a new template. The default overlay template is called “splash-overlay.htm” as shown below:
Changing the template:
Be very careful about what you change in the template. My recommendation is to copy it to a new filename (e.g. mytemplate.htm) then start editing it. Do NOT change the original template because if you break it, you may not be able to get back to a working version.
- The first item of interest in the template is near the top and is highlighted in green. If your website re-directs www.mywebsite.com to mywebsite.com, you will want to change the line to:
setCookie("splash", "1", "", "/", ".yourdomainname.com");
Notice that you must have the dot (“.”) before your domain name.
- Next, the blue highlighted item is the WordPress logo that appears in the overlay dialog box. You can replace it with your own logo and enter the name there. Place your logo file inside the subdirectory “images” inside the splashscreen directory. If you don’t want any image, remove the entire “img” HTML.
- Finally, replace the yellow highlighted area with your own terms of service or whatever you want to display in the dialog box.
If you want to get fancy, you could change the size and look of the dialog box itself. This is left as an exercise for the student. One thing to keep in mind is that you need to center the dialog box properly.
Free Cool Feature:
While working on the new version of this plugin, I realized that if the underlining website is vertically long, the user could scroll down the page and not be able to see the dialog box. This can also happen if the URL is using a bookmark down the page (e.g. pointing to a comment near the bottom of the page). At first, I tried forcing the page to automatically scroll up to the top. After a lot of work, I got this to work but when the overlay goes away, you are looking at the top of the page instead of what you wanted to see.
You can see the new version of the plugin in action at alexisbreeze.com. This website is “adult” so don’t say I didn’t warn you.
Until I get this up on the WordPress plugin page, you can download version 0.30 here. [See below for new updated version]
I took some code out of the template and created version 0.31. This should make modification of the template a little easier.
A helpful commenter told me that the templates were missing a closing /FORM, which have been added in version 0.40.
Yet another commenter has found that the adult template was not updated for this new version. This has been corrected and can be downloaded in version 0.41.
If you are trying to get this plugin with work with WP -SuperCache, checkout this fix at technicalnotebook.com.
Basically, all you have to do is add this code before the </body> tag:
<?php define ("DONOTCACHEPAGE",1); ?>