Recent Topics

1 Feb 06, 2005 13:54    

When I add a URL into the "Link to URL" box then view the resulting blog entry in the preview/blog window, the URL is added with two nested <A></A> pairs, i.e.

<h3 class="storytitle"><a href="http://b2blog.bytor.co.uk/index.php/links/2005/02/04/p59" rel="bookmark" title="Permanent link to full entry"><a href="http://www.spamgourmet.com/">Spam Gourmet</a></a></h3>

where it should only be

<h3 class="storytitle"><a href="http://www.spamgourmet.com/">Spam Gourmet</a></h3>

It should only insert the details from the "Link to URL" field. It looks like its putting the permalink in everytime, whether its needed or not.

Is there a fix for this? (The page doesn't validate like this).

2 Feb 06, 2005 14:47

What code do you have in your _main.php for generating your title?

3 Feb 06, 2005 15:23

Is this the entry you mean?

	 <h3 class="storytitle"><a href="<?php $Item->permalink() ?>" rel="bookmark" title="<?php echo T_('Permanent link to full entry') ?>"><?php $Item->title(); ?></a></h3>

Taken from the wpm_aubmach skin.

4 Feb 06, 2005 15:31

Change it to be this:


<h3 class="storytitle"><a href="<?php $Item->permalink() ?>" rel="bookmark" title="<?php echo T_('Permanent link to full entry') ?>"><?php $Item->title('','',false); ?></a></h3>

The first two parameters are if you want to put anything infront or after the title (they're two ' not one "), the third is a true or false statement about whether you wish to display the url title or not. You can either do that, or delete the permalink stuff if you'd rather show the url.

http://doc.b2evolution.net/0.9.0/evocore/Item.html#methodtitle

5 Feb 06, 2005 16:24

Thanks for that. I actually had a play after seeing your alteration. This is what I came up with (and it works for my tests).

<?php // ------------------------------------ DISPLAY URL OR PERMALINK ----------------------------------------
	echo '<h3 class="storytitle"><a href="';
	if( $Item->get('url') )
	{
		echo $Item->get('url'),'" title="URL to linked item" ';
	}
	else
	{
		echo $Item->permalink(),'" title="Permanent link to full entry" ';
	}
	echo 'rel="bookmark">',$Item->get('title'),'</a></h3>';
	?>


Form is loading...