Comment realiser ce genre de theme

Information importante

En raison d'un grand nombre d'inscriptions de spammers sur notre site, polluant sans relache notre forum, nous suspendons la création de compte via le formulaire de "sign up".

Il est néanmoins toujours possible de devenir adhérent•e en faisant la demande sur cette page, rubrique "Inscription" : https://www.drupal.fr/contact


De plus, le forum est désormais "interdit en écriture". Il n'est plus autorisé d'y écrire un sujet/billet/commentaire.

Pour contacter la communauté, merci de rejoindre le slack "drupalfrance".

Si vous voulez contacter le bureau de l'association, utilisez le formulaire disponible ici, ou envoyez-nous un DM sur twitter.

Bonjour a tous,

J'aimerais créer mon thème sous drupal mais je ne sais pas si ce que j'ai en tête est réalisable.

Premièrement j'ai créé le layout basique en html et css http://www.aubweb.be/drupal_test/home.html (voir code plus bas si nécessaire)

Maintenant comment puis-je faire ça avec drupal ?
Je connais l'html, css, javascript, php ... mais je connais la bonne manipulation pour faire ça sous drupal.

Merci d'avance !

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Home</title>
<link href="style.css" rel="stylesheet" type="text/css" /><!--[if IE]>
<style type="text/css">
/* place css fixes for all versions of IE in this conditional comment /
.twoColHybRtHdr #sidebar1 { padding-top: 30px; }
.twoColHybRtHdr #mainContent { zoom: 1; padding-top: 15px; }
/
the above proprietary zoom property gives IE the hasLayout it may need to avoid several bugs */
</style>
<![endif]-->
</head>

<body class="twoColHybRtHdr">

<div id="container">
  <div id="header">
    <h1>Header</h1>

  <!-- end #header --></div>
  <div id="menu">
    <h1>Menu</h1>
  <!-- end #Menu --></div>
  <div id="sidebar1">
    <h3>Right Column</h3>
    <p>.</p>

    <p>.</p>
    <p>.</p>
    <p>.</p>
    <p>.</p>
    <p>.</p>
    <p>.</p>

    <p>.</p>
    <p>.</p>
    <p>.</p>
    <p>.</p>
    <p>.</p>
    <p>.</p>

  <!-- end #sidebar1 --></div>
  <div id="mainContent">
    <div id="mag">
    <div id="article">
    <div id="image">
    photo
    <!-- end #image --></div>
          
    <!-- end #article --></div>
        <div id="article">

        <div id="image">
    photo
    <!-- end #image --></div>
          
        <!-- end #article --> </div>
        <div id="article">
    <div id="image">
    photo
    <!-- end #image --></div>
    <!-- end #article --></div>

    <!-- end #mag --></div>
   <div id="bottom">
        <div id="news">
  
    <!-- end #news --></div>
            <div id="news">
  
    <!-- end #news --></div>
  <!-- end #prod --></div> 
      
<!-- end #mainContent --></div>
<!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats -->

<br class="clearfloat" />
  
<div id="footer">
    <p>Footer</p>
  <!-- end #footer --></div>
<!-- end #container --></div>
</body>
</html>

et voila le css :

@charset "UTF-8";
body  {
font: 100% Verdana, Arial, Helvetica, sans-serif;
background: #666666;
margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults /
padding: 0;
text-align: center; /
this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector /
color: #000000;
}
.twoColHybRtHdr #container {
width: 80%;  /
this will create a container 80% of the browser width /
background: #FFFFFF;
margin: 0 auto; /
the auto margins (in conjunction with a width) center the page /
border: 1px solid #000000;
text-align: left; /
this overrides the text-align: center on the body element. /
}
.twoColHybRtHdr #header {
background: #DDDDDD;
padding: 0 10px;  /
this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. /
}
.twoColHybRtHdr #header h1 {
margin: 0; /
zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse /
padding: 10px 0; /
using padding instead of margin will allow you to keep the element away from the edges of the div /
}

/ Tips for sidebar1:
1. Since we are working in relative units, it's best not to use padding on the sidebar. It will be added to the overall width for standards compliant browsers creating an unknown actual width.
2. Since em units are used for the sidebar value, be aware that its width will vary with different default text sizes.
3. Space between the side of the div and the elements within it can be created by placing a left and right margin on those elements as seen in the ".twoColHybRtHdr #sidebar1 p" rule.
/
.twoColHybRtHdr #sidebar1 {
float: right;
width: 20em; /
since this element is floated, a width must be given /
background: #EBEBEB; /
the background color will be displayed for the length of the content in the column, but no further /
padding: 15px 0; /
top and bottom padding create visual space within this div  /
}
.twoColHybRtHdr #sidebar1 h3, .twoColHybRtHdr #sidebar1 p {
margin-left: 10px; /
the left and right margin should be given to every element that will be placed in the side columns /
margin-right: 10px;
}

/ Tips for mainContent:
1. The space between the mainContent and sidebar1 is created with the right margin on the mainContent div.  No matter how much content the sidebar1 div contains, the column space will remain. You can remove this right margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends.
2. Be aware it is possible to cause float drop (the dropping of the non-floated mainContent area below the sidebar) if an element wider than it can contain is placed within the mainContent div. WIth a hybrid layout (percentage-based overall width with em-based sidebar), it may not be possible to calculate the exact width available. If the user's text size is larger than average, you will have a wider sidebar div and thus, less room in the mainContent div. You should be aware of this limitation - especially if the client is adding content with Contribute.
3. In the Internet Explorer Conditional Comment below, the zoom property is used to give the mainContent "hasLayout." This may help avoid several IE-specific bugs.
/
.twoColHybRtHdr #mainContent {
  margin: 0 22em 0 0; /
the left margin's value is equal to the header and footer which creates alignment down the left side of the document. /
}
.twoColHybRtHdr #mainContent #mag{
  background-color:#CCC;
  height:400px;
  padding: 75px 15px 0 400px;
}
.twoColHybRtHdr #mainContent #bottom{
  background-color:#CCDDDD;
}
.twoColHybRtHdr #mainContent #bottom #news{
background-color:#44DDDD;
float:left;
width:50%;
height:175px;
}
.twoColHybRtHdr #mainContent #article{
  background-color:#FFFFFF;
  width:250px;
  height:100px;
  margin: 0 0 15px 0; /
the left margin's value is equal to the header and footer which creates alignment down the left side of the document. /
  display:block;
  float: right;
}
.twoColHybRtHdr #mainContent #article p{

}
.twoColHybRtHdr #mainContent #article #image{
  background-color:#009900;
  width:90px;
  height:90px;
  padding:5px 5px 5px 5px;
  margin: 0 0 0 0; /
the left margin's value is equal to the header and footer which creates alignment down the left side of the document. /
}
.twoColHybRtHdr #footer {
padding: 0 10px; /
this padding matches the left alignment of the elements in the divs that appear above it. /
background:#DDDDDD;
}
.twoColHybRtHdr #footer p {
margin: 0; /
zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs /
padding: 10px 0; /
padding on this element will create space, just as the the margin would have, without the margin collapse issue /
}

/ Miscellaneous classes for reuse /
.fltrt { /
this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. /
float: right;
margin-left: 8px;
}
.fltlft { /
this class can be used to float an element left in your page /
float: left;
margin-right: 8px;
}
.clearfloat { /
this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
clear:both;
    height:0;
    font-size: 1px;
    line-height: 0px;

}

Version de Drupal : 

télécharge un theme sur le site officiel de drupal (je te conseil zen, qui contient un theme "vierge") très pratique pour commencer.

Suit les indications d'installations des theme zen, car ils sont un peu particulier.

Ensuite, quand tu auras fait tout ca, tu édit les fichiers .tpl.php qui sont dans ton theme pour y mettre ton HTML au bon endroit.