I was doing a little digging to Omega today and figured I'd help out a little with some stuff that's no missing, no longer needed, etc. Here's a patch, which I hope is helpful. Explanation coming shortly...

CommentFileSizeAuthor
#7 massive.patch165.36 KBJacine
#2 omega-tweaks.patch10.92 KBJacine
omega-node.patch10.9 KBJacine
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jacine’s picture

+++ node.tpl.php	Tue Jun 15 23:55:56 EDT 2010
@@ -77,15 +77,15 @@
+  <?php print render($title_prefix); ?>

This just needs to print whether $title does or not.

+++ page.tpl.php	Wed Jun 16 00:15:53 EDT 2010
@@ -116,10 +116,16 @@
+        <?php print render($title_prefix); ?>
         <?php if ($title): ?>
           <h1 class="title" id="page-title"><?php print $title; ?></h1>
         <?php endif; ?>
-    
+        <?php print render($title_suffix); ?>
+
+        <?php if ($action_links): ?>
+          <ul class="action-links"><?php print render($action_links); ?></ul>
+        <?php endif; ?>
+

This stuff was missing. $action_links is a new thing. It prints the "Create new blog entry" link on /blog, for example.

+++ page.tpl.php	Wed Jun 16 00:15:53 EDT 2010
@@ -116,10 +116,16 @@
Index: preprocess/preprocess-node.inc

This file wasn't being used. I did a bunch of changes in here, but mostly it comes down to using the $vars['classes_array'] instead of totally bypassing it. This is important to keep so that modules can hook in and add classes.

+++ preprocess/preprocess-node.inc	Wed Jun 16 02:24:45 EDT 2010
@@ -6,65 +6,45 @@
+// Remove node classes provided by core where duplication exists.
+$exclusions = array(drupal_html_class('node-'. $vars['type']), 'node-promoted', 'node-sticky', 'node-teaser', 'node-unpublished');
+foreach ($vars['classes_array'] as $key => $value) {
+  if (in_array($value, $exclusions)) {
+    unset($vars['classes_array'][$key]);
+  }
+}
+

I added this because I'm not sure how married you are to using classes like .promoted vs. .node-promoted. It's probably best to use what core is providing now, since it's not so bad anymore, but obviously this is up to you :)

+++ preprocess/preprocess-node.inc	Wed Jun 16 02:24:45 EDT 2010
@@ -6,65 +6,45 @@
+// Prepare the arrays to handle the classes and ids for the node container.
+$vars['node_attributes']['id'] = drupal_html_id('node-' . $vars['type'] . '-' . $vars['nid']);
+$vars['node_attributes']['class'] = $vars['classes_array'];

I removed the render_attributes() function and this here basically prepares the variables to use drupal_attributes() which is much better these days. Also, this code wasn't working because Drupal core now uses $vars['attributes'] for RDFa stuff and it was being overwritten. The process of flattening these classes actually happens in template_process().

+++ template.php	Tue Jun 15 23:47:37 EDT 2010
@@ -95,7 +95,8 @@
 function omega_process_node(&$vars) {
-  
+  // Convert node attributes to a string and append to existing RDFa attributes.
+  $vars['attributes'] .= drupal_attributes($vars['node_attributes']);
 } // end process_node
 

I added this here, because I wasn't sure if it should be in process/process-node.inc or here.

+++ template.php	Tue Jun 15 23:47:37 EDT 2010
@@ -240,31 +241,6 @@
-function omega_id_safe($string) {

Removed this because it's no longer necessary. Drupal's got two new functions drupal_html_id() and drupal_html_css() that take care of this fun stuff.

+++ template.php	Tue Jun 15 23:47:37 EDT 2010
@@ -287,6 +263,10 @@
+      // Provide a navigational heading to give context for breadcrumb links to
+      // screen-reader users. Make the heading invisible with .element-invisible.
+      $output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';
+

@@ -296,32 +276,13 @@
+      $output .= '<div class="breadcrumb">' . implode($breadcrumb_separator, $breadcrumb) . "$trailing_separator$title</div>";

I wasn't sure if you left this out on purpose or not, but I added it back in case it was by accident. Looking at this code again, I just realized I forgot to actually return $output. Whoops.

+++ template.php	Tue Jun 15 23:47:37 EDT 2010
@@ -296,32 +276,13 @@
 /**
  * Implementation of hook_theme().
@@ -333,14 +294,7 @@

@@ -333,14 +294,7 @@
   // Since we are rebuilding the theme registry and the theme settings' default
   // values may have changed, make sure they are saved in the database properly.
   //omega_theme_get_default_settings($theme);
-  return array(
-    'id_safe' => array(
-      'arguments' => array('string'),
-    ),
-    'render_attributes' => array(
-      'arguments' => array('attributes'),
-    ),
-  );
+  return array();
 }// */

I left this because I'm not sure if it's needed or not. I see you are calling this in the starter-kit version, and I'm really not sure what's going on with all that voodoo magic inheritance stuff.

Powered by Dreditor.

Anyways, I hope this is helpful (and not annoying). Sorry for the monster patch, just got started and kept going :P

I really like what you've done with this theme. I'm hoping to include it in the chapter I'm currently writing on D7...

Jacine’s picture

Title: Node template and preprocess tweaks » Node template and preprocess and other tweaks
FileSize
10.92 KB

...and here's the patch with breadcrumbs that actually print :P

himerus’s picture

Assigned: Unassigned » himerus

You seriously rock!!! I will take a look at this on my sandbox, and get it committed today!

A lot of these things are some of those underlying items that I haven't had the time to investigate proper usage in Drupal 7 that were carry over from the D6 version and some of the great themes code was borrowed from.

Assuming everything works, I'm good with it all! And glad for the help!! (not annoying)

By chance will you be at D4D?? My new omega presentation is pretty awesome all on this D7 version, showing some of the amazing features that have been added for D7.

himerus’s picture

Status: Needs review » Fixed

The changes have been committed and tagged in the 7.x-1.0-beta3 release.

Thanks for the patch, Jacine!!

Jacine’s picture

Yay! I'm glad it was helpful ;)

I wont be at D4D, but I'll be here impatiently awaiting the video of your session :P

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Jacine’s picture

Version: 7.x-1.0-beta2 » 7.x-1.x-dev
Status: Closed (fixed) » Needs review
FileSize
165.36 KB

Hey there! Me again :)

