ThemeShaper Forums » Thematic

[closed]

Does anyone know when the next version of the thematic theme will come out?

(38 posts)
  • Started 4 years ago by hally
  • Latest reply from hally
  • This topic is not resolved
  1. hally
    Member

    Does anyone know when the next thematic theme will come out. Stable release that is?

    Posted 4 years ago #
  2. Not sure.... but I've been running the bleeding versions from svn for a while no problems. Only caveat is that functions newer that what is in the current release version are subject to change before the next release

    Posted 4 years ago #
  3. Hi,

    is there anything special you're looking for?

    Chris

    Posted 4 years ago #
  4. hally
    Member

    Hi Chris I am looking for a second sidebar which I could refer to custom page template. I would delete the reference to the orginal sidebar which is <?php thematic_sidebar() ?>

    I used this code below and it seemed to work to create the widgets in the sidebar. However I would like a dynamic_sidebar2 rather than it showing in the dynamic_sidebar. This way it will only show in the page templates I make the php call to.

    // Register widgetized areas
    function theme_widgets_init() {
    // Area 1
    register_sidebar( array (
    'name' => '2nd Primary Widget Area',
    'id' => '2nd_primary_widget_area',
    'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
    'after_widget' => "",
    'before_title' => '<h3 class="widget-title">',
    'after_title' => '</h3>',
    ) );

    // Area 2
    register_sidebar( array (
    'name' => '2nd Secondary Widget Area',
    'id' => '2nd_secondary_widget_area',
    'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
    'after_widget' => "",
    'before_title' => '<h3 class="widget-title">',
    'after_title' => '</h3>',
    ) );
    } // end theme_widgets_init

    add_action( 'init', 'theme_widgets_init' );

    Posted 4 years ago #
  5. .. this can be done without a second sidebar using the current svn.

    Take a look at the last code in this post:

    http://forums.themeshaper.com/topic/something-new-bout-widgetized-areas

    Chris

    Posted 4 years ago #
  6. hally
    Member

    Hello Chris I upload the latest thematic svn. But I don't see how I can control the widgetized areas? At I don't see this in the dashboard

    Posted 4 years ago #
  7. With the current SVN you'll get only the option to create / manage the widgetized areas. It's up to you what you do with this option in your functions.php.

    If you want to create a page based version of Primary / Secondary Aside, you need to add the following code to your child theme's functions.php:

    function change_major_aside($content) {
    	$content['Primary Aside']['function'] = 'childtheme_primary_aside';
    	$content['Primaray Aside Pages'] = array(
    		'admin_menu_order' => 101,
    		'args' => array (
    			'name' => 'Primary Aside Pages',
    			'id' => 'primary-aside-pages',
    			'before_widget' => thematic_before_widget(),
    			'after_widget' => thematic_after_widget(),
    			'before_title' => thematic_before_title(),
    			'after_title' => thematic_after_title(),
    		),
    		'action_hook'	=> 'thematic_primary_aside',
    		'function'		=> 'childtheme_primary_aside',
    		'priority'		=> 10,
    	);
    	$content['Secondary Aside']['function'] = 'childtheme_secondary_aside';
    	$content['Secondary Aside Pages'] = array(
    		'admin_menu_order' => 201,
    		'args' => array (
    			'name' => 'Secondary Aside Pages',
    			'id' => 'secondary-aside-pages',
    			'before_widget' => thematic_before_widget(),
    			'after_widget' => thematic_after_widget(),
    			'before_title' => thematic_before_title(),
    			'after_title' => thematic_after_title(),
    		),
    		'action_hook'	=> 'thematic_secondary_aside',
    		'function'		=> 'childtheme_secondary_aside',
    		'priority'		=> 10,
    	);
    
    	return $content;
    }
    add_filter('thematic_widgetized_areas','change_major_aside');
    
    function childtheme_primary_aside() {
    	if (is_sidebar_active('primary-aside') && is_sidebar_active('primary-aside-pages')) {
    		echo thematic_before_widget_area('primary-aside');
    		if (is_page()) {
    			dynamic_sidebar('primary-aside-pages');
    		} else {
    			dynamic_sidebar('primary-aside');
    		}
    		echo thematic_after_widget_area('primary-aside');
    	}
    }
    
    function childtheme_secondary_aside() {
    	if (is_sidebar_active('secondary-aside') && is_sidebar_active('secondary-aside-pages')) {
    		echo thematic_before_widget_area('secondary-aside');
    		if (is_page()) {
    			dynamic_sidebar('secondary-aside-pages');
    		} else {
    			dynamic_sidebar('secondary-aside');
    		}
    		echo thematic_after_widget_area('secondary-aside');
    	}
    }

    Chris

    Posted 4 years ago #
  8. hally
    Member

    Thanks Chris

    so the area of the code that says 'id' => 'primary-aside-pages', is where I put the page ids of where I want it to show up? Because I section of my site where pages are used like posts

    There would be too many pages for me to do this if I had to put an id for each page. It would be easier if I can make a call to a particular sidebar in the template while excluding the other

    Posted 4 years ago #
  9. No .. this is the ID of the dynamic sidebar. The code works as it is on all pages. Everthing assigned to Primary / Secondary Aside Pages will only show up on pages. Everything assigned to Primary / Secondary Aside will only show up on non-pages.

    Posted 4 years ago #
  10. hally
    Member

    Umm because I use a lot of times pages as posts. This may not work out for me. Is there way for me to have the regular sidebar show up on the post pages but the primary and secondary aside pages show on the other pages that I don't use as posts.?

    Posted 4 years ago #
  11. Hally-

    I admit thematic's method of calling sidebars can be a bit hard to wrap your head around at first but there's a lot of time/code saving benefit to it once you do. The childtheme_primary_aside() and childtheme_secondary_aside() functions above can be made to apply to whatever pages you want, just adjust the conditional statement to suit your needs. for example:

    if (is_page('11') || is_page('28')) {
    			dynamic_sidebar('secondary-aside-pages');

    You could include or exclude page ids however you like. The benefit is that the framework will use it's template structure and generate the markup and you wont have to markup multiple page and sidebar templates.

    Alternatively if you've already made a custom page template you could register your sidebars like you posted above and call the sidebar in the standard WordPress manner.
    Create a file named sidebar-hally-aside.php in your child theme directory. Here's some code that will work with the sidebar ids from your code example above.

    <?php if ( is_sidebar_active('2nd_primary_widget_area') && is_sidebar_active('2nd_secondary_widget_area') ) { 
    
        echo '<div id="primary" class="main-aside">'. "\n" . '<ul class="xoxo">' . "\n";
        dynamic_sidebar('2nd_primary_widget_area');
        echo '</ul>' . "\n" . '</div><!-- #2nd_primary_widget_area  -->'. "\n";
    
        echo '<div id="secondary" class="main-aside">'. "\n" . '<ul class="xoxo">' . "\n";
        dynamic_sidebar('2nd_secondary_widget_area');
        echo '</ul>' . "\n" . '</div><!-- #2nd_secondary_widget_area -->'. "\n";
    
    } ?>

    and then just call the sidebar in the custom template you made with:

    <?php get_sidebar('hally-aside') ?>

    Posted 4 years ago #
  12. Just in case that there are too many post-pages and regular pages or that the number of post-pages will increase or change, I would use a custom field for the pages that identifies a post-page. This custom field can be used to decide whether your theme should display the main primary / secondary aside or a page version.

    The other way would be to create a template calling your page version of the sidebar and connect it to the post-pages.

    I would prefer the custom field thing. It can be integrated as a nice additional metabox with a checkbox. Hitting a checkbox is easier compared to opening a drop-down list and choose the right template.

    In terms of the code, the template thing is easier to create.

    It's up to you. I can help with both solutions.

    Chris

    Posted 4 years ago #
  13. hally
    Member

    I can do meta box as you suggested. But if you have the time I wouldn't mind if you shoe me how you did the template solution. But if you can only do one then I will do the custom field

    Posted 4 years ago #
  14. hally
    Member

    Again Thanks Chris for the help.

    Posted 4 years ago #
  15. hally
    Member

    Chris do you know what steps I should take next?

    Posted 4 years ago #
  16. hally
    Member

    Hello chris do i have pay for the help?

    Posted 4 years ago #
  17. :)

    No .. otherwise I would have already sent you a quote. Sorry, my real life is keeping me busy at the moment.

    Will have something for you in one or two hours.

    Chris

    Posted 4 years ago #
  18. OK .. here's the first part creating the meta_box :)

    /*
    	Let's start with the additions for WP-Admin / Pages
    */
    
    /* Defining the custom fields that we need */
    $new_meta_boxes =
      array(
      "postpage" => array(
      "name" => "postpage",
      "type" => "checkbox",
      "std" => "false",
      "title" => "Page contains posts",
      "description" => "Check if yes"),
    );
    
    /* Defining the look and feel of our new metabox */
    function new_meta_boxes() {
      global $post, $new_meta_boxes;
    
      foreach($new_meta_boxes as $meta_box) {
        $meta_box_value = get_post_meta($post->ID, $meta_box['name'], true);
    
        if($meta_box_value == "")
          $meta_box_value = $meta_box['std'];
    
    	echo'<input type="hidden" name="'.$meta_box['name'].'_noncename" id="'.$meta_box['name'].'_noncename" value="'.wp_create_nonce( plugin_basename(__FILE__) ).'" />';
    
       	switch ( $meta_box['type'] ) {
    		case 'text':
    			echo'<label style="font-weight: bold; display: block; padding: 5px 0 2px 2px" for="'.$meta_box['name'].'">'.$meta_box['title'].'</label>';
    
    			echo'<input type="text" name="'.$meta_box['name'].'" value="'.$meta_box_value.'" size="55" /><br />';
    
    			echo'<p><label for="'.$meta_box['name'].'">'.$meta_box['description'].'</label></p>';
    		break;
    
    		case 'checkbox':
    
    			echo'<p><input type="checkbox" name="'.$meta_box['name'].'"  value="true"';
    			checked('true', $meta_box_value);
    			echo' /> <label style="font-weight: bold; padding: 5px 0 2px 2px" for="'.$meta_box['name'].'">'.$meta_box['title'].'</label></p>';
    		break;
    	}
      }
    }
    
    /* Once defined, we create the new metabox */
    function create_meta_box() {
      global $theme_name;
      if ( function_exists('add_meta_box') ) {
        add_meta_box( 'new-meta-boxes', 'Page Settings', 'new_meta_boxes', 'page', 'normal', 'high' );
      }
    }
    
    /* ... and we need to save our valuable data */
    function save_postdata( $post_id ) {
      global $post, $new_meta_boxes;
    
      foreach($new_meta_boxes as $meta_box) {
      // Verify
      if ( !wp_verify_nonce( $_POST[$meta_box['name'].'_noncename'], plugin_basename(__FILE__) )) {
        return $post_id;
      }
    
      if ( 'page' == $_POST['post_type'] ) {
      if ( !current_user_can( 'edit_page', $post_id ))
        return $post_id;
      } else {
      if ( !current_user_can( 'edit_post', $post_id ))
        return $post_id;
      }
    
      $data = $_POST[$meta_box['name']];
    
      if(get_post_meta($post_id, $meta_box['name']) == "")
        add_post_meta($post_id, $meta_box['name'], $data, true);
      elseif($data != get_post_meta($post_id, $meta_box['name'], true))
        update_post_meta($post_id, $meta_box['name'], $data);
      elseif($data == "")
        delete_post_meta($post_id, $meta_box['name'], get_post_meta($post_id, $meta_box['name'], true));
      }
    }
    
    /* Let's start some actions */
    add_action('admin_menu', 'create_meta_box');
    add_action('save_post', 'save_postdata');
    
    /* The admin part is done */

    Chris

    Posted 4 years ago #
  19. .. and this is the second part creating the sidebars depending on the custom fields:

    function change_major_aside($content) {
    	$content['Primary Aside']['function'] = 'childtheme_primary_aside';
    	$content['Primaray Aside Pages'] = array(
    		'admin_menu_order' => 101,
    		'args' => array (
    			'name' => 'Primary Aside Pages',
    			'id' => 'primary-aside-pages',
    			'before_widget' => thematic_before_widget(),
    			'after_widget' => thematic_after_widget(),
    			'before_title' => thematic_before_title(),
    			'after_title' => thematic_after_title(),
    		),
    		'action_hook'	=> 'thematic_primary_aside',
    		'function'		=> 'childtheme_primary_aside',
    		'priority'		=> 10,
    	);
    	$content['Secondary Aside']['function'] = 'childtheme_secondary_aside';
    	$content['Secondary Aside Pages'] = array(
    		'admin_menu_order' => 201,
    		'args' => array (
    			'name' => 'Secondary Aside Pages',
    			'id' => 'secondary-aside-pages',
    			'before_widget' => thematic_before_widget(),
    			'after_widget' => thematic_after_widget(),
    			'before_title' => thematic_before_title(),
    			'after_title' => thematic_after_title(),
    		),
    		'action_hook'	=> 'thematic_secondary_aside',
    		'function'		=> 'childtheme_secondary_aside',
    		'priority'		=> 10,
    	);
    
    	return $content;
    }
    add_filter('thematic_widgetized_areas','change_major_aside');
    
    function childtheme_primary_aside() {
    	global $post;
    	if (is_sidebar_active('primary-aside') && is_sidebar_active('primary-aside-pages')) {
    		echo thematic_before_widget_area('primary-aside');
    		if (get_post_meta($post->ID, 'postpage', true)) {
    			dynamic_sidebar('primary-aside-pages');
    		} else {
    			dynamic_sidebar('primary-aside');
    		}
    		echo thematic_after_widget_area('primary-aside');
    	}
    }
    
    function childtheme_secondary_aside() {
    	global $post;
    	if (is_sidebar_active('secondary-aside') && is_sidebar_active('secondary-aside-pages')) {
    		echo thematic_before_widget_area('secondary-aside');
    		if (get_post_meta($post->ID, 'postpage', true)) {
    			dynamic_sidebar('secondary-aside-pages');
    		} else {
    			dynamic_sidebar('secondary-aside');
    		}
    		echo thematic_after_widget_area('secondary-aside');
    	}
    }

    Tested and approved! :)

    Chris

    Posted 4 years ago #
  20. hally
    Member

    I great thanks Chris :-). I really appreciate it.

    Posted 4 years ago #
  21. hally
    Member

    Hi Chris will I still be able to display the the regular primary/secondary aside sidebar (not the primary/secondary aside pages sidebar) on pages I don't want the primary/secondary aside pages sidebar to show. For instance if I don't check the box on pages will then the regular primary/secondary aside sidebar to show on that page?

    Posted 4 years ago #
  22. hally
    Member

    Maybe only a template could accomplish this

    Posted 4 years ago #
  23. I know when the next version will come out! Expect a minor update sooner rather than later and something more after WordPress 2.9.

    Posted 4 years ago #
  24. @hally .. the page version of primary / secondary aside will only display if the box is checked. Otherwise the regular versions will be displayed. Exactly as you requested :)

    Posted 4 years ago #
  25. @Ian .. Difficult to see. Always in motion is the future. :)

    Posted 4 years ago #
  26. hally
    Member

    Cool. Thanks Chris :-)

    Posted 4 years ago #
  27. @chris I'm ready to fight Vader! I'm ready to avenge my father and become a Jedi Knight!

    Posted 4 years ago #
  28. hally
    Member

    Hi Chris

    Everything works great but the only problem is that the default sidebar doesn't show on the homepage. But on all pages amd posts the various sidebars show.

    Posted 4 years ago #
  29. Strange .. tested my code once again and I'm getting the regular ones on my home page and all other pages except the one that has the box checked. Only this one displays the page version of primary / secondary aside.

    Could you please email your functions.php to chris (at) wupperpiraten (dot) de ?!

    Posted 4 years ago #
  30. Yikes!

    Never ever change the original Thematic theme. Don't touch it. Don't even think about touching it. :)

    OK .. seems as if you changed more files. I copied your functions.php to my Thematic directory and again everything works here.

    Is it possible that you changed index.php or sidebar.php? Or that you still have a changed copy of these files in your child theme directory?

    Posted 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.