BlogHarbor Home Page
FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  UsergroupsRSS   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Clicking on URL in comment sig
 
Post new topic   Reply to topic    BlogHarbor Community Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
zoli



Joined: 27 Jun 2005
Posts: 108

PostPosted: Thu Apr 20, 2006 12:27 am    Post subject: Clicking on URL in comment sig Reply with quote

Hi John,

I love the new ability for commenters to leave their name url ..etc info. However, when I click on the name a new window comes up with the commenter's blog, but this window does not have any of the normal Firefox navigation buttons and menus - so I can't move around in the blog. What I end up doing is reading the url from the status line, and instead of clicking it, manually type it in a new tab - kinda workaround, not too nice.

Is there a way:

a,) leave the browser controls intact?
b.) leave the browser default for links, i.e for firefox instead of a new window, it should be a new tab? (this one is less important than "a")

Thanks a lot Cool
Back to top
View user's profile Send private message Visit poster's website
john
Site Admin


Joined: 16 Mar 2004
Posts: 3434

PostPosted: Thu Apr 20, 2006 9:17 am    Post subject: Re: Clicking on URL in comment sig Reply with quote

The links to a commenters URL are opened by a Javascript function called openWindow, which is automatically inserted into your page by the system. Since it is not editable, we can create a new Javascript which will open the window with more "chrome" and modify the comments template to open links using this function instead.

First, let's modify the comments template. Here's how you would modify the comments template:
  1. Login to your Blog Admin Control Panel through the Login page.
  2. Click on the Look and Feel tab, then the Templates subtab.
  3. Now you see a list of the Templates you can customize. We are going to customize the comments template, which controls the structural display of comments posted to your weblog, so click Edit in the row that begins with the word article.
  4. Now you'll be on a page listing the current comments templates (there will probably be only one). Go all the way to the bottom of the page and click the Customize button.
  5. Almost there: Click the Go button to Copy the Standard template to the staging area. You'll come to the page where you can customize the comments template.
Now, to make some changes...

There are 2 lines that look like this:

Code:
<a href="javascript:openWindow('{{contact_url}}', 'info', 450, 600);">{{var name=author escape=html}}</a>


That's the line that generates the link when a visitor leaves a contact URL in a comment. We're going to create a new Javascript function called openWindowCustom to load that URL, so change those lines to the following:

Code:
<a href="javascript:openWindowCustom('{{contact_url}}', 'info',575,775);">{{var name=author escape=html}}</a>


and click Save and Activate. Now those links will open with the new Javascript function openWindowCustom we're going to add next. We've got a real easy way to do that, see Add Additional Content to the HEAD area of your HTML for instructions.

This is the code to add:

Code:
<script>
function openWindowCustom(url, name, height, width) {
  if (height == null) height = 450;
  if (width == null)  width = 500;

  var win;
  var winleft = (screen.width - width) / 2;
  var wintop  = (screen.height - height) / 2;

  win = window.open(url, name, 'scrollbars=yes,menubar=yes,location=yes,status=yes,' +
                               'location=yes,status=yes,directories=yes,' +
                               'toolbar=yes,width=' + width +
                               ',height='+height +
                               ',top=' + wintop +
                               ',left=' + winleft + ',resizable=yes'
          );
  if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
</script>


Click Save Settings and you're done. When your visitors leave their URL in a comment, the link will open in a new window which we've modified here to be slightly larger and show all the browser "chrome".
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Search all BlogHarbor support resources.
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    BlogHarbor Community Forum Index -> General Discussion All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum