I'm working in a theme for my portfolio, and everything was going fine until an hour ago...

Drupal now overrides my theme without apparently explanation. It seems a strange issue, because Drupal prints DIVs and some other things that are not in my page.tpl.php, and it let me select some options but my theme has no options...

The theme is selected, I deleted cache, deleted all files from server and uploaded again, etc.

Do you know what is happening? I'll becaome crazy and I need to develop it soon...

Thanks

Comments

nevets’s picture

Without something more specific (and preferably a link) people are going to be hard pressed to help.

kram08980’s picture

But I'm not sure what to give you... I haven't had any problem with the theme until now. I haven't uploaded anything, so I cannot understand.

The website: http://www.dosta.net/

The DIVs I create in the page.tpl.php are:
-Header
-- Header Esquerra
-- Header Centre
-Contingut
-Footer

As you can see, the website has different DIVs now. And in the backend it gives me some options as Logo, Mission, etc. that I had never saw when creating a theme by myself. It seems Drupal takes it from other theme or something.

My info file has:
name = Dosta
description = Ole ole.
version = 1.0
core = 6.x

; Fulls CSS
stylesheets[all][] = estructura.css
stylesheets[all][] = elements-html.css

; Scripts
; scripts[] = graella.js

; Regions del disseny
regions[header_esquerra] = header esquerra
regions[header_centre] = header centre
regions[esquerra] = esquerra
regions[contingut] = contingut
regions[footer] = footer

nevets’s picture

If you validate the html (I use http://validator.w3.org/) you will find a number of errors including at least on unterminated div tag. I would first look at the content to see if thats a problem.

kram08980’s picture

This is the code i've in my page.tpl.php, inside my theme's folder. My problem is that Drupal seems to print something different...

<?php

?>
<!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" xml:lang="<?php print $language->language; ?>" lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>">

<head>
  <title><?php print $head_title; ?></title>
  <?php print $head; ?>
  <?php print $styles; ?>
  <?php print $scripts; ?>

</head>

<body class="<?php print $body_classes; ?>">

	<!-- #MAIN -->
	<div id="main">
			
		<!-- #HEADER -->
	    <div id="header">
		    
			<!-- #HEADER-ESQUERRA -->
	        <div id="header-esquerra">
	        
			<?php if ($logo || $site_name || $site_slogan): ?>
				<?php if ($site_name): ?>
					<?php if ($title): ?>
	    		        <div id="site-name"><strong>
		       		 		<a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home">
		        	    	<?php print $site_name; ?>
		            		</a>
	            		</strong></div>
					<?php else: ?>
						<h1 id="site-name">
							<a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home">
							<?php print $site_name; ?>
							</a>
						</h1>
					<?php endif; ?>
				<?php endif; ?>
		
				<?php if ($site_slogan): ?>
		           	<div id="site-slogan"><?php print $site_slogan; ?></div>
		        <?php endif; ?>
		    
		    <?php endif; ?>
		    </div> 
		    <!-- /#HEADER-ESQUERRA -->
		      
			<!-- #HEADER-CENTRE -->
		    <div id="header-centre">
		    	<?php if ($primary_links): ?>
		            <div id="primary">
		            	<?php print theme('links', $primary_links); ?>
		        	</div> <!-- /#primary -->
		    	<?php endif; ?>
		    </div>      
			<!-- /#HEADER-CENTRE -->
		
	    </div>
		<!-- /#HEADER -->
		
		<!-- #CONTINGUT -->
		<div id="contingut" class="graellaprojectes">

	        <?php if ($mission): ?>
	          <div id="mission"><?php print $mission; ?></div>
	        <?php endif; ?>
		
	        <?php if ($content_top): ?>
	          <div id="content-top" class="region region-content_top">
	            <?php print $content_top; ?>
	          </div> <!-- /#content-top -->
	        <?php endif; ?>
		
	        <?php if ($breadcrumb || $title || $tabs || $help || $messages): ?>
	          <div id="content-header">
	            <!-- 
	            /**<?php print $breadcrumb; ?> 
	            */
	            -->
	            <?php if ($title): ?>
	              <h1 class="title"><?php print $title; ?></h1>
	            <?php endif; ?>
	            <?php print $messages; ?>
	            <?php if ($tabs): ?>
	              <div class="tabs"><?php print $tabs; ?></div>
	            <?php endif; ?>
	            <?php print $help; ?>
	          </div> <!-- /#content-header -->
	        <?php endif; ?>
	
	        <div id="content-area">
	          <?php print $content; ?>
	        </div>
	
	        <?php if ($feed_icons): ?>
	          <div class="feed-icons"><?php print $feed_icons; ?></div>
	        <?php endif; ?>
		
	        <?php if ($content_bottom): ?>
	          <div id="content-bottom" class="region region-content_bottom">
	            <?php print $content_bottom; ?>
	          </div> <!-- /#content-bottom -->
	        <?php endif; ?>
		
		</div>
		<!-- /#CONTINGUT -->

	</div>
	<!-- /#MAIN -->
	


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

	    <?php if ($footer || $footer_message): ?>
			<?php if ($footer_message): ?>
		    	<div id="footer-message"><?php print $footer_message; ?></div>
	        <?php endif; ?>
	        <?php print $footer; ?>
	    <?php endif; ?>

    </div>
	<!-- /#FOOTER -->
	
  <?php print $closure; ?>

</body>
</html>
nevets’s picture

Is that file in /sites/all/themes/dosta? (it should be).

Do you have page caching enabled?

kram08980’s picture

First of all, thanks for all this help mate.

The file is there... I've changed nothing since it was working.

And I haven't the cache enabled, and cleared it lots of times last hour.. x(

I'm really disapointed with this...

mndonx’s picture

Hmm, very strange. It's loading your theme's stylesheet but not the page.tpl.php file, it seems? Is this a subtheme? Could it be a whitespace issue with the php tags at the very top of the tpl file?

You revisited the theme admin page and reselected & saved it? (It sounds like you did.)

Does the site see other templates, like node.tpl.php?

Amanda

kram08980’s picture

Yes, I did it all. At least, I've Garland as Admin Theme and i can administer without problems, but switched it and the problem is still there.

I copyed the Garland's top PHP tags and nothing.

The theme just hace the page-tpl.php, I deleted the other PHPs and nothing changed.

mndonx’s picture

Just to be sure, you mean page.tpl.php, correct? :)

Perhaps try disabling your page.tpl.php file (rename it to something like page-old.tpl.php), copy in a new, barebones one (like the default page.tpl.php here), and edit it so you would see if the tpl is being picked up.

If it is being picked up, then you can customize it to match page-old.tpl.php.

kram08980’s picture

Yes, I mean page.tpl.php.

I'm thinking directly to remove the Drupal installation...

Jeff Burnz’s picture

Can you check on the themes list page if the theme is actually enabled - sounds weird but just take a look (for one odd reason or another a theme can become disabled, but still set to default, and weird things happen IF this bug crops up).

Otherwise check you dont have another theme called exactly the same thing - say you made a copy?

And that you dont have another page.tpl.php file lurking in your theme folder or if applicable, a copy of the theme.

kram08980’s picture

Nothing, I deleted the themes folder, switched back to Garland, and tryied it again.

Jeff Burnz’s picture

I just realized you do not have a required bit of information in your themes info file.

engine = phptemplate

If you dont have that Drupal thinks its a pure PHP theme and starts looking for a .theme file, but cant find it, as a last resort Drupal is loading the core page.tpl.php file.

kram08980’s picture

This line was there, I deleted trying to solve the problem. Tryied again, and... you know... nothing!

The only strange thing I realized is that a dile without extension and the theme's folder name appear. But It's not uploaded, and I'm using Smultron in a Mac as always.

kram08980’s picture

It seems to be solved...

What I did is uncheck the logo in the theme's options. I think it was selected after the first problems.

Do you think if the logo was checked and I deleted it... all this could happen? All theme reprint? Seems strange. But it's the only thing I did.

Thanks to you all.

mndonx’s picture

My guess it was a combination of needing that line in the .info line, then resaving the theme settings (when you rechecked the logo) which may have gotten Drupal to recognize the change in the .info file. Or something like that. :) Glad you got it working!

Amanda

Jeff Burnz’s picture

Yeah, that's it exactly, I can replicate this issue with any theme by simply removing the engine declaration.