The pertinent lines of code seem to be Line 675 of flexinode.module, and Line 65 of field_textarea.inc

Logically, it seems that I could make it negate the output of content if $field->field_type was a specific number, but I have no idea how to edit to code to accomplish this, since the way the code seems to work is that it immediately inputs all fields, and there seems no easy way to change this.

( Line 686: $node->body .= theme('flexinode_'. $field->field_type, $field->field_id, $field->nullity, $node->$fieldname, $data); )

Does anyone have any suggestions as to how I might make a certain field not render? It is of course possible to do this via CSS, which is what I'm doing, but this is probably non-optimal.

Comments

Dublin Drupaller’s picture

Hi Xand,

Am trying to do something similar...did you work out how to control the flexinode content?

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

Marandb’s picture

Ahh... as am I...

Any solutions?

Thanks.

Dublin Drupaller’s picture

this is as far as I got...hope it helps..

http://drupal.org/node/25055#comment-43801

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

xand’s picture

wow.

sorry i never said how i managed it.

I used CSS.

I used flexinode, created two fields, made only one show in teaser and used that field as the teaser

Both fields obviously also appear in the full view, but i used CSS to make the teaser field invisible.

this is with 4.5.* though; i don't know if it'll work with 4.6

Egon Bianchet’s picture

  1. create node-flexinode-{$flexinode_type_id}.tpl.php and fill it with something like
    <div class="myflexinode">
    <?php if (!$page): ?>
       <-- teaser -->
       <a href="/<?php print $node_url ?>"><?php print $title ?></a>
       <?php print $node->flexinode_{$field_id} ?>
    <?php else: ?>
         <-- body -->
         <?php print $content ?>
    <?php endif; ?>
    </div>
    
  2. in template.php add something like this:
    /**
     * Override theme_flexinode_image() from modules/flexinode/field_image.inc
     */
    function phptemplate_flexinode_image($field_id, $label, $file, $formatted_value) {
      // empty 'stub' function
      return _phptemplate_callback('flexinode_image', array('field_id' => $field_id, 'label' => $label, 'imgfile' => $file, 'formatted_value' => $formatted_value));
    }
    
  3. in flexinode_image.tpl.php put:
    <?php
    if ($label != 'Icon' && $label != 'Header') {
      print '<div class="flexinode-image-'. $field_id .'">' . $formatted_value .'</div>';
    }
    ?>
    

    So every flexinode image field labeled as 'Icon' or 'Header' won't be shown in body.

Obviously you'll have to change {$flexinode_type_id} and {$field_id} with the right numbers.

stmh’s picture

So, here's my solution wihtout patching or modifying the core or the flexinode_module.

Basically you create an implementation of theme_node and check there the type of the node. If the node is your flexinode then call a custom function which replicates the code of the flexinode_module flexinode_content and which checks the field-names to add them to the corresponding block.

Sorry, no code, can't paste it in here -- for unknown reason, suspicious data.

HTH,
Stephan