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.
Hello,
many thanks for this module
i would like to use it on a site where users set their location (postal code or city) in their user profiles (module profile from core)
instead of defining a block for the entire site i would like to get their locations in their profiles and display specific information. fallback to London if no info from profile.
can you please point some directions to make it happen?
i'll share the code so that anybody could have this new feature as well
thanks
Comments
Comment #1
miaoulafrite CreditAttribution: miaoulafrite commentedwell, seems that i did find a "solution"
i use google_weather_show() function with argument $account->profile_city
if you have a better solution, please provide it, otherwise, mark the topic as fixed
thanks
Comment #2
easyRider CreditAttribution: easyRider commentedmiaoulafrite Wich file did you edit? i want to do the same but with a cck field from a node.
thanks in advance
Comment #3
miaoulafrite CreditAttribution: miaoulafrite commented@easyRider: i used it in template.php from my theme but you could use it directly in your page.tpl.php
i also copied & modified the .tpl.php file provided by the module to display only tomorrow forecast
you should also be able to call this function from a block
Comment #4
miaoulafrite CreditAttribution: miaoulafrite commentedi close the issue until someone comes with a better proposal
Comment #6
liminu CreditAttribution: liminu commentedTo work with location module, it take the location of the current node (place in node.tpl.php or in contemplate module)
<?php echo google_weather_show($node->locations[0]['city'],"5"); ?>
where 5 is the forecast day (5 is the max value)