I've been pounding away at Omega all day, doing some more clean up stuff. I hesitate to even post this patch because it's huge, and will most definitely be a pain in the ass to review, but it's honestly like 95% coding style clean up, with some other fixes sprinkled in between, and some documentation stuff, which is good.

Hopefully this explanation will help.

  • JS files: I edited all of them. I added (function ($) { to the beginning and })(jQuery); to the end of each file, which is suggested to that the code doesn't conflict with other libraries other than jQuery. I also got rid of tabs and did some code style stuff in here, but changed nothing code wise.
  • omega.info: I could have sworn I looked at this before, but page_top and page_bottom regions are now required theme regions
  • page.tpl.php: This looks SOOO much worse in the patch than it is... I removed <?php if (!empty($admin)) print $admin; ?> That's not needed anymore $page_top in html.tpl.php handles that stuff. Other than that, I just did coding style stuff (indenting, control structures, etc)
  • theme-settings.php: This was mainly coding style cleanup too. I removed the return in the form_alter (it's not needed), and also the include_once for the theme-functions.inc file (I added a comment in there). Everything else is straight up coding style fixes.
  • template.php: Most of the stuff in here is coding style fixes too. I moved the fluid width JS from hook_css_alter() to template_preprocess_html()

Anyway, one step closer to perfection :D

PS - Patch is on DRUPAL-7--1

Jacine’s picture

Oh, btw... From what I'm seeing, it doesn't look like the theme-settings.php or the hook_theme() is required in subthemes for things to work. I removed both from my subtheme and things are working just fine. You may already know this, but I figured I'd mention it just in case.

Jacine’s picture

Title: Node template and preprocess and other tweaks » Drupal 6 to Drupal 7 tweaks

Changing title.

himerus’s picture

Jacine,

You rock!!!

I'll test this out today, and make sure everything is still working as "expected".
I'm currently working on a very sexy subtheme of Omega for D7 that will really help adoption, and it'll be great for testing out the patch.

Thanks for looking/working on this!! There so much I still need to understand/figure out related to the D7 changes, and you've been a HUGE help in this!!

I'm sure everything is good here, and unless there's anything crazy going on, I'd expect this all in a new release very soon!

Jacine’s picture

You're welcome :)

Thank YOU for being so far along with the D7 version already!

himerus’s picture

Status: Needs review » Fixed

Okay, this patch has been committed (with a few other minor updates) in the BETA5 release for D7.

There are still some minor things found by coder that are present, and I've just been putting off a lot of them in the past until I reached a more "stable" release. Zend studio seems to always do wonky things with spacing and tabs no matter what the settings. God forbid you want to indent a whole segment of code, it ignores the "spaces for tabs" setting(s).

This was working well in my own tests, and in sub-sub-sub themes everything seems to be good.

I think I've removed the hook_theme calls in most places. (I may have missed one somewhere as I was testing on many different themes)
I'm not sure on if I'd like to remove the theme-settings.php by default or not. Even though the default subthemes don't need it to function anymore and pull the appropriate theme settings from all parent themes, I do kind of like having it there for someone to quickly get going....

I'm kinda torn there, but see the benefit of removing it, AND leaving it in place with just the form alter structure pre defined for the subthemes created.

Jacine’s picture

Awesome! Damn you are fast... :D

As far as the theme-settings.php file is concerned, I would suggest leaving it and commenting out the contents like you do in the template.

himerus’s picture

Sounds like a good idea on the theme-settings.php.
Then the drush script (drush omega-subtheme "Subtheme Name") will still appropriately modify that file, and it will be there.

There is definitely a need (and on my list after everything is really "done" and the gamma subtheme is stable in the package) to really go through everything line by line, and reorganize, clean up, add/remove functions where needed, etc.

Thanks for your help on this!!
Hope your Theming chapter is coming along nicely!!!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.