Hi all, I need to truncate my teaser to max 400 chars. In views module there is possibility that words will be not truncated. How can I replicate this ? Is there a drupal function or I need to see what views module do ? Tnx. M. -- Michel 'ZioBudda' Morelli michel@ziobuddalabs.it Sviluppo applicazioni CMS DRUPAL e web dinamiche (LAMP+Ajax) Telefono: 0200619074 Telefono Cell: +39-3939890025 -- Fax: +39-0291390660 http://www.ziobudda.net ICQ: 58351764 http://www.ziobuddalabs.it Skype: zio_budda http://www.ziodrupal.net MSN: michel@ziobuddalabs.it JABBER: michel@ziobuddalabs.it
If you are making a display of teasers why not just use views? -Steve Steve Kessler Denver DataMan 303-587-4428 Sign up for the Denver DataMan Free eNewslettter "Getting the right information, to the right people, at the right time" -----Original Message----- From: Michel Morelli [mailto:michel@ziobuddalabs.it] Sent: Wednesday, May 26, 2010 6:49 AM To: support@drupal.org Subject: [support] substr and words Hi all, I need to truncate my teaser to max 400 chars. In views module there is possibility that words will be not truncated. How can I replicate this ? Is there a drupal function or I need to see what views module do ? Tnx. M. -- Michel 'ZioBudda' Morelli michel@ziobuddalabs.it Sviluppo applicazioni CMS DRUPAL e web dinamiche (LAMP+Ajax) Telefono: 0200619074 Telefono Cell: +39-3939890025 -- Fax: +39-0291390660 http://www.ziobudda.net ICQ: 58351764 http://www.ziobuddalabs.it Skype: zio_budda http://www.ziodrupal.net MSN: michel@ziobuddalabs.it JABBER: michel@ziobuddalabs.it -- [ Drupal support list | http://lists.drupal.org/ ]
Steve Kessler ha scritto:
If you are making a display of teasers why not just use views?
Why use views if I need to extract title+teaser of the last node published ? M. -- Michel 'ZioBudda' Morelli michel@ziobuddalabs.it Sviluppo applicazioni CMS DRUPAL e web dinamiche (LAMP+Ajax) Telefono: 0200619074 Telefono Cell: +39-3939890025 -- Fax: +39-0291390660 http://www.ziobudda.net ICQ: 58351764 http://www.ziobuddalabs.it Skype: zio_budda http://www.ziodrupal.net MSN: michel@ziobuddalabs.it JABBER: michel@ziobuddalabs.it
By Default you can set the the max characters for your teaser for all posts by going through admin -> content -> node-settings. You will find Length of trimmed posts there and you can change the trimmed max characters. On Wed, May 26, 2010 at 7:33 PM, Michel Morelli <michel@ziobuddalabs.it>wrote:
Steve Kessler ha scritto:
If you are making a display of teasers why not just use views?
Why use views if I need to extract title+teaser of the last node published ?
M.
-- Michel 'ZioBudda' Morelli michel@ziobuddalabs.it Sviluppo applicazioni CMS DRUPAL e web dinamiche (LAMP+Ajax) Telefono: 0200619074 Telefono Cell: +39-3939890025 -- Fax: +39-0291390660
http://www.ziobudda.net ICQ: 58351764 http://www.ziobuddalabs.it Skype: zio_budda http://www.ziodrupal.net MSN: michel@ziobuddalabs.it JABBER: michel@ziobuddalabs.it
-- [ Drupal support list | http://lists.drupal.org/ ]
-- Regards, Amit Vyas Email : amit.vyas@blisstering.com Mobile : +91 993-040-1490 Skype : vyasamit2004 Twitter : amit_vyas
Amit Vyas ha scritto:
By Default you can set the the max characters for your teaser for all posts by going through admin -> content -> node-settings. You will find Length of trimmed posts there and you can change the trimmed max characters. No, I'm creating a costum block and I need this "trim" only for this block.
M. -- Michel 'ZioBudda' Morelli michel@ziobuddalabs.it Sviluppo applicazioni CMS DRUPAL e web dinamiche (LAMP+Ajax) Telefono: 0200619074 Telefono Cell: +39-3939890025 -- Fax: +39-0291390660 http://www.ziobudda.net ICQ: 58351764 http://www.ziobuddalabs.it Skype: zio_budda http://www.ziodrupal.net MSN: michel@ziobuddalabs.it JABBER: michel@ziobuddalabs.it
If you're comfortable making a module, just run the text through the node_teaser function in node.module: node_teaser($body, $format = NULL, $size = NULL) Set your format to $node->format and set your size to whatever you need. Jamie Holly http://www.intoxination.net http://www.hollyit.net On 5/26/2010 10:19 AM, Michel Morelli wrote:
Amit Vyas ha scritto:
By Default you can set the the max characters for your teaser for all posts by going through admin -> content -> node-settings. You will find Length of trimmed posts there and you can change the trimmed max characters. No, I'm creating a costum block and I need this "trim" only for this block.
M.
Jamie Holly ha scritto:
If you're comfortable making a module, just run the text through the node_teaser function in node.module:
node_teaser($body, $format = NULL, $size = NULL)
Set your format to $node->format and set your size to whatever you need.
oh. I will try it. Thanks. M. -- Michel 'ZioBudda' Morelli michel@ziobuddalabs.it Sviluppo applicazioni CMS DRUPAL e web dinamiche (LAMP+Ajax) Telefono: 0200619074 Telefono Cell: +39-3939890025 -- Fax: +39-0291390660 http://www.ziobudda.net ICQ: 58351764 http://www.ziobuddalabs.it Skype: zio_budda http://www.ziodrupal.net MSN: michel@ziobuddalabs.it JABBER: michel@ziobuddalabs.it
I know you already known to this but still in a rare case :-) This will be helpful http://api.drupal.org/api/function/node_teaser On Wed, May 26, 2010 at 7:58 PM, Michel Morelli <michel@ziobuddalabs.it>wrote:
Jamie Holly ha scritto:
If you're comfortable making a module, just run the text through the node_teaser function in node.module:
node_teaser($body, $format = NULL, $size = NULL)
Set your format to $node->format and set your size to whatever you need.
oh. I will try it.
Thanks.
M.
-- Michel 'ZioBudda' Morelli michel@ziobuddalabs.it Sviluppo applicazioni CMS DRUPAL e web dinamiche (LAMP+Ajax) Telefono: 0200619074 Telefono Cell: +39-3939890025 -- Fax: +39-0291390660
http://www.ziobudda.net ICQ: 58351764 http://www.ziobuddalabs.it Skype: zio_budda http://www.ziodrupal.net MSN: michel@ziobuddalabs.it JABBER: michel@ziobuddalabs.it
-- [ Drupal support list | http://lists.drupal.org/ ]
-- Regards, Amit Vyas Email : amit.vyas@blisstering.com Mobile : +91 993-040-1490 Skype : vyasamit2004 Twitter : amit_vyas
participants (4)
-
Amit Vyas -
Jamie Holly -
Michel Morelli -
Steve Kessler