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.
$language object
and
$view_mode don't exist (anymore ?!!)
to get language string you need to do
$build["#language"];
and for view_mode you need
$build["#view_mode"]
and to get the $node object you need
$build["#node"]
Comment | File | Size | Author |
---|---|---|---|
#12 | use_correct_variable.patch | 3.68 KB | Berdir |
#10 | improve_template_documentation.patch | 3.66 KB | Berdir |
Comments
Comment #1
GiorgosKfooter only contains
$format
$key
$language (string not object)
$test_message
$unsubscribe test
it would be nice to have the $build object just like in the body template
but at least the $variables have to be documented correctly inside the .php files
Comment #2
BerdirPatches are welcome :)
Most changes are probably just due to underlying core changes, $build is simply whatever has been returned by node_view().
And it should be available in the footer as well.
Comment #3
GiorgosKI will provide patches
but the footer does not get the $build object (I checked with netbeans debugger)
please check again that build gets included
Comment #4
Olivier.b CreditAttribution: Olivier.b commentedI'm looking for the node url or the node id variable. How can i insert one of those in simplenews-newsletter-body.tpl.php ?
Comment #5
GiorgosK#4
next time open up a separate support request
should do it
Comment #6
Olivier.b CreditAttribution: Olivier.b commented#5
It doesn't work. This cause an error : "Notice : Undefined property: stdClass::$id in include()..."
I also tried
it just render an empty string.
Sorry if it's not the place to post this request i thought the subject of this issue was relevant for me because i just need documentation about "variables available in simplenews-newsletter-body.tpl.php"
Comment #7
GiorgosK;-)
well you are almost correct about the title
do a
to see what you have available in the body.tpl.php
footer.tpl.php has less variables available
Comment #8
BerdirI am positive that $build is there for the footer, it's used in the preprocess function.
Also, when you create a patch, you can probably remove the theme() functions for body/footer, they seem to be old and are obviously never used.
Comment #9
miro_dietikerRelated to
#374222: Template files do not work when using admin theme
There's happening a lot of cleanup.
Comment #10
BerdirThe patch adds back $language and $view_mode for the body template and updates the existing documentation.
Comment #12
BerdirThis one should pass.
Comment #13
BerdirCommited.