iBlog 1.3 Betas


UPDATE: This is the entry that contains instructions for using Mac.com counters in your iBlog-generated blog. With the release of iBlog 1.3.x, the process has changed somewhat. With this new version, instead of manually editing the blog templates as described in Step 6 below, in iBlog 1.3 you'll use the Navigation Editor (Blogs>Show Navigation Editor), to add a new section, and then paste your counter code (Step 5 below), into this new section. Also, it will probably simplify your process and make it less error-prone if you copy the existing counter/feedback code from the decoy page that you create in Step 1 (use your web browser's "View Source" command to see the page's HTML code). Once you've pasted the code into the new section of iBlog's Navigation Editor, then you'll need to insert "http://homepage.mac.com" at the beginning of every URL reference contained in the code. URL references are easy to identify because they are usually filled with slashes ("/"), and look something like this: <img src="/i/hpti/1/wimg/Shared/footer_separator.gif">. So you would edit that line to look like this: <img src="http://homepage.mac.com/i/hpti/1/wimg/Shared/footer_separator.gif">. Simple, eh?

My, my, I go on vacation for a while, catch a bad case of writer's block, and look what I miss: not one, but several new versions of iBlog! While I was resting and relaxing at the wonderful Rachel's Inn (motto: Breakfasts That Last All Day!), in wonderful Mendocino, CA, Lifli Software was busy releasing a new beta version of their flagship product.

Luckily I read the release notes carefully before firing up 1.3b2 because the blog structure and format has changed dramatically in iBlog 1.3, and once it converts your blog, it's no longer backwardly compatible with earlier versions of iBlog (I'm still using 1.2). To their credit, Lifli had the foresight to have iBlog back-up your existing blog files before converting them, but it does rename the top-level folder something like MyBlog.old. So one must rename the back-up before reverting back to an older iBlog version. I found it easier just to try iBlog 1.3b2 on a machine that had never seen any version of iBlog.

I also read in the release notes that Lifli had added a new feature that would allow users to embed custom HTML formatting in blog entries, but unfortunately they had to remove it from 1.3b2 due to "issues." Of course, this is just the feature I'm waiting for because iBlog versions greater than 1.2 provide no way to indent paragraphs. The first thing I tested in 1.3b2 was the paragraph formatting bar, to see if just maybe Lifli had invented a way to faithfully translate paragraph formatting bar settings to HTML, but no such luck. 1.3b2 still has the same problem in this regard as 1.2.6: indenting paragraphs with the paragraph formatting bar is lost when the blog is rendered as HTML, and custom HTML tags inserted in the blog entry are rendered as plain text. And as of 1.3b4, there is still no fix for WYSIWIG paragraph formatting or for embedding custom HTML. For this reason, I'm sticking with iBlog 1.2 and hoping that Lifli will get the "issues" surrounding custom HTML tagging resolved.

The other interesting thing that Lifli has implemented is their own blog about iBlog (finally!). The blog is at <http://www.ibloggers.net>, and there's supposedly also a public forum at <;http://www.ibloggers.net/forum>. The Lifli folks have posted a lot of good information on the structure of iBlog blogs, modifying that structure, adding comments, adding counters, and so on. A lot of these topics were areas I was planning to write about, but now I don't have to! I will, however, touch on the issue of counters.

On iBloggers.net, Lifli talks about adding free hit counters from many different providers, but once again, they seem to ignore the central provider, DotMac! After all, isn't that one of iBlog's big selling features: its ability to integrate with DotMac? Even though it may seem as though the only pages to which you can add a DotMac counter are those created with Homepage, it's really quite easy to add a real DotMac Homepage counter to an iBlog blog. Here's how...

It's a Decoy, Dummy
All right, so if you're a DotMac subscriber and have a Homepage site, then you already know that you get counters for free on each and every page of each and every site that you create. When Homepage creates a new site or a new page, it gives the site or page a unique, internal name. For instance, add a new menu page to you site, and Homepage might name it something like "Menu17." The number is the significant part of that name, and if you add a counter to that page, the counter will track to the number "17." So in essence, each of your Homepage pages is uniquely numbered, and that's how DotMac tracks the hits on each page containing a counter. Each of your sites is also numbered internally, but it's not quite as obvious as the menu numbering; you need to look at the JavaScript code generated when you create a new page in order to find the site number. We'll look at this in more detail below.

So what happens if you create that new site and menu page, add the counter, but you don't link it in anywhere on your other sites? Furthermore, you don't give anyone the url to that page, so it's never visited. The counter for that page remains forever at zero, right? Not when you crack open the HTML for that page, pull out the counter JavaScript code, and embed it in your iBlog blog template!

You see, Homepage knows that there's a page 17, which makes it a valid number to DotMac's hit counter. But DotMac's hit counter doesn't check the name of the page sending it a "hit" message; it just takes the data passed in from some HTML code, and if it contains valid site and page numbers for this member's Homepage account, then it gladly increments the counter.

This is exactly how I was able to add a DotMac Homepage counter to my iBlog blog. I created a "dummy" menu page, added the counter to it, and then lifted the counter JavaScript code out of the dummy page and dropped it into my iBlog template. Of course the counter doesn't work when I preview my blog on my local machine, but when I publish to my Homepage site, the counter works just fine.

Step 1: Create the Dummy Site and Decoy Page
Log into your Homepage account at www.mac.com, and add a new "site." You need to create a new site, because if you add the dummy page to one of your existing sites, then Homepage will automatically add links to the new page. Sites, on the other hand, never know about each other unless you manually link them together. Name the new site whatever you want, and then add a new page to the site (just use one of the "menu" templates).

Step 2: Enable the Counter for the New Page
Check the "Show" box on the hit counter for the new page, and also check the "Show" box on the "Send Me a Message" button for the new page.

Step 3: Publish the Decoy Page
Click the Publish button to publish the new page. Remember, no one is going to actually see or use this page, so you really don't need to do anything else to it, although on mine I added a link to my blog just for the heck of it.

Step 4: Visit the Dummy Site
Once you've published the menu on the dummy site, you'll want to actually visit the site in order to see what Homepage named the new page. The actual page name will be the last item of the url in your browser's address bar. It might look something like
http://homepage.mac.com/yourname/dummysite/Menu23.html

In this case, the counter for this page would be keyed to the number "23."

Step 5: Find the Counter and E-mail Code
Choose your browser's "View Source" command to look at the HTML code of the decoy page, and then do a Find for the script name "TKCounter.js," this should take you to the block of &lt;script&gt; code responsible for inserting the counter in the page. Do a search for "TKSite" to find the site's internal number; it might look something like "TKSite.11." The counter and "message me" code may be a little hard to isolate because they're not encapsulated next to each other in Apple's page templates, so I've put the code you want together in one chunk below. Just replace all the YOURNAME's with your DotMac account name, replace the MENU#'s with the actual menu number of your decoy page, and replace all the SITE#'s with the number found near the "TKSite" strings in the code:
div
!--
Begin .Mac counter & feedback code
--
TABLE CELLSPACING=6 CELLPADDING=0 BORDER=0TRTD
!--
Begin Counter
--
SCRIPT language=JavaScript src="http://homepage.mac.com/i/chp/TKCounter.js"
/SCRIPT
script language=javascript
counterUser='YOURNAME';
counterPage='MENU#';
imageBase='http://homepage.mac.com/i/hpti/1/wimg/Shared/WhiteCounter';br
window.onload=writeCounter;
/script
ilayer height="40" src="http://homepage.mac.com/WebObjects/Counter.woa/wa/html?user=YOURNAME&page=MENU#&imageBase=/i/hpti/1/wimg/Shared/WhiteCounter"
DIV ID="CounterDiv" NAME="CounterDiv" STYLE="position:relative; width:auto; height:auto;"
img src="http://homepage.mac.com/WebObjects/Counter.woa/wa/image?user= YOURNAME&page=MENU#"
/DIV
/ilayer
!--
End Counter
--
/TDTDIMG SRC=/i/hpti/1/wimg/Shared/footer_separator.gif/TDTD
!--FeedbackBegin--
SCRIPT language="javascript"
!--//
feedbackURL = 'http://homepage.mac.com/WebObjects/FileSharing.woa/wa/visitorFeedback?user=YOURNAME&templatefn=MenuMENU#.html&xmlfn=TKDocument.MENU#.xml&sitefn=TKSite.SITE#.xml&aff=consumer&cty=US&lang=en';
//--
/SCRIPT
a href="http://homepage.mac.com/WebObjects/FileSharing.woa/wa/visitorFeedback?user=YOURNAME&templatefn=MenuMENU#.html&xmlfn=TKDocument.MENU#.xml&sitefn=TKSite.SITE#.xml&aff=consumer&cty=US&lang=en" onClick="" onFocus="this.blur();"IMG border=0 src="http://homepage.mac.com/i/hpti/1/wimg/Shared/btn_send_message.gif"/a
!--FeedbackEnd--
/TD/TR/TABLE
!--
End .Mac counter & feedback code
--
/div

Step 6: Insert the Code in iBlog's Navigation Template
Once you've modified the JavaScript above to link to your account name, menu number, and site number, you're ready to transplant the code into iBlog. The file you'll want to modify is called "BlogPage.txt," and depending on which Template Set you've chosen in iBlog's Preview preference, you'll find it in either the "LeftNavigation" or "RightNavigation" folder at the following path:
/Users/YourHome/Library/iBlog/TemplateSets/

I'm using the left-hand navigation style on Beoblog, so I modified the BlogPage.txt file in the "LeftNavigation" folder.

It's a good idea to make a back-up copy of your unmodified TemplateSets folder before proceeding!

Notice that my counter and "e-mail me" link appear at the bottom of the navigation panel but above the "Powered by iBlog" button? I did this because it makes it very easy to figure out where to insert the code. All you have to do is open the BlogPage.txt file in your favorite text editor (I use BBEdit), and do a search for "Powered by". You should also note that each of the sections in the navigation panel -- calendar, links, archives, and so on -- are enclosed within &lt;div&gt;&lt;/div&gt; tags. So to insert your counter and e-mail button above the "Powered By iBlog" blurb, and below whatever is above it, you should copy and paste your modified JavaScript code before the opening &lt;div&gt; of the "Powered By" section, and after the closing &lt;/div&gt; of the preceding section.

Step 7: Publish to Preview
Remember that the counter and e-mail button are powered by Apple's DotMac servers, so you'll need to actually publish your blog in order to preview the counter and e-mail button. Depending on your internet connection speed, you may want to move the code around within the BlogPage.txt file to try out different placements for the buttons.

As long as you've made a back-up copy of iBlog's TemplateSets folder, don't be afraid to experiment a little. At worst, it just means that a visitor popping into your blog at the right moment might get to see something horrendously ugly! Have fun!

Posted: Thu - June 19, 2003 at 10:31 PM          


©