Page 1 of 11
Forum moderator: bigblog 
uCoz Community » General Information » First Steps with uCoz » Informers - How to change $MESSAGE$ length? (How can I change the $MESSAGE$'s code output length?)
Informers - How to change $MESSAGE$ length?
nitroretroofficial
Posts: 12
Reputation: 0
Message # 1 | 10:40 PM
Hello uCoz Community!

I can't seem to figure this out.
I want to change the $MESSAGE$'s code max-length.
You can do that with the title in the advanced settings for the informer, but there doesn't appear to be any way to change the message's length.

I currently fixed it with CSS, but I would want the normal way (if there is a way). (So it also displays ... at the end of it etc.)
Post edited by nitroretroofficial - Wednesday, 2016-05-18, 10:57 PM
khen
Posts: 436
Reputation: 13
Message # 2 | 4:35 AM
This might help you. It limits 150 characters of $MESSAGE$ length:

Code
<?if(len($MESSAGE$)>150)?><?substr($MESSAGE$,0,150)?>
<?else?>$MESSAGE$<?endif?>


Replace 150 with the number of characters you need for the text. The code truncates the text if there are more than 150 characters, otherwise leaves it as it is.

Post edited by khen - Thursday, 2016-05-19, 4:36 AM
nitroretroofficial
Posts: 12
Reputation: 0
Message # 3 | 5:08 AM
Thanks khen! It's better than the CSS solution. happy
Paradox
Posts: 3263
Reputation: 145
Message # 4 | 5:37 AM
nitroretroofficial, khen, is correct. The best option is to use the substring function.

Assuming this problem is solved I'm going to lock this thread. smile

Developer, Designer, Communicator.
Visit me at alexmoloney.me.
Tweet to me on Twitter.
uCoz Community » General Information » First Steps with uCoz » Informers - How to change $MESSAGE$ length? (How can I change the $MESSAGE$'s code output length?)
Page 1 of 11
Search: