So I installed Inline Module and got it working. Nice! But then I decided to theme my node... that's when the trouble began..
I noticed that when I use <?php print $node->content['body']['#value'] ?> to output the body of my node, the inline token doesn't turn into the image! I just get the [inline: 1]...
Is there some issue with the way Inline module switches out the token when trying to print the body field?
Thanks for your help!
Comments
Comment #1
sunNot that I'm aware of - are you sure you enabled the Inline filter for the used input format of this node?
Comment #2
tflmike commentedHi Sun-
Thanks for the reply!
Yeah, I have the input type set up correctly... because when I display the node by itself (without trying to theme it) the inline image works fine. So for example: if I use (in my node-content_type.tpl.php file)
<?php print $node->body ?>the body field will print out fine with the inline image... but the only issue is I also get all the other node fields too. I'm trying to separate the body field (with the inline image) from the rest of the node fields for themeing.So I tried
<?php print $node->content['body']['#value'] ?>to get the body field specifically, but then the inline image doesn't show up (only the token).Last night I was staring at the inline module's code, hoping something would stand out, and I think I might have a new way to approach this. I'm going to try to write a theme function in template.php, to try to separate the CCK fields from the $body field. That way I can just use
<?php print $node->body ?>and it will print just the body field without the others... that's the theory anyway! ;-)I'm just thinking that by printing just the field by itself, I'm losing the image processing that happens when the $node->body is displayed. So perhaps it's better to try to remove those extra fields in at the template.php level as opposed to the theme level... Hope this makes some sort of sense... I was up late last night playing around with this!
Or if you have a better approach I'd love to hear it! Thanks!
Comment #3
tflmike commentedI tried this but it didn't quite work...
I'm new to writing functions, so I'm sure there might be something missing... in fact, I don't know if it's even possible to theme a node content type! Hmmmm time to go post that question in the theming forums...
Updated:
So I think that my attempt to print out only the body field is not processing the inline image. I just need to figure out how I can include the inline image processing when printing only the
$node->content['body']['#value']field.Comment #4
tflmike commentedI've been trying to theme the $node->body (as stated above) but then I came across this issue (http://drupal.org/node/134478) which suggests that for the time being, there's no way to effect the output of $node->body at the template.php or node-content_type.tpl.php level. It would basically take hacking Drupal core... which I dare not do...
So then I thought, "Ok, I'll just set up a custom body field with CCK." But then I came across this issue (http://drupal.org/node/120425) which basically says that Inline module doesn't work with CCK fields and that this functionality is going to be added to InlineAPI.
So I guess I need to either try to build my own module (yeah right :-) –- I'm a noob) or just wait until InlineAPI. Is there anyway I can help with the project to move things along?
Comment #5
sunWell, I'll mark this duplicate of #120425: CCK textfield support then.
Although I still do not advise people to upgrade to Inline API (5.x-2.x), you're welcome to be my tester. Basically, the API is in shape, and if it needs to be changed, I will probably write required update functions to ensure that existing contents will won't break. ...well, I can't really guarantee that, but I will definitely try.
Comment #6
tflmike commentedSun-
Cool... I'd love to help test! How can I get started in a way that would be most helpful to you? Shall I just download and install 5.x-2.x-dev and start messing with it?
Comment #7
sunYep, just use the current development snapshot.
Comment #8
tflmike commentedOk.. great. Is there a specific place you'd like me to post my findings? Or would I just put them in the bugs area?
Cheers!
Comment #9
tflmike commentedSun-
I downloaded and installed 5.x-2.x-dev and even after setting it up, I couldn't get it to work. So I used 5.x-1.x-dev instead, which seems to work, but is the old version and not the InlineAPI?
I've been continuing to struggle with getting the inline images to process/show up when I separate cck fields by using
<?php print $field_cckfield['0']['value'] ?>. I recently tried to use_inline_substitute_tags($node, 'cckfield');in my node-node_type.tpl.php file but it doesn't seem to work. Is there a way process a custom cck field through the node template file to include the inline image when it's printed with<?php print $field_cckfield['0']['value'] ?>?Danke!
Comment #10
splash112 commentedSame problem here.
Can't get inline images to show up on my custom node page (ubercart product page).
The way it will show your images is to sadly drop inline and start working with image and image assist. This combination has no problem showing the images in $node->content['body']['#value'].
Comment #11
jaypabs commentedThe problem still exist on drupal v6.x. Is there any work around on this?