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 8694033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:41:08+00:00 2026-06-13T00:41:08+00:00

So I gather I can render a specific element of the $page[‘content’] array like

  • 0

So I gather I can render a specific element of the $page['content'] array like so…

<?php print render(field_view_field('node', $node, 'field_image')); ?>

Where out of the box this will render the element as expected with standard defaults. Ok, so how can I make sure that hand plucked element no longer renders in the <?php print render($page['content']) ?> call later?

Why do I want something dumb like this? Because every page WILL have a header image with a few css tricks for overlays, design and such. But not every page will have attachments, links, and so on… you know, things that are additional fields in the page. So I can’t manually print out each field since I don’t know how many or what else there is. All I know for sure is the field_image I’m printing above is wrapped in a ton of markup for styling and must be done this way. Same for a few other fields.

Basically I’m looking for a way to unset the field immediately after use.

Does anyone know how to achieve this? I’d rather not make a view or a custom block that displays for specific pages. I eventually have to hand this over to a client who will not be able to wrap their heads around a single page being administered over many places in the CMS.

  • 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-06-13T00:41:10+00:00Added an answer on June 13, 2026 at 12:41 am

    Looks like this will work:

    <?php
    print render(field_view_field('node', $node, 'field_image'));
    MYTHEME_remove_item($page['content'], 'field_image');
    ?>
    

    and in template.php file I made this function:

    function MYTHEME_remove_item(&$content, $field)
    {
        foreach($content['system_main']['nodes'] AS $key => $val){
            unset($content['system_main']['nodes'][$key][$field]);
        }
    }
    

    This is ridiculous, in my opinion. I would think a system as robust as drupal would have a solution for something like this. If anyone knows the proper way to do this I will gladly mark them as correct. In the meantime, for others facing similar situations, this worked for me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a system in PHP/Zend that can gather emails from various
How can I gather the visitor's time zone information? I need both: the time
I am trying to gather a list (array) of ids in a sector <div
I would like to gather usage statistics for my iPhone app using Google Analytics
I'd like to gather certain details of an SSL certificate on a particular web-site.
A normal page-flow with jQuery mobile looks somewhat like this: Starts on static page
numpy's ndarray class is defined as class ndarray(__builtin__.objects) From what I can gather, __builtin__.objects
I'm not experienced with cURL at all, but from what I can gather, it's
I have a textarea field where users can enter content. When it comes to
Parameter passing techniques: From what I can gather on these two techniques. Call By

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.