[MT-users] Link redirects and embedded URLs

Paul Makepeace Paul.Makepeace at realprogrammers.com
Tue Jun 8 17:48:49 BST 2004


Je 2004-06-07 14:45:05 +0100, David Jennings skribis:
> > * when people comment on your blogs does the email MT sends out have
> >   the full URL or just the /cgi-bin/mt-comments.cgi ... bit? Mine only
> >   has the latter.
> 
> Mine too.

Dug around a bit in the code. No nice solution (but see below!)

It's because MT maintains a master CGIPath variable that applies to
*all* sites. I have left it blank so the domain bit is left off. If I
set it, everyone's site would have that URL and it would be stinky: it
would look like every other shabby multi-MT system that's obviously
hosted at one point.

For the most part leaving CGIPath blank works as href's don't need the
domain if they're referenced within that domain.

However when displaying a URL to a user the missing domain is a problem,
e.g. on the Trackback page or via emails.

I've got two solutions to two different problems:

1. Templates:

I solved this by putting the <$MTBlogURL$> variable before the <$MTEntryTrackbackLink$> like so:

  <div class="trackback-url">TrackBack URL for this entry:<br /><$MTBlogURL$><$MTEntryTrackbackLink$>

This doubles up a / in the URL but that doesn't matter in practice.
So you will need to do this yourself with your particular template.
Click "Templates" then the EDIT button by "TrackBack Listing Template"
toward the end.

2. Emails:

Unfortunately, SixApart decided to construct its emails in code so
there's no way of overriding them via templates. Shame. Adding to the
(well, my :) confusion, MT Blacklist software additionally replaces
core MT code.

So I have dived in and fixed the two URLs generated in the "new comment"
email notification: the link to the comment itself, and the de-spam
link. The code removes the double slash problem here though.

Any others I've missed?

**

Let me know how it goes...

HTH, Paul


-- 
Paul Makepeace .............................. http://paulm.com/inchoate/

"What is a baboon? Ask again."
   -- http://paulm.com/toys/surrealism/



More information about the MT-users mailing list