It will be great if flexinode has possibility (checkbox when creating field) to hide field name when viewing created node.

Example:
Add field "Further instructions" as textarea. Then create node and it will look like this:

...
BLA BLA FOO BAR

Further instructions:
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Proin interdum condimentum ante. Donec dapibus convallis turpis. Pellentesque turpis. Ut tellus. Integer pharetra mollis ante. Maecenas viverra vehicula augue. Nullam nisl dolor, adipiscing a, placerat ac, tempus non, quam. Etiam aliquet pretium orci. Donec quis lorem.
...

Yes, it is possible to format flexinode output using css, because new field will have CSS class item-further-instructions, but this approach has two main disadvantages:
1) what about text browsers without support for display: none?
2) what about international characters? Just create field with name "ěščřžýáíé" and CSS class will be item-ěščřžáíáé

Comments

magico’s picture

Take a look at FlexiMAX
In my case, because the theme is very specific for a site, I choose to do a node-flexinode-x.tpl.php where then I select how fields should be displayed. See a sample site at http://pjn.pt/

Julien PHAM’s picture

Sure but it doesn't work for teasers.

If you put:
print $node->flexinode_7
Then you'll have your field displayed without field name, but this will be the whole node.

If you put:
print $node->teaser
Then the field names will be displayed as well...

(I do not talk about fleximax, I havent tried it yet)

Julien PHAM’s picture

Fleximax seems to be interesting... but it is a patch for flexinode / drupal 4.6... I'm using cvs version of drupal...

RayZ’s picture

nevets’s picture

Note that the template for flexinode (as well as any node based template) has a variable called $teaser. So you can format both the teaser and the non teaser view as you see fit by checking $teaser. In general terms your file might look something like

<?php if ( $teaser ) : ?>
... formatting for teaser ....
<?php else : ?>
.... formatting for non-teaser ....
<?php endif; ?>

In actually pratice if the teaser is a subset of the full view you might use the $teaser variable to exclude parts of the output when viewing the content.

Julien PHAM’s picture

For Rayz. In the example provided on the webpage, there are two fields, one for the teaser, one for the remaining of the node it seems... but drupal does not work like that... with other nodes than flexinodes, it handles teasers perfectly by itself without having to create two fields...

For example, my flexinode has a title, a subtitle, and a text field. Only ONE text field, called flexinode_7. So, sure I can test the $teaser variable (another solution is to test the page variable as well), but what can I do in the "if"? Can I tell drupal to only take the beginning of flexinode_7?

If I print $content, it takes the teaser the drupal way, so perfectly, except that the field name is displayed.

So what can I do with my flexinode_7 to display only the beginning?

Thanks

Julien PHAM’s picture

btw, to hide field name, you have to edit the style.css (thanks to the creator of fancy theme who explained me this).

My code:

.flexinode-textarea-7 .form-item label {
  display: none;
}

So, just adapt it to your situation...

Bèr Kessels’s picture

Status: Active » Closed (works as designed)