Search code examples
phpcssdrupaldrupal-7themes

How set the image of a node to the left of the other info in Drupal?


I created a content type for books with Drupal (Structure->Kind of contents) and added fields for name, description, year of publication, etc. The default layout with CorporateClean theme looks like this:

current layout

And I would like it to be like this :

desired layout

I tried to include the following lines in style.css in my theme directory:

#content img {
float:left;
margin-right: 15px;
}

And I get this result :

enter image description here

What is the best way to customize a Drupal content with fields ?

Does a dedicated module exist ?

I read about php files (in theme directory) to customize specifics contents. Do you have experience with that?


Solution

  • in your style.css add this lines at the end:

    In the Corporated Clean theme this works:

    #content img {
    float:left;
    margin-right: 15px;
    }
    
    #content .field {
    float:left;
    width: 70%;
    }
    
    #content div.field-type-image  {
    width: auto;
    }
    

    In the Mayo theme this works:

    #content img {
    float:left;
    margin-right: 15px;
    }