1
bjarkekr
News module, limit amount of chars...
  • 2005/8/22 6:23

  • bjarkekr

  • Just popping in

  • Posts: 24

  • Since: 2005/8/10


Hi!

How do I limit the amount of chars posted in top news, to something less than what is showed now??

have a look at www.onesolution.dk

The top news stories is posted in the right side of the page, and I want them to only fill out one line of text instead of the 2 lines it uses now.

2
frankblack
Re: News module, limit amount of chars...
  • 2005/8/22 7:15

  • frankblack

  • Just can't stay away

  • Posts: 830

  • Since: 2005/6/13


You can use the smarty-function truncate inside the template like this:

<{$thesmartyvariable|truncate:30:"..."}>


This will shorten the text to 30 chars with three dots added at the end.

3
Marco
Re: News module, limit amount of chars...
  • 2005/8/22 7:22

  • Marco

  • Home away from home

  • Posts: 1256

  • Since: 2004/3/15


hello
The recent news block from News Module has already this feature as build-in feature.
just investigate a little bit more block parameters !
Do synergy or die.

4
frankblack
Re: News module, limit amount of chars...
  • 2005/8/22 7:34

  • frankblack

  • Just can't stay away

  • Posts: 830

  • Since: 2005/6/13


My post was meant for a motivation to use more smarty, because there is much more than foreach-loops and cycle.

I wonder which way is faster or better? Writing a) code for each module with the possibility of making errors inside the code or b) use a smarty-function which works?

a) is easier to administrate, but b) means less code!

5
Marco
Re: News module, limit amount of chars...
  • 2005/8/22 7:56

  • Marco

  • Home away from home

  • Posts: 1256

  • Since: 2004/3/15


yes frank

hum, I know. Interesting my friend
did you noticed speed up with this smarty tip
i'm interested in that (how many sec/queries.)
marco
Do synergy or die.

6
bjarkekr
Re: News module, limit amount of chars...
  • 2005/8/22 9:13

  • bjarkekr

  • Just popping in

  • Posts: 24

  • Since: 2005/8/10


thanks for the answers.. I dont see the option in the module administration.. :(

I use news version 1.1

but I will try to use the smarty method instead.. :)

7
Marco
Re: News module, limit amount of chars...
  • 2005/8/22 9:15

  • Marco

  • Home away from home

  • Posts: 1256

  • Since: 2004/3/15


this option is available on News 1.3.x series (as long as i can remember) and up, and is available in block options.
marco
Do synergy or die.

8
bjarkekr
Re: News module, limit amount of chars...
  • 2005/8/22 9:24

  • bjarkekr

  • Just popping in

  • Posts: 24

  • Since: 2005/8/10


ok... It worked nicely...

Is there an overview somewhere showing which smarty vars is available??

and since I only have 4 news stories, I cant really see a difference in performance.. sorry ;)

9
frankblack
Re: News module, limit amount of chars...
  • 2005/8/22 9:47

  • frankblack

  • Just can't stay away

  • Posts: 830

  • Since: 2005/6/13


Quote:
I cant really see a difference in performance.. sorry ;)


There will be no difference in performance. I only wanted to point out that module developers MUST not reinvent the wheel and write functions that are already available through smarty.

An overview of all smarty-functions you can find HERE!

If you turn on Smarty-Debug in System-Administration you can see all smarty-variables currently used on the page.

10
bjarkekr
Re: News module, limit amount of chars...
  • 2005/8/22 11:56

  • bjarkekr

  • Just popping in

  • Posts: 24

  • Since: 2005/8/10


ok, thanks a lot.. I could really use that

Login

Who's Online

237 user(s) are online (162 user(s) are browsing Support Forums)


Members: 0


Guests: 237


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits