Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
When I first open the template to edit it, the only code displayed is a print $body
even if all my fields are present in the body variables.
Is this a normal behaviour? I believed the textfield would show some html code with php for variables but not just a print $body line.
I think I missed something but I don't see what. I tried to use alpha and dev version, deleting conemplate tables between these tests for the same result.
Comments
Comment #1
glide CreditAttribution: glide commentedWas there any resolution on this, I'm seeing the same thing, the UI just shows print $body in the template area, not all the usual php and html goodness I was able to edit back in D6
Comment #2
dgtlmoon CreditAttribution: dgtlmoon commentedI'm not sure what you mean, current D6 and D7 versions all just give you the
print $body
If you click on a field in the 'Body Variables' textarea it will insert that variable, is that what you mean?
Comment #3
glide CreditAttribution: glide commentedYou seem to have answered my question in that this is the expected output, but I was used to how in showed back in ver 6.x-1.2 as an example
example of OLD RSS template:
example of NEW RSS template:
If the "new" way is to start with an essenially blank slate, then it is working as expected, just not what I was expecting. Before I could just do a few edits and get things like I wanted them, now I have to recontruct the entire page from scratch.
Comment #4
dgtlmoon CreditAttribution: dgtlmoon commentedAah i see what you mean, it used to render the whole content type out, right? (i've just picked up maintenance of this module so hang in there.. )
Comment #5
dgtlmoon CreditAttribution: dgtlmoon commentedthis is going back to a bug, because the D6 worked and users would expect the D7 to behave much the same
Comment #6
dgtlmoon CreditAttribution: dgtlmoon commentedWonder why, git blame says this stuff has not changed in a long time, will have a look into it
Comment #7
glide CreditAttribution: glide commentedthats correct, or at least what used to be correct...
Comment #8
dgtlmoon CreditAttribution: dgtlmoon commentedAlso, are you editing a CCK field or something not from CCK?
Comment #9
glide CreditAttribution: glide commentedIm editing a custom CCK content type.
But i see the same behavior even if I pick one of the standard default types.
Comment #10
dgtlmoon CreditAttribution: dgtlmoon commentedOK yes, got it, D6 uses CCK and D7 uses fields, so contemplate_cck_get_fields(...) needs to refactored
Comment #11
dgtlmoon CreditAttribution: dgtlmoon commentedtry latest dev
Comment #12
glide CreditAttribution: glide commentedLatest dev wouldnt show up in the modules list after i installed it. I did notice the rc3 was updated last night as well, so tried that and it seems to be working. Did you change both?
Comment #13
dgtlmoon CreditAttribution: dgtlmoon commentedYes, but theres a new issue with some CCK fields, so it still requires some work.
latest dev output in the template is (for image)
cant figure out how to get any finer rendering of the fields just yet, try current dev and see how it works for you
Comment #14
dgtlmoon CreditAttribution: dgtlmoon commenteddont forget to hit [delete] on the template to rebuild it
Comment #15
glide CreditAttribution: glide commentedswitched to dev, text fields are working, but as you said image links are still mucked up. getting:
Which then generates:
Which clearly doesn't output a picture.
The variables section also isnt giving anything more than
Where my outdated D6 version gives
Comment #16
dgtlmoon CreditAttribution: dgtlmoon commentedimages cant be handled the same way, because $node does not actually contain the image path. it contains the resource, so i'm not sure what todo, ideas?
Comment #17
dgtlmoon CreditAttribution: dgtlmoon commentedField theming has some layer of abstraction, it relies on $variables not $node
Comment #18
dgtlmoon CreditAttribution: dgtlmoon commentedSo basically, it all comes down to the fact that
is not available in the $node anymore because they leave the theming until the last minute in D7
so I think what we need todo is add some extra values, or make an extra obejct available as well as $node
so you have
$node - for general node stuff
$content - for content rendered, like field $content->field_staff_pic[$node->language][0]['safe_value'];
Comment #19
dgtlmoon CreditAttribution: dgtlmoon commentedD7 is also waiting for CCK tokens to be working #691078: Field tokens
using tokens would be nice too
Comment #20
glide CreditAttribution: glide commentedyeah it looks like this might be about as far as things go until a couple more things open up. Thanks for your updates though. They help enormously.
Comment #21
Danny EnglanderSubscribing, having the same issue.