1

I have a theme with a specific region and it is being printed using some PHP within the page.tpl.php file. It is also using a .js file and a .css file both within the PHP.

Here is the current code found within my old site's page.tpl.php file that allows for my region to show up:

<?php if (isset($page['sidepulltab'])) : ?>
    <div id="style-picker">
      <div id="toggler" class="closed"></div>
      <div id="body">
        <div class='section'>   
            <?php print render($page['sidepulltab']);?>                 
        </div>
      </div>    
    </div>
<?php endif;?>

I have added to my subthemes .info file 3 lines (.js, .css and region):

scripts[] = js/stylepicker.js stylesheets[all][] = css/stylepicker.css regions[sidepulltab] = Side Pull Tab

I am not sure how to transfer this type of PHP region within Omega's Subtheme under the Appearance tab.

I tried adding the above code to page.tpl.php file which I copied into my subtheme from its original Alpha theme location. I do get my CSS and DIVs to show up, however my block region isn't printing inside.

Note: I'm using Omega 3, I have also cleared the cache. The region is showing up as "disabled" inside the Omega3 Apperence tab.

  • Assuming you are using Omega 3 (I have not used 4 yet) adding regions[sidepulltab] = Side Pull Tab to your themes .info file should be enough for the new region to show up in the Omega settings UI. You should not need to alter any theme files for it to output. You will probably have to clear the cache. – 2pha Feb 10 '14 at 0:42
  • Thanks but still no luck. Yes, Im using Omega 3, I have also cleared the cache. The region is showing up as "disabled" inside the Omega3 Apperence tab. Do i have to assign it to a zone or something? – Anon Ymous Feb 10 '14 at 0:49
  • I just tried it on one of my own Omega3 sites and adding regions[testing] = 'Testing' to the info file then clearing the cache added the region to my themes UI. It is listed on the 'region and zone configuration' tab at the bottom under 'unassigned regions' at the bottom of the page. Yes, you have to assign it to a zone so it is output. – 2pha Feb 10 '14 at 0:57
  • Thanks, I can get it to output to the zone i select. What i need to know is how to take the specific div/php code shown above and replicate it using Omega3's zone and region interface. Because simply adding the above code to a page.tpl.php file (as i would do on other sites) is not working with Omega. Any ideas once the region is located within a zone and showing on the page to make that region communicate with my JS and CSS files? – Anon Ymous Feb 10 '14 at 1:32
  • what i dont understand is how to add the same ID's and Classes in the same structure as above. – Anon Ymous Feb 10 '14 at 1:51
2

I have solved this issue.

I had to create a Zone. Then add the created Region to the new zone. I then created a zone--zonename.tpl.php file and within that i added

<div id="style-picker">
<div id="toggler" class="closed"></div>
<div id="body">
    <div class='section'>
    <?php print $content; ?>            
    </div>
</div>

</div>

after that all content printed within this zone will be wrapped within my divs and .js and .css files will be applied.

Thank you 2pha for sticking in there with me and helping me with my overall brainstorming =-) hopefully this helps someone else messing around with this stuff.

  • Glad ya got it sorted. Omega is a bit different to most themes and it take a while yo get your head around it, it took me ages. – 2pha Feb 10 '14 at 7:05
  • Yup, It finally clicked that it creates the divs for different zones and regions, and all i have to do is target that region with a specific php file =-) Hope this thread helps someone else. – Anon Ymous Feb 11 '14 at 5:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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