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).



nevets’s picture

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.

Pedro_Alves’s picture

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?


nevets’s picture

Create a module, see the link above.

Pedro_Alves’s picture

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.