By dm2243 on
Problem: In creating a flexinode content type with a "body" textarea, the label "body" shows up (unlike the regular story content type).
What's the easiest way to suppress the label "body"but not supress other custom fields?
Sorry what seems like a simple thing...i didn't any other forum posts or documentation about this.
Comments
U need to modify the CSS to acheive this
Hi,
There are actually two ways.
add this line to css
one way
.flexinode-textarea-6 .form-item label {
display: none;
}
another way
.flexinode-textarea-6 .form-item label {
font-size: 0px;
}
use only one method
Change the textarea-6 to relavent no
Both the ways worked for me.
Sunny "The Prince"
www.gleez.com
bad solution
Fixing html with css is not a great solution. ;)
CSS doesn't help with RSS output
CSS solutions don't fix RSS output, however--I cover the labels with CSS, but my RSS feeds are really ugly.
We need a better/real fix. Load flexinode_data values?
I've included my own PHP-based solution to the problem in a new response to the original post. Scroll down a bit to see that if you want something more than a CSS solution.
The fix you provided works as a temporary hack, so thanks for the help... but it's bad/insufficient in the long run for two reasons:
(1) As a previous poster pointed out, fixing HTML flaws with CSS is generally a bad idea. RSS feeds, browser incompatibilities, etc. come into play, and it means extra processing time, bandwith, etc.
(2) Even its "success" in making the page look better is limited. Different browsers handle CSS differently. So on some browsers, "-30px" will look great, whereas others will leave it looking shabby. For example, I've tried it so far on Mozilla and Safari. It looks decent on Mozilla, but still leaves too much space on Safari.
What I'd really like to do is load the flexinode_data field called textual_area, which has the actual text without all of the random baloney that the flexinode module cruelly inserts into the node's "body" data field. But I can't figure out an elegant way of doing this.
Does anyone know how I could use the UID to grab the textual_data field directly rather than relying on the insidiously formatted $node->body ?
To get rid of the big space
To get rid of the space left add the following to your css;
Margin can be adjusted until it is just right.
The only other option is to hack the module which I haven't succeeded in doing....yet.
gpdinoz
"If we see further it is because we are standing on the shoulders of giants"
Regards
Geoff
Similar problem!
I had to tweak the proposed fix a bit to get it working on my site, using the name (body) of the text area rather than the number:
.flexinode-body .form-item label {
display: none;
}
Cheers!
thanks courtnee!
your addition to my bluemarine 4.7.2 style.css file worked like a charm. :D
thanks for posting this!
Better Solution
A better solution to this problem is to draw on the data contained in the textual_data field of the flexinode_data table. Here's how I did it:
Since I'm using this method to ensure that nothing but my flexinode's body content displays when viewing such a node [no headers, sidebars, etc.], I inserted the following code at the very top of page.tpl.php:
This code checks to see if we are indeed viewing a node (Line 1). Then, loads the node's data (Line 2). Then, it determines if we are indeed viewing Flexinode Type 1 (Line 3). [You will have to change the 1 with the value of your desired flexinode.] Then, if we ARE viewing a Flexinode Type 1, it goes into the database and gets the textual_data field from the flexinode_data table. After displaying the raw data, it checks to see if there are any arguments at the end of the URL (things like "Edit", etc.), and displays the appropriate content if necessary. Finally, it "returns" so that the remainder of page.tpl.php does not execute.
When I'm viewing Flexinode Type 1, Drupal simply displays the contents of textual_data as though it were an independent/raw HTML file, then stops processing the page. The result is that Flexinode 1 is essentially a "static page" -- a page where the node's body is treated as pure HTML (or PHP, or whatever else I throw in there) without being processed by Drupal at all (no sidebars, no headers, etc.). This is helpful when you want to create a series of pages that are static, that look entirely different from the rest of your website, yet are editable using the Drupal interface. Of course, it creates the inherent security risk that someone will put malicious code in a Flexinode Type 1 node. But you can avoid this by only giving yourself permission to create such nodes (Access Permissions).
nobody yet mentioned node-flexinode-x.tpl.php?
If I understood well what you want to do, you need to write a node-flexinode-x.tpl.php. There you can choose what field's labels and field's content you will display or hide, and can apply any html/css to fit your needs.
You can see an example of this tpl.php in action here .
Read this, and search for 'node-flexinode-'.
But beware: flexinode 4.7.0 list of bugs is currently quite long...
Durval Tabach
Using PHPTemplate, here is how.
First: you find the relevant themeable function (called theme_flexinode_()) from the flexinode .inc file:
In this case, I'm using textarea as an example. field_textarea.inc has the following function:
Now, you must have a template.php file in your theme's directory. If you don't, create one now. Then, insert the same function call into the said template.php, but replace “theme” with “phptemplate”:
Finally, put anything inside the function you want, and return it. I use the
return $value;as the only row in the function in my textarea setup. But using _phptemplate_callback() as a return value gives almost unlimited possibilites to customise the output.Actually return $formatted_value is a better idea
Using
return $value;as I initially did at least disables <!--break-->. Perhaps it also has other potential side effects; better to usereturn $formatted_value;instead.