Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3332084
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:39:02+00:00 2026-05-17T23:39:02+00:00

How can I split the teaser from the rest of the content in the

  • 0

How can I split the teaser from the rest of the content in the node.tpl.php to wrap the teaser text in special markup?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T23:39:03+00:00Added an answer on May 17, 2026 at 11:39 pm

    You could preprocess the theme variables to retrieve the teaser and store it separately, otherwise Drupal handles it internally and won’t give you a choice.

    Here is the code: http://www.mydiary.digiprosoft.com/?p=244 and below are the highlights from that link.


    In template.php

    function phptemplate_preprocess_node(&$variables) {
        // we like to display teasers on the node view pages in a different style,
        // but only if they were NOT set to “show summary on full view” (which seems
        // backward, but the implication with that checkbox is that the teaser is
        // PART of the node’s body, instead of an actual summary of the entire
        // node’s body). if a node’s unbuilt body starts with , then
        // a teaser has been manually set, and “show summary” is not checked.
        if ($variables['page'] == TRUE) { // only do this on full page views.
            $node = node_load($variables['nid']); // we reload the node because
            // by the time it gets here has already been filtered out.
            // this if logic stolen from node.module’s node_teaser_include_verify().
            if (strpos($node->body, '') === 0) {
                $variables['style_teaser_differently'] = TRUE;
                $variables['teaser'] = check_markup($node->teaser, $node->format, FALSE);
            }
        }
    }
    

    In node.tpl.php

    <?php
        if ($style_teaser_differently){
            print '<div class="fullview-teaser">'.$teaser.'<div>';
    }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any method so that I can split a text file in java
i need to get the string from on php file someone know how can
I want to know how i can split a string in php based on
Is there a way I can split a paypal charge with PHP? Im looking
Can split(string, array, separator) in awk use sequence of whitespaces as the separator (or
Do MySQL have any function by which I can split data of a column
When I write: MyClass *obj = [[MyClass alloc]init]; I can split in 2 parts:
How can I split a String by Unicode range in Ruby. I wanted to
How can I split a string such as Mar10 into Mar and 10 in
how can I split this barcode by group separator with Progress? I've tried chr(29)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.