Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-01-20 19:20:39

bashirnoori
Member
From: Afghanistan
Registered: 2012-10-02
Posts: 84

I want to limit each article titles with vm_substr

I want to limit each article titles with rvm_substr plugin, but not works fine !

<txp:rvm_substr length=“10”><txp:recent_articles break=“li” label=”“ class=“news-item” limit=“5” /></txp:rvm_substr>

It will limit all titles to 10 characters, but I want to limit each article …
Any solution way to limit the article’s title (Recent Articles)

thanks

Offline

#2 2013-01-20 19:35:38

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,172
Website GitHub Mastodon Twitter

Re: I want to limit each article titles with vm_substr

Hi Bashir, never used the plugin but have you tried:

<txp:recent_articles break="li" label="" class="news-item" limit="5">
<txp:rvm_substr length="10">
<txp:title />
</txp:rvm_substr>
</txp:recent_articles>

Edited to add that I’m not sure how to provide links for them though as the code might trim the a tag.

Last edited by colak (2013-01-20 19:38:43)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2013-01-20 21:56:14

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: I want to limit each article titles with vm_substr

The recent_articles tag doesn’t accept contained statements or forms. It’s one of those bloody useless garbage tags. The title doesn’t generate links, but just returns the title. Replace the useless recent_articles tag with article_custom and you can link to the articles using the permlink tag.

<txp:article_custom wraptag="ul" break="li" class="news-item" limit="5">
	<txp:permlink>
		<txp:rvm_substr length="10">
			<txp:title />
		</txp:rvm_substr>
	</txp:permlink>
</txp:article_custom>

Offline

Board footer

Powered by FluxBB