I hope this is the right place to post this...Playing around with creating a Marinelli subtheme off of 7.x-3.0-beta4. Coped the subtheme folder and renamed, etc., and then copied the page.tpl file and got it working. When I tried to move the Primary Menu code below the rotating banners (just a straight copy-and-paste of the if statement and div), the advertisment region now shows three banners as active, stacked atop one another over the entire page. I don't see anything obvious that would make this happen. Is this a bug, or am I just too inexperienced and unread as to the intracacies of the theme? Is there a way to make this work? Thanks, and sorry again if this is the wrong place to post this.

CommentFileSizeAuthor
#13 screenshot.png694.63 KBdwalker51
#3 marinelliscreen.jpg25.38 KBManchesterNewsGuild
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Lioz’s picture

Assigned: Unassigned » Lioz
Status: Active » Postponed (maintainer needs more info)

Can you please attach your version of the page.tpl.php?

ManchesterNewsGuild’s picture

Will do as soon as I get access. It's on a local test site and I'm away from that. Thanks for responding.

ManchesterNewsGuild’s picture

FileSize
25.38 KB

Hi. Below is the code for the page.tpl I copied from the Marineli folder into my subtheme. It works properly as it was originally written, and is stock code out of the box except for my two cut-and-pastes, which break it. As indicated below, all I did was cut the if statement and div code for the main menu, and paste it where the secondary menu originally appears, and cut and pasted the secondary menu from where it originally appears and pasted it where the main menu used to be. I thought that would simply flop the menus (above and below the rotating advertisement div). It did, but it also breaks the banner rotation, and all of the banners appear, stacked atop one another down the page, with the page now floated flush left with the browser window. I don't get why that would happen, and would appreciate some advice. Can the main menu even be moved? Why would that break the cycle code? I've attached a screen shot. Thanks

<?php // page template ?>

<?php if($page['topbar']): ?>
  <!--start top bar-->
  <div id="topBar" class="outsidecontent">
    <div id="topBarContainer" class="<?php print marinelli_page_width($layoutWidth); ?>">
    <?php print render($page['topbar']); ?>
    </div>
  </div>

  <div id="topBarLink" class="outsidecontent<?php !$topRegion ? print " withoutTopRegion": print ""; ?>">
    <?php print $topbarlink; ?>
  </div>
  <!--end top bar-->
<?php endif; ?>

<!--start framework container-->
<div class="container_12 <?php print marinelli_page_width($layoutWidth); ?>" id="totalContainer">

  <?php if($topRegion): ?>
    <!--start top section-->
    <div id="top" class="outsidecontent">

      <?php if($page['utility_top']): ?>
        <!--start top utility box-->
        <div class="utility" id="topUtility">
          <?php print render($page['utility_top']); ?>
        </div>
        <!--end top utility box-->
      <?php endif; ?>
        
      <!--start branding-->
      <div id="branding">

        <?php if($logo): ?>
          <div id="logo-container">
            <?php print $imagelogo; ?>
          </div>
        <?php endif; ?>

        <?php if($site_name || $siteslogan ): ?>
          <!--start title and slogan-->
          <div id="title-slogan">
            <?php if($site_name): ?>
              <?php print $sitename; ?>
            <?php endif; ?>

            <?php if($site_slogan): ?>
              <?php print $siteslogan; ?>
            <?php endif; ?>
          </div>
          <!--end title and slogan-->
        <?php endif; ?>

      </div>
      <!--end branding-->

      <?php if($page['search']): ?>
        <!--start search-->
        <div id="search">
          <?php print render($page['search']); ?>
        </div>
        <!--end search-->
      <?php endif; ?>

    </div>
    <!--end top section-->
  <?php endif; ?>

  <!--Main Menu Originally here-->
  	
  <?php if ($secondary_menu): ?>
      <!--start secondary navigation-->
      <div id="navigation-secondary" class="sitemenu">
        <?php print theme('links', array('links' => $secondary_menu, 'attributes' => array('id' => 'secondary-menu', 'class' => array('links', 'clearfix', 'secondary-menu')))); ?>
      </div>
      <!--end secondary-navigation-->
    <?php endif; ?>

  <!--border start-->
  <div id="pageBorder" <?php print $noborder; ?>>
    <?php if ((!$usebanner && $page['advertise']) || ($usebanner && $banner_image)): ?>
      <!--start advertise section-->
      <div id="advertise" <?php print ($usebanner == 0) ? 'class="unlimited"' : ""; ?>>
        <?php if (!$usebanner): // Use drupal region ?>
          <?php print render($page['advertise']); ?>
        <?php elseif ($banner_image): // Use marinelli banners ?>
          <?php print $banner_text; ?>
          <?php print $banner_nav; ?>
          <?php print $banner_image; ?>
        <?php endif; ?>
      </div>
      <!--end advertise-->
    <?php endif; ?>
	
<?php if($main_menu): ?>
    <!--start main menu-->
    <div id="navigation-primary" class="sitemenu">
      <?php print $mainmenu; ?>
    </div>
    <!--end main menu-->
  <?php endif; ?>
	
<!--Secondary menu originally went here-->

    <!-- start contentWrapper-->
    <div id="contentWrapper">
      <!--start breadcrumb -->
      <?php if($breadcrumb): ?>
        <div id="breadcrumb"><?php print $breadcrumb; ?></div>
      <?php endif; ?>
      <!-- end breadcrumb -->
		
			<?php if($page['overcontent']): ?>
        <!--start overcontent-->
        <div class="grid_12 outofContent" id="overContent">
          <?php print render($page['overcontent']); ?>
        </div>
        <!--end overContent-->
      <?php endif; ?>

      <!--start innercontent-->
			<div id="innerContent">

        <!--start main content-->
				<div class="<?php print marinelli_c_c($page['sidebar_first'], $page['sidebar_second'], $layoutType); ?>" id="siteContent">
				
					<?php if($page['overnode']): ?>
            <!--start overnode-->
            <div class="outofnode" id="overNode">
              <?php print render($page['overnode']); ?>
            </div>
            <!--end over node-->
					<?php endif; ?>
	   				
	   			<?php if ($page['highlight']): ?>
	   				<div id="highlight">
	   					<?php print render($page['highlight']); ?>
	   				</div>
          <?php endif; ?>
		           	
		      <?php print render($title_prefix); ?>

          <?php if ($title): ?>
            <h1 id="page-title"><?php print $title; ?></h1>
          <?php endif; ?>

          <?php print render($title_suffix); ?>
          <?php print $messages; ?>

          <?php if ($tabs): ?>
            <div class="tab-container">
              <?php print render($tabs); ?>
            </div>
          <?php endif; ?>

          <?php print render($page['help']); ?>

          <?php if ($action_links): ?>
            <ul class="action-links"><?php print render($action_links); ?></ul>
          <?php endif; ?>

          <!--start drupal content-->
          <div id="content">
            <?php print render($page['content']); ?>
          </div>
          <!--end drupal content-->

          <?php print $feed_icons ?>

          <?php if($page['undernode']): ?>
            <!--start undernode-->
            <div class="outofnode" id="underNode">
              <?php print render($page['undernode']); ?>
            </div>
            <!--end under node-->
          <?php endif; ?>

        </div>
        <!--end main content-->
	 			
	 			<?php if($page['sidebar_first'] && $page['sidebar_second'] && theme_get_setting('layout_type') != 2): ?>
          <div class="<?php print marinelli_w_c($layoutType); ?>" id="sidebarWrapper">
            <!--start oversidebars-->
	        	<?php if($page['oversidebars']): ?>
		    			<div class="outofsidebars grid_6 alpha omega" id="overSidebars">
                <?php print render($page['oversidebars']); ?>
              </div>
            <?php endif; ?>
            <!--end over sidebars-->
        <?php endif; ?>
		    		
		    <?php if($page['sidebar_first']): ?>
          <!--start first sidebar-->
          <div class="<?php print marinelli_s_c($page['sidebar_first'],$page['sidebar_second'],$layoutType,1); ?> sidebar" id="sidebar-first">
						<?php print render($page['sidebar_first']); ?>	
          </div>
          <!--end first sidebar-->
        <?php endif; ?>
		    
        <?php if($page['sidebar_second']): ?>
          <!--start second sidebar-->
          <div class="<?php print marinelli_s_c($page['sidebar_first'],$page['sidebar_second'],$layoutType,2); ?> sidebar" id="sidebar-second"><!--start second sidebar-->
            <?php print render($page['sidebar_second']); ?>
          </div>
          <!--end second sidebar-->
        <?php endif; ?>
						
						
				<?php if($page['sidebar_first'] && $page['sidebar_second'] && theme_get_setting('layout_type') != 2): ?>
          <?php if($page['undersidebars']): ?>
            <!--start undersidebars-->
            <div class="outofsidebars grid_6 alpha omega" id="underSidebars">
              <?php print render($page['undersidebars']); ?>
            </div>
            <!--end under sidebars-->
          <?php endif; ?>
          </div>
          <!--end sidebarWrapper-->
        <?php endif; ?>
      
      </div>
      <!--end innerContent-->


      <?php if($page['undercontent']): ?>
        <!--start underContent-->
				<div class="grid_12 outofContent" id="underContent">
          <?php print render($page['undercontent']); ?>
        </div>
        <!--end underContent-->
      <?php endif; ?>
    </div>
    <!--end contentWrapper-->

	</div>
  <!--close page border Wrapper-->

  <?php if($page['footer']): ?>
    <!--start footer-->
    <div id="footer" class="outsidecontent">
      <?php print render($page['footer']); ?>

      <?php if($page['utility_bottom']): ?>
        <!--start bottom utility box-->
        <div class="utility" id="bottomUtility">
          <?php print render($page['utility_bottom']); ?>
        </div>
        <!--end bottom utility box-->
      <?php endif; ?>
    </div>
    <!--end footer-->
  <?php endif; ?>

</div>
<!--end framework container-->
Lioz’s picture

Status: Postponed (maintainer needs more info) » Needs review
ManchesterNewsGuild’s picture

Hello, Lioz. I see you postponed as needing more info, but don't say what you need. But here is some more info I've inadvertently discovered while posting the code you asked for, and it appears there is a bug (or two) somewhere in the code (perhaps a path somewhere? I'm not a coder...just learning by sight). Anyway:

In recreating a subtheme and page.tpl last night (I had given up and deleted it and moved on to work with another theme), I inadvertently renamed the Marinelli subtheme folder, and .info file, etc., to my_theme while it was still within the main Marinelli folder. Within that my_theme folder, I created a folder called templates, and copied the original page.tpl into that, and made my changes as posted above. Only then did I copy the whole shebang outside the Marinelli folder, as one should do to properly create a subtheme. When I enabled the subtheme, it broke the banner rotation as described above.

This morning, I went into my subtheme and disabled the quirky page.tpl by renaming it pagexx.tpl, refreshed the theme by visiting the appearance page and saving, and cleared the cache, and voila, when I went to my home page, my changes had taken and the banner was rotating. Puzzled, I poked around, as disabling my subtheme page.tpl should have defaulted to the original in Marinelli. Lo and behold (but a bug), drupal was now reading the page.tpl in the renamed and inadvertently left behind subtheme folder WITHIN the Marinelli main folder!

In sum, the code works, and you can move the main menu below the rotating banner, IF your subtheme REMAINS in the Marinelli folder. Good news, but not the way a subtheme is supposed to work.

However, I then noticed that this only works for the logged-in administrator. If not logged in, or logged in as just an authenticated user, the paths to the banners is wrong and they don't appear, although their titles do. Hope this helps somebody else, and allows someone with more skill than I currently have to perhaps fix the code. Please let me know. Thanks

openworldstudios’s picture

I am having the same issue as well. The error occurs from the placement of the new page.tpl file, not any specific changes in it. Has anyone found a fix yet?

Eric B.’s picture

I'm also having the same issue. As soon as I move the page.tpl.php to the subtheme folder, the rotating banner breaks.

Jose_ibi’s picture

Version: 7.x-3.0-beta4 » 7.x-3.0-beta7

Hi! I'm having the same issue too. When I moved page.tpl.php to the subtheme folder, the banner breaks.

ClaudeS-1’s picture

I've encountered the same problem (the rotating banner breaks), and here's what I've found:

- without page.tpl.php in your subtheme/templates folder, the return value for "path_to_theme()" (in banners.inc) is "marinelli"; thus it correctly loads the banner's cycle.js from the marinelli/js folder
- when you add page.tpl.php to your subtheme/templates folder, the return value changes to the name of your subtheme, so it tries to load the JS from your subtheme/js folder - if you haven't copied the JS files across, the banner won't work.

Now I'd rather not have to copy everything into my subtheme, but I'm new to Drupal so don't know if you can do something to resolve this issue of whether the path_to_theme should be the parent or subtheme depending on circumstances...

What's strange is that all the other times path_to_theme() is called, it returns the parent (marinelli), only in banners.inc does it return the subtheme name...

dkendall’s picture

It seems even after moving the js files there are issues with the basic css as well. Has anyone figured out how to subtheme this without making a complete copy?

BillyIdle’s picture

You're mostly right, ClaudeS. path_to_theme() seems to be the problem, but it fails everywhere except inside template.php. Is this a bug and if so, is it in the theme or in Drupal 7? Anyone have a workaround, except duplicating the js and css dirs?

yesmathew’s picture

Is it possible to make different banners for different subthemes?

dwalker51’s picture

FileSize
694.63 KB

Don't want to hijack the thread, so if I do, please excuse me.

I have a very similiar problem, though I did not move the primary links. There was a beta9 version running as I liked, though I had edited before learning about subthemes.

I have decided to move to a subtheme to avoid upgrade problems. So what I did was the following:

This has been done a few time on the theme before so I have seen the repeated banners before on top of my pages. So this time I removed all but one image before I started.

I saved my previous theme.
downloaded the beta11 version
enabled it, then copied out the subtheme, called it noao, changed the info file to noao.info and edited it.
I then enabled it as the default and I get my theme working. Due to changes in the CSS I copied my old css directory into the subtheme and de-commented the noao.info file, like so (it has two extra regions that I added):

name = NOAO Theme
description = NOAO - Marinelli subtheme
screenshot = screenshot.png
core = 7.x
base theme = marinelli

stylesheets[all][] = css/reset/reset.css
stylesheets[all][] = css/common.css
stylesheets[all][] = css/links.css
stylesheets[all][] = css/typography.css
stylesheets[all][] = css/forms.css
stylesheets[all][] = css/drupal.css
stylesheets[all][] = css/layout.css
stylesheets[all][] = css/primary-links.css
stylesheets[all][] = css/slideshow.css
stylesheets[all][] = css/secondary-links.css
stylesheets[all][] = css/blocks.css
stylesheets[all][] = css/node.css
stylesheets[all][] = css/comments.css

regions[topbar] = Topbar
regions[utility_top] = Utility Menu (top)
regions[utility_bottom] = Utility Menu (Bottom)
regions[search] = Search Region
regions[advertise] = Advertise
regions[overcontent] = Over Content
regions[overnode] = Over Node
regions[highlight] = Highlight
regions[content] = Content
regions[undernode] = Under Node
regions[sidebar_first] = First Sidebar
regions[sidebar_second] = Second Sidebar
regions[oversidebars] = Over Sidebars
regions[undersidebars] = Under Sidebars
regions[undercontent] = Under Content
regions[footer] = Footer
regions[noao] = Noao
regions[noao_menu] = Noao Menu

I then needed to disable some of the blocks on my site, disabled the primary and secondary menu since I am using nice_menus.
I had added a footer image so I also copied my old img directory

Voila!! All looked great, but now I need to add more of my original banner images, I added one and once again I have the banners one after the other.

Not quite sure how to proceed, do I need to copy the js directory as well? I am Confused.

Once again I apologize if this is not quite the same problem, I will open another thread if need be.

Tabestan’s picture

I added the content of marinelli/logics to my subtheme and it worked but I agree, it's not a proper way to do it and I wonder about updates.

Still that theme is awesome.

schuffr’s picture

Priority: Normal » Major

I am having the same issue with version 7.x-3.0-beta11. I haven't yet seen where this is being addressed. Any update on the status

Carlos Miranda Levy’s picture

Title: Moving Primary Links in subtheme page.tpl breaks banner rotation » Enabling page.tpl.php in subtheme breaks banner rotation
Version: 7.x-3.0-beta7 » 7.x-3.0-beta11
Component: Miscellaneous » Code

I renamed the title to reflect the actual problem, updated the version as the issue remains on 7.x-3.0-beta11 and changed the Component to code as it's a coding issue.

I can confirm that copying the css, logics and js folders to the subtheme folder fixes the problem, regardless of the location of the subtheme folder.

vernma’s picture

The workaround indicates you need to define your sub-theme under the Marinelli folder, contrary to Drupal form.

I found this when I tried to do what everything else wanted, move the ads above the menu.

This seems to be a pretty major problem. Why is there no fix after all these months and versions?

ChristianAdamski’s picture

I want to add, that having a [SUBTHEMENAME]_preprocess_page() function in your template.php also causes the path_to_theme() to redirect to your subtheme folder, which breaks paths for the JS-files needed for the banner.