cut intro but keep html formating

More
11 years 7 months ago #36029 by bobthebob01
Hi,

I've tried various options for the intro text in category view. And the only way to cut the intro to a specific number of characters is to have the text stripped of HTML.

is there a way to simple cut the intro to that specific number while keeping the html formatting?

thanks

Cheers

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #36030 by micker
Without coding yours not.... sorry
IT difficult to do this without cutting div or other html balise

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #36051 by bobthebob01
Thanks for the reply.

in a previous site running on FC 1.x, i was using the following in one of my template and was working:
Code:
<?php echo(substr($items[$i]->fields['text']->display, 0,320)); ?>...

but for some reason, it does not work in FC2.x. Although i thought it would since it's not a FC native function.

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #36052 by bobthebob01
LOL my bad. i was looking at the wrong page on the front end.

This works actually. But i agree that it's ugly and not a good practice as you can easily cut out a closing tag for example.

"kids! Don't do this at home!" !!!!

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #36058 by ggppdk
Hello, yes avoid it !

and if your texts includes div or table or similar do not do it for any reason !! the browser will not recover from it and all layout of your page will be ruined


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #36061 by bobthebob01
Oh yes, i saw what damage it can do.
But for this very specific purpose, it does work for me since it's a for a block of text that has no formatting at all.
That's why i added a note to my post.

DO NOT USE THIS SNIPPET UNLESS YOU KNOW EXACTLY WHAT YOU ARE DOING.

Cheers

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 1.638 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline