Martes, 23 Diciembre 2014 03:01
beggarly

Numbers of characters (Title/Header)

Numbers of characters (Title/Header)

Postby MikiTux » Tue Dec 18, 2012 10:24 pm

Hi all,

is it possible to enter a numeric character limit value likewise "Introtext Limit" but for the "Title"?

e.g. to trim the numbers of characters of long title/header

Installed version 2.5.1 on Joomla 2.5.8

Thanks & Bye 8-)
MikiTux
Fresh Boarder
Fresh Boarder
 
Posts: 2
Joined: Tue Dec 18, 2012 10:20 pm

Re: Numbers of characters (Title/Header)

Postby chus » Wed Dec 19, 2012 4:27 pm

Hi,

You can try implementing a personalized template for the module as follows:
1. Copy modules/mod_featcats/tmpl/default.php to the same location with any other name
2. In the module configuration, under Advanced Options, find that new name under the dropdown list from the Alternative Layout parameter.
3. Edit your new template file, line 31

Code: Select all
                <?php echo $article->title; ?>

to

Code: Select all
                <?php echo (strlen($article->title) > 25 ? substr($article->title,0,25).'...' : $article->title); ?>

where "25" is the desired characters limit (find it twice in the code).

This way, if you ever need to reinstall the module, your personalized template won't be affected.

Hope this helps!
User avatar
chus
Administrator
Administrator
 
Posts: 455
Joined: Thu Sep 13, 2007 2:21 am
Location: Costa Rica

Re: Numbers of characters (Title/Header)

Postby MikiTux » Wed Dec 19, 2012 11:54 pm

Many thanks :-)

I'll try it ASAP, then I'll report the result.

Thanks & Bye 8-)
MikiTux
Fresh Boarder
Fresh Boarder
 
Posts: 2
Joined: Tue Dec 18, 2012 10:20 pm

Re: Numbers of characters (Title/Header)

Postby baijianpeng » Sat Jan 05, 2013 4:49 am

I also need this feature: Title Length limit.

Yes, the author had offered an option to limit the IntroText length, but there is no option for article titles.

I think, both "Main Articles" and "Linked Articles" need this Title Limit option.

Please add this option to next version, hacking code or template overriding is not a good idea.

Thanks.
JoomlaGate - Chinese Joomla! Users\' Portal

http://www.joomlagate.com
User avatar
baijianpeng
Junior Boarder
Junior Boarder
 
Posts: 27
Joined: Thu Nov 08, 2007 2:24 pm

Re: Numbers of characters (Title/Header)

Postby chus » Sat Jan 05, 2013 5:22 pm

Hi,

We have included the title limit option in the current 3.0.2 version for both leading and secondary articles.

Thanks for your concern!
User avatar
chus
Administrator
Administrator
 
Posts: 455
Joined: Thu Sep 13, 2007 2:21 am
Location: Costa Rica

Re: Numbers of characters (Title/Header)

Postby baijianpeng » Sun Jan 06, 2013 12:37 am

Glad to hear this good news.

I tested this new version v3.0.2, yes, you had added the option to limit title length, but, there is a minor problem:

When the title is English, everything is good. When the title is Chinese words (UTF-8 characters), the end where cut off happens will be a strange symbol instead of normal character , see attached screenshot.

I am not a programmer, but I know something about this issue, it had happened on many Joomla extensions that trying to cut off title or Introtext in Chinese language. Here is a hint:

maybe you used substr function to cut off, in fact, you should use mb_substr, the latter can handle utf-8 characters well.

Hope you will fix this soon.
Attachments
featcats-cut-symbol.png
featcats-cut-symbol.png (11.88 KiB) Viewed 6452 times
JoomlaGate - Chinese Joomla! Users\' Portal

http://www.joomlagate.com
User avatar
baijianpeng
Junior Boarder
Junior Boarder
 
Posts: 27
Joined: Thu Nov 08, 2007 2:24 pm

Re: Numbers of characters (Title/Header)

Postby chus » Sun Jan 06, 2013 1:41 pm

I'm sorry I missed that!

We have fixed the function in the current package as you suggested.

Thanks again :)
User avatar
chus
Administrator
Administrator
 
Posts: 455
Joined: Thu Sep 13, 2007 2:21 am
Location: Costa Rica

Re: Numbers of characters (Title/Header)

Postby baijianpeng » Sun Jan 06, 2013 11:40 pm

Thank you again, I can confirm that you had solved this problem. Good job!
JoomlaGate - Chinese Joomla! Users\' Portal

http://www.joomlagate.com
User avatar
baijianpeng
Junior Boarder
Junior Boarder
 
Posts: 27
Joined: Thu Nov 08, 2007 2:24 pm


Return to Featured Categories



Who is online

Users browsing this forum: No registered users and 1 guest

cron