Mother will hate this post.
Note: The code on this page is a vastly improved reading experience at this link.
Last year, for the first time, I created a Season's Greetings banner that popped up (using MediaboxAdv) when you first hit my blog. This year, when I went to operationalize that same code, things were not very straight forward. This post is to remind me next year how to do this—sort of a note to me in the future.
WordPress Site
Under the wordpress —> wp-content —> themes folder on the server, select the current theme and modify the header.php file within that folder. Immediately after the HTML header tag closes, this code should appear:
<!-- Mandate that the #mb-announcement mediabox open when this page is first hit or refreshed by the user -->
<!-- <body onload="Mediabox.open('URL_GOES_HERE', 'TITLE_GOES_HERE', 'WIDTH HEIGHT')"> -->
<!-- When NOT mandating the #mb-announcement, comment out the next line of code. -->
<body onload="Mediabox.open('http://blog.timtyson.us/wordpress/wp-content/uploads/2010/12/HolidayGreeting.jpg', 'Happy Holidays', '480 520')">
<!-- When NOT mandating the #mb-announcement, uncomment out the next line of code. -->
<!-- <body> -->
Normally, without the forced load of the mediabox announcement, the code would read like this:
<!-- Mandate that the #mb-announcement mediabox open when this page is first hit or refreshed by the user -->
<!-- <body onload="Mediabox.open('URL_GOES_HERE', 'TITLE_GOES_HERE', 'WIDTH HEIGHT')"> -->
<!-- When mandating the #mb-announcement, uncomment out the next line of code. -->
<!-- body onload="Mediabox.open('http://blog.timtyson.us/wordpress/wp-content/uploads/2010/12/HolidayGreeting.jpg', 'Happy Holidays', '480 520')">
< !-- When mandating the #mb-announcement, comment out the next line of code. -->
<body>
This single change in code will impact the loading of both the main index page as well as individual page archives.
MovableType Site
To accomplish the same thing, MovableType requires two file alterations: one for the index page and one for individual page archives.
For the main index page:
Under the template-link-files —> my-template-link-files on the server, modify the Index.html file within that folder. Immediately after the HTML header tag closes, this code should appear:
<!-- Mandate that the #mb-announcement mediabox open when this page is first hit or refreshed by the user -->
<!-- <body id="mt-blog" class="mt-main-index layout-wm" onload="Mediabox.open('URL_GOES_HERE', 'TITLE_GOES_HERE', 'WIDTH HEIGHT')"> -->
< !-- the body id above is the result of using the <$mt:BlogTemplateSetID$> variable for the boy id as shown below. When NOT mandating the #mb-announcement, comment out the next line of code. -->
<body id="<$mt:BlogTemplateSetID$>" class="mt-entry-archive <$mt:Var name="page_layout"$>" onload="Mediabox.open('http://blog.timtyson.us/wordpress/wp-content/uploads/2010/12/HolidayGreeting.jpg', 'Happy Holidays', '480 520')">
<!-- When NOT mandating the #mb-announcement, uncomment out the next line of code. -->
<!-- <body id="<$mt:BlogTemplateSetID$>" class="mt-entry-archive < $mt:Var name="page_layout"$>"> -->
All of the index files would then have to be rebuilt for the change to take place. Normally, without the forced load of the mediabox announcement, the code would read like this: For the individual page archives: Get it right the first time, because "Only Entry Archives" files then have to be rebuilt for the change to take place—that's over 2,500 files and takes forever! Normally, without the forced load of the mediabox announcement, the code would read like this: My browser of choice continues to be Safari. However, a few months ago Apple pushed an update out the door that is making Safari do weird things when building a page with Flash embeds. This, at times, significantly impacts page display and, I suspect, is a result of Apple pushing HTML5 implementation. I don't get those issues in Firefox. Hopefully Apple will correct this problem in the near future. I don't know what IE does with any of this code. I gave up on that browser a long time ago. (My apologies to all of those who still use it.) [Another note to self: the directions for using the awesome but non-intuitive SyntaxhHighlighter used on the WordPress version of this page are located at this link. And that's about it.
<!-- Mandate that the #mb-announcement mediabox open when this page is first hit or refreshed by the user -->
<!-- <body id="mt-blog" class="mt-main-index layout-wm" onload="Mediabox.open('URL_GOES_HERE', 'TITLE_GOES_HERE', 'WIDTH HEIGHT')"> -->
<!-- the body id above is the result of using the <$mt:BlogTemplateSetID$> variable for the boy id as shown below. When NOT mandating the #mb-announcement, comment out the next line of code. -->
<!-- body id="<$mt:BlogTemplateSetID$>" class="mt-entry-archive < $mt:Var name="page_layout"$>" onload="Mediabox.open('http://blog.timtyson.us/wordpress/wp-content/uploads/2010/12/HolidayGreeting.jpg', 'Happy Holidays', '480 520')">
< ! When NOT mandating the #mb-announcement, uncomment out the next line of code. -->
<body id="<$mt:BlogTemplateSetID$>" class="mt-entry-archive <$mt:Var name="page_layout"$>">
Under the template-link-files —> my-template-link-files on the server, modify the Entry.html file within that folder. Immediately after the HTML header tag closes, this code should appear:<!-- Mandate that the #mb-announcement mediabox open when this page is first hit or refreshed by the user -->
<!-- <body id="mt-blog" class="mt-main-index layout-wm" onload="Mediabox.open('URL_GOES_HERE', 'TITLE_GOES_HERE', 'WIDTH HEIGHT')"> -->
<!-- the body id above is the result of using the <$mt:BlogTemplateSetID$> variable for the boy id as shown below. When NOT mandating the #mb-announcement, comment out the next line of code. -->
<body id="<$mt:BlogTemplateSetID$>" class="mt-entry-archive <$mt:Var name="page_layout"$>" onload="Mediabox.open('http://blog.timtyson.us/wordpress/wp-content/uploads/2010/12/HolidayGreeting.jpg', 'Happy Holidays', '480 520')">
<!-- When NOT mandating the #mb-announcement, uncomment out the next line of code. -->
<!-- <body id="<$mt:BlogTemplateSetID$>" class="mt-entry-archive < $mt:Var name="page_layout"$>"> -->
<!-- Mandate that the #mb-announcement mediabox open when this page is first hit or refreshed by the user -->
<!-- <body id="mt-blog" class="mt-main-index layout-wm" onload="Mediabox.open('URL_GOES_HERE', 'TITLE_GOES_HERE', 'WIDTH HEIGHT')"> -->
<!-- the body id above is the result of using the <$mt:BlogTemplateSetID$> variable for the boy id as shown below. When NOT mandating the #mb-announcement, comment out the next line of code. -->
<!-- body id="<$mt:BlogTemplateSetID$>" class="mt-entry-archive < $mt:Var name="page_layout"$>" onload="Mediabox.open('http://blog.timtyson.us/wordpress/wp-content/uploads/2010/12/HolidayGreeting.jpg', 'Happy Holidays', '480 520')">
< ! When NOT mandating the #mb-announcement, uncomment out the next line of code. -->
<body id="<$mt:BlogTemplateSetID$>" class="mt-entry-archive <$mt:Var name="page_layout"$>">


/div>

























Well, the ole blog has now been around for 5 years! Seems rather amazing to me actually as life was so different 5 years ago!
So you hopped onto my website just now and... Wait, what's that? I mean, am I hearing things? What's going on? This is strange.
Awesomeness. I 





Recent Comments