I am converting aboutpeople theme to Drupal 7, but I'm a non-coder type, so it will be a bit of trial and error. I thought that it might be useful to document here for others to follow and comment. Any objections?

CommentFileSizeAuthor
#6 aboutpeople-7.tar_.gz177.42 KBScott J

Comments

Scott J’s picture

First I have split the top off page.tpl.php and added it to html.tpl.php as required by D7. It works, but as expected, Drupal returns the following errors:

  • Notice: Undefined variable: header in include() (line 2 of /var/www/drupal-7/sites/all/themes/aboutpeople/page.tpl.php).
  • Notice: Undefined variable: search_box in include() (line 13 of /var/www/drupal-7/sites/all/themes/aboutpeople/page.tpl.php).
  • Notice: Undefined variable: secondary_links in include() (line 46 of /var/www/drupal-7/sites/all/themes/aboutpeople/page.tpl.php).
  • Notice: Undefined variable: left in include() (line 52 of /var/www/drupal-7/sites/all/themes/aboutpeople/page.tpl.php).
  • Notice: Undefined variable: right in include() (line 52 of /var/www/drupal-7/sites/all/themes/aboutpeople/page.tpl.php).
  • Notice: Undefined variable: mission in include() (line 54 of /var/www/drupal-7/sites/all/themes/aboutpeople/page.tpl.php).
  • Notice: Undefined variable: content_top in include() (line 56 of /var/www/drupal-7/sites/all/themes/aboutpeople/page.tpl.php).
  • Notice: Undefined variable: help in include() (line 69 of /var/www/drupal-7/sites/all/themes/aboutpeople/page.tpl.php).
  • Notice: Undefined variable: content in include() (line 74 of /var/www/drupal-7/sites/all/themes/aboutpeople/page.tpl.php).
  • Notice: Undefined variable: left in include() (line 78 of /var/www/drupal-7/sites/all/themes/aboutpeople/page.tpl.php).
  • Notice: Undefined variable: right in include() (line 84 of /var/www/drupal-7/sites/all/themes/aboutpeople/page.tpl.php).
  • Notice: Undefined variable: footer in include() (line 94 of /var/www/drupal-7/sites/all/themes/aboutpeople/page.tpl.php).
  • Notice: Undefined variable: footer_message in include() (line 95 of /var/www/drupal-7/sites/all/themes/aboutpeople/page.tpl.php).
Scott J’s picture

The only documentation that I know of is Converting 6.x themes to 7.x. If anyone has any other help, please let me know.

Scott J’s picture

Here is the outline of page.tpl.php

<noindex>
<div id="megatopregion">
    <div id="headerblock">
    </div> <!-- /#headerblock -->
        <div id="loginline">
        </div> <!-- /#loginline -->
        <div class="drdot"><hr />
        </div>
</div> <!-- /#megatopregion -->
</noindex>

<div id="utilities">
    <div id="utilities_corner">
        <div id="plinks">
        </div> <!-- /#plinks -->
    </div> <!-- /#utilities_corner -->
</div> <!-- /#utilities -->

<div id="page">
    <div id="header">
    </div> <!-- /#header -->
    <div id="submenu">
    </div>
    <div class="stopfloat">
    </div>
    <div class="wrapper"><!--wrapper:defines whole content margins-->
        <div id="primary">
            <div class="singlepage">
                <div id="sitemission">
                </div>
            </div> <!-- /#singlepage -->
        </div> <!-- /#primary -->

<!-- left -->
        <div class="lsidebar">
        </div> 
<!-- right -->
        <div class="rsidebar">
        </div>
<div class="clear"></div>
    </div> <!-- /#wrapper -->
</div> <!-- Close Page -->

<div id="footer">
</div> <!-- /#footer -->

I have commented the closing divs so that we can find them after adding the code back in.

ddd2500’s picture

I have the some problem as yours.
Notice: include() 中的 Undefined variable: search_box (/home/www/deng.in/public_html/sites/all/themes/ruoMarket/templates/page.tpl.php 的 128 行)

Scott J’s picture

Yep,
search_box is not available in Drupal 7, you must use /admin/structure/block to place 'Search form' in a block of your choice.

I'll upload my theme so far to show my progress.

Scott J’s picture

StatusFileSize
new177.42 KB

Here is a working version. I'm not a programmer, so I have just deleted functions that I don't understand from template.php to get it working. It now seems safe to use as default and administration theme.

Scott J’s picture

Assigned: Scott J » Unassigned
Status: Needs work » Active

Getting back to this now that D7 has been released.

I thought that it may be possible to keep style.css file from D6 unchanged, to make it easy for anyone with custom styling or a sub-theme, but now I think that a couple of changes are necessary:

.defaultblock » .block 
.blockcontent » .content 
#primary .blockcontent » #primary .block .content
.loginblock » #block-user-login 
#sitemission » .region-highlighted 
comment_add » comment-add 
.node_read_more » .node-readmore 
.taxonomy » .field-type-taxonomy-term-reference 
.picture » .user-picture 
.terminfo » .taxonomy-term-description
.book_printer » .book-printer 
.book_add_child » .book-addchild 
#footer {font-size:0.75em;font-weight: normal;} » #footer .content{font-size:0.75em;font-weight: normal;} 
++ #footer .block {background-image: none;} 
Scott J’s picture

Assigned: Unassigned » Scott J
Status: Active » Needs work

You may wish to translate the Italian word "destra" into the English word "right" in line 634:
#primary .singlepage img.destra » #primary .singlepage img.right

The Italian "altobasso" at line 641 literally means "highlow" so I'm not sure what to do with #primary .singlepage img.altobasso but it seems to just be undoing everything that was applied with img.destra.

Also according to Google translate, the Russian phrase "Выводим в одну строку элементы списка и отступы между ними" at lines 1658 and 1664 /*login line*/ is something like "Derive the one-line list items and indenting between".

Scott J’s picture

There is a problem with block styles such as .defaultblock{} and .blockcontent{} , which were originally only targeting sidebar blocks. If we change those to .block .content{} they will override the content region also, as the main content region is now a block.

I guess I need to be more specific with selectors, and probably add #primary .region-content .block{} selector some-place.

jpruizs’s picture

Assigned: Unassigned » Scott J
Status: Active » Needs work

I'm using Drupal 7 and I got the same error:

Notice: Undefined variable: search_box in include()

The problem is that I've created a new template file (page--front.tpl.php) and the search box doesnt appear.
What can I do?