Recent Topics

1 Dec 31, 2008 01:52    

My b2evolution Version: 2.45

I am using B2evolution for a mixture of posts and links to existing files or new files outside of B2evolution -- kind of half CMS/half blog. The problem is that I can't get the skins to use the "Link to URL"/post_url field only in the title if there is data in it. The SEO section lets you choose either permanent_link or post_url, but if you choose post_URL, then nothing shows up if it doesn't have one. I can't seem to find a way to test for the existence of data in that field within the skin, or any documentation that explains it. I can modify the Item array to use the URL, but not test it ($Item->title( array( 'link_type' => 'linkto_url' ) )).

I can get it to work for a "read more" at the end, but not the title:

$Item->url_link( array(

                'text_template' => 'Read More...',
                'url_template'  => '$url$',
                
            ) ); 

I'm hoping to do this on regular pages and the feeds as well.

Thanks!

2 Dec 31, 2008 02:23

Welcome to the forum!

Try this

if( !empty( $Item->url ) )
{
	echo '<a href="'.$Item->url.'">Read more...</a>';
}

or this

if( !empty( $Item->url ) )
{
	echo '<a href="'.$Item->url.'">'.$Item->title.'</a>';
}

3 Dec 31, 2008 06:31

Perfect! It worked! I'd been looking all day to make this work, but didn't know about $Item->url. I didn't find any docs that listed it either, including this one:
http://manual.b2evolution.net/TemplateTags

for available Template Tags. Should it be added?

Thanks again!

4 Dec 31, 2008 06:44

Well, it's not a template tag, 'url' and 'title' are properties of the 'Item' object.


Form is loading...