-2

Well, I wanted to switch over from single file Site, to Drupal, to manage the site easier. However, I wanted to use the theme I made, So i started trying to make it drupal comatiable, So it would work there, I got some working, But it does not Show the pages, post, but title and other things. Anyways, I am a newbie to theming in drupal. I used some help using Bratic theme, and some from a Website that had the variables that can be used. Code:

<!DOCTYPE html>
<!-- Theme created by Tek Owner of gameTek.me and tf2tek.com -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <title><?php print $htitle ?></title>
  <?php print $head ?>
  <?php print $styles ?>
  <?php print $scripts ?>
  <script type="text/javascript"><?php /* Needed to avoid Flash of Unstyle Content in IE */ ?> </script>

     <script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-32116318-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
<script type="text/JavaScript" src="jquery.js"></script>
<script type="text/JavaScript" src="main.js"></script>
     </head>
  <body>
<div id="Secret"></div>
        <div id="Container" >
        <div id="Left"></div>
        <div id="Right"></div>
        <div id="gLogo"></div>
        <div id="Spy"></div>
        <div id="Demo"></div>


        <div id="Top">
        <?php print $primary_links; ?>
         </div> 

         <div id="Header">
          <h1><?php print $title; ?></h1>
         </div>
         <div id="Content">
            <!-- Content or other goes here -->
                <?php print $content; ?>
         </div>

          <p>
                    <script type="text/javascript"><!--
google_ad_client = "ca-pub-4060951217224891";
/* Footer - gtek */
google_ad_slot = "9898201888";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
          </p>
         </div>
         <div id="Footer">
           <p><?php print $footer_message; ?></p>
         </div>
        </div>
    </body>
</html>

Demo: 84.234.160.79/drupal-7.15/

CSS:

body {

               background-image:url(Media/Background.jpg);

           }

            #Container {

                width:100%; 

                height:100%; 

            }

            #Left {
            position:absolute;
            height:100%;
            width:150px;
            left:-1px;
            background-image:url(Media/SideLeft.png);
            }
            #Right {
            position:absolute;
            height:100%;
            width:150px;
            right:-1px;
            background-image:url(Media/SideRight.png);
            }
            #gLogo {
            position:absolute;
            height:762px;
            width:197px;
            top:40px;
            left:10px;
            background-image:url(Media/Gtek90.png);
            }
            #Demo {
            display:none;
            position:absolute;
            height:414px;
            width:181px;
            top:110px;
            left:0px;
            background-image:url(Media/Demo.png);
            }
            #Spy {
            position:absolute;
            height:245px;
            width:270px;
            right:-25px;
            top:20px;
            background-image:url(Media/Spy.png);
            }
           #Top {

                position:relative;



                height:50px;

                text-align:center;

                vertical-align: middle;

                margin: 0px auto 0 auto;

                z-index:0; 

                background-image:url(Media/Nav.png);
                padding:0px;

                margin-top:-16px;

           }
           #Button {
           position:relative;
           top:11px;
           }

            #Header {

                position:relative;

                min-width:720px;
                max-width:80%;
                height:40px;

                text-align:center;

                margin: 0px auto 0 auto;

                z-index:0; 

                background-image:url(Media/Top.png);
                padding:0px;
                color:#BF0000;


            }
               #Nav {

                position:relative;

                min-width:720px;
                max-width:80%;
                height:40px;

                text-align:center;

                margin: 0px auto 0 auto;

                z-index:0; 

                background-image:url(Media/Nav.png);
                padding:0px;



            }

            #Content {

                position:relative;

                min-width:720px;
                max-width:80%;

                text-align:center;

                margin: 0px auto 0 auto;

                z-index:0; 

                background-image:url(Media/Content.png);

                padding:0px;

               margin-top:-16px;
               color:#FFA500;
               border-left:1px solid #000;
               border-right:1px solid #000;
            }

            #Footer {

                position:relative;

                min-width:720px;
                max-width:80%;

                height:26px;

                text-align:center;

                margin: 0px auto 0 auto;

                z-index:0; 

                background-image:url(Media/Bottom.png);

                padding:0px;

               margin-top:-16px;

               border-top:1px solid #000;

               line-height:1px;

            }

closed as not a real question by kiamlaluno Oct 19 '12 at 22:35

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

  • What exactly you need ? be specific. Why you have pasted your code here? – Dinesh Kumar Sarangapani Oct 1 '12 at 10:11
  • Hello, and welcome on Drupal Answers. This question is too broad to be answered. It is not possible to give in a single answer all the tips about converting a theme to Drupal. You are also showing only two of the files needed to build a Drupal 7 theme. – kiamlaluno Oct 19 '12 at 22:34
0

You are using D7 so instead of printing the $content variable, you should do it this way:

print render($page['content']);

Few other things:

  • D6 and D7 have some differences in outputting the variables. Make sure you are following up tutorials/reading articles about D7.
  • You should not include the scripts/styles directly in the template. Place them in theme's .info file and Drupal will do that for you. This way Drupal can compress them if your performance settings are saved that way.
  • $main_menu should be $main_menu, 'attributes' => array('id' => 'main-menu', 'class' => array('links', 'inline', 'clearfix')), 'heading' => t('Main menu'))); ?>

See this link to get started on theming with Drupal:

Check existing themes in more details (Bartik for example) and see how they are made and structured.

Hope this helps.

0

Having a glance at your demo site, I suggest you to use a per-existing theme which has lots of regions that resembles your web layout. Instead of coding your theme from scratch, you can leverage Drupal's block system to place items in the required regions and add custom css styling. I suggest you Corolla Theme, which has a lot of regions that can be used for your website and it also supports mobile devices.

Not the answer you're looking for? Browse other questions tagged or ask your own question.