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.
By Pedro_Alves on
Hi,
I'm starting with drupal, and I'm having some problems. I need use a php code in my project, for some specific situations.
Is it possible to create a module for generate a php code and use in a block (for example, to display a list of products)? If yes, how I make this?
(I do not want insert php code in database, because I need use SVN).
Thanks.
Comments
For producing a list of
For producing a list of product, content (and other things) I would look at the views module first before using PHP code.
For your PHP and block question see Creating modules - a tutorial: Drupal 7.x, specifically items 1, 2 and 6 in the list at the end of the page.
thanks nevets for your
thanks nevets for your replay.
So, I need use php code, because I will connect in other database (external database) for show some products. I've developed the php code. So, I wanna use this code in the drupal, in a way that I can use in SVN too without problems. Do you know another way to do this?
Thanks!
Create a module, see the link
Create a module, see the link above.
I got it xD. This work fine.
I got it xD. This work fine. Now, a having some problems with block position, but I believe that is easy. I try put in content region, but I don't get yet.
Thanks Nevets by suport.
See ya.