Recent Topics

1 Dec 15, 2006 23:09    

OK, I'm sure it's here somewhere, but after an hour of searching (and possibly looking right past the answer) I'll post my question and beg the good graces of all of you.

In my 0.9.2 blog I modified summary.php to show me four headlines from blog All with the links opening in a new window. This is because I was showing the blog links in a small iframe window on my company's main site on a different server. The code was:

<a href="<?php $Item->permalink() ?>" title="<?php echo T_('Permanent link to full entry') ?>" target="_blank"><?php $Item->title( '', '', false ); ?></a> - by <?php $Item->Author->prefered_name() ?>

Now that I have upgraded to 1.8.6 this no longer works, but so far I haven't stumbled across the answer to making the much shorter ...

<?php $Item->permanent_link( '#title#' ) ?> - by <?php $Item->Author() ?>

... open the link in a new window.

I tried a few combinations of things I found in various posts but none seemed to work for me.

On the plus side, you won't have to worry about me asking how to change the [More:] thing. THOSE pages I found.

Thanks for your help and indulgence.

2 Dec 16, 2006 00:22

That function goes like this:

function get_permanent_link( $text = '#', $title = '#', $class = '' )


So maybe you could cheat a bit and take advantage of the class parameter with something like this:

function get_permanent_link( '#title#', '#', 'foo" target="_blank"' )

In this case the class "foo" has no meaning (unless you want it to). All it's doing is taking advantage of the how the function will react if there is something in the class field.

It's worth a shot!

3 Dec 16, 2006 01:12

EdB:

Thanks. Your shot hit the mark. It did just what I was looking for. However I did have to make one minor modification.

When I viewed the source of the html it showed

 class="foo" target="_blank"">

. The "" made the page invalid for the Doctype: XHTML 1.0 Transitional.

So I changed

( '#title#', '#', 'foo" target="_blank"' )


to

( '#title#', '#', 'foo" target="_blank' )


to remove the trailing " after _blank and all is well.

You are a clever man!

4 Dec 16, 2006 01:37

BaileyWTNH wrote:

... You are a clever man!

I'm glad you got it working as you wanted, but the cleverness belongs to ¥åßßå for coming up with that little trick a while ago on an unrelated issue. All I did was apply the trick to this situation.


Form is loading...