Global marketplace sidebar

I thought I saw some instructions on how to do this in a earlier thread, but I can't seem to find them now.

I registered a new sidebar in my child theme's functions.php called marketplace-right

How do I have it display on the dynamically created global marketplace page? Right now, the page is showing the default sidebar from my theme (BP Corporate) - how do I change that in marketpress?

    Mason

    Not sure what instructions you're referring to so I'm gonna provide the first method that comes to my mind

    You'll need to create a new page template for bp-corporate (you can copy one of the other ones - like single.php) just name the new page template mp_product.php (for example) and change up the call for get_sidebar to grab your new custom sidebar.

    You may want to take a look at the framemarket, gridmarket, and simplemarket themes to get a better understanding of this as well.

    Thanks!

    Saunt Valerian

    https://premium.wpmudev.org/forums/topic/marketplace-template-page

    Found that thread with some instructions. I think this is the one I saw before. Am reading through the various files. I actually might be able to get my head around it.

    Might consider adding the existence of those files and information to the bottom of the Installation & Use Instructions for MarketPress.

    Saunt Valerian

    For anyone reading this thread, here is the base instructions for this:

    MarketPress uses custom post types to display it's products. This means that you can use
    the same WP theme templating system you are familiar with. We simply provide a customized
    subset of template functions so you don't have to worry about dealing with post meta. Template
    functions are fully documented and can be found in the /marketpress/template-functions.php file.

    MarketPress searches your current theme folder for template files specific to store pages. If
    a template file does not exist it loads the theme's page template instead. Just like WP, the
    plugin will search for templates in order of priority from top to bottom.

    --------------------------------------------------------------------
    As to solving the problem, I am getting there, but its not displaying the sidebar yet. I have mp_global_products.php created and the dynamic marketplace is creating the page using it. I set the sidebar call up like this:
    <?php get_sidebar('marketplace-right'); ?>

    However, it is still displaying the default sidebar.

    I created (registered) the sidebar in my child theme by creating a functions.php and using the following to register the sidebar:

    register_sidebar(
    	array(
    		'name' => __('marketplace-right', TEMPLATE_DOMAIN),
            'id'            => 'marketplace-right',
    		'description'   => 'Marketplace Right Widget',
    		'before_widget' => '<div id="%1$s" class="widget %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<h2 class="widgettitle">',
            'after_title' => '</h2>'
    	)
    );

    I know I still have to add css to control the sidebar, but I must have missed a step somewhere. I've been searching, but I'm not sure I'm grasping sidebars yet.

    Any ideas?

    Saunt Valerian

    Okay, I think I found the missing step (which, I think, is editing sidebar.php). However, I'm getting this error when using the code displayed below.

    Parse error: syntax error, unexpected '}' in /home/teatrade/public_html/wp-content/themes/bp-corporate/sidebar.php on line 58

    Line 58 is an else statement and I copied the pattern of it all from home-sidebar.php and the original sidebar.php. What is wrong with this?

    because of differences in line numbering the referenced error is displayed here in the forums as line 56.

    sidebar.php:

    <?php include(TEMPLATEPATH . '/options-var.php'); ?>
    
    <?php if($bp_existed == 'true') { //check if bp existed ?>
    
    <?php if( !bp_is_blog_page() && bp_current_component() || bp_is_directory() ) { ?>
    
    <?php locate_template( array( 'lib/templates/bp-template/optionsbar.php'), true ); ?>
    
    <?php } else { ?>
    
    <div id="sidebar"><!-- start sidebar -->
    
    <?php if ( BP_FORUMS_SLUG == bp_current_component() && bp_is_directory() ) { ?>
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(__('buddypress-right', TEMPLATE_DOMAIN )) ) : ?>
    <div id="text" class="widget widget_text">
    <h2 class="widgettitle"><?php _e( 'BuddyPress Right Widget', TEMPLATE_DOMAIN ) ?>  </h2>
    <div class="textwidget">
    <?php _e( 'Please log in and add widgets to this sidebar.', TEMPLATE_DOMAIN ) ?>
     <a href="<?php echo get_option('siteurl') ?>/wp-admin/widgets.php?s=&show=&sidebar=sidebar-9"><?php _e( 'Add Widgets', TEMPLATE_DOMAIN) ?></a>
    </div>
    </div>
    <?php endif; ?>
    <?php } else { ?>
    <div id="center-column">
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(__('blog-sidebar', TEMPLATE_DOMAIN )) ) : ?>
    <div id="text" class="widget widget_text">
    <h2 class="widgettitle"><?php _e( 'Blog Sidebar Widget', TEMPLATE_DOMAIN) ?></h2>
    <div class="textwidget">
    <?php _e( 'Please log in and add widgets to this sidebar.', TEMPLATE_DOMAIN) ?>
     <a href="<?php echo get_option('siteurl') ?>/wp-admin/widgets.php?s=&show=&sidebar=sidebar-4"><?php _e( 'Add Widgets', TEMPLATE_DOMAIN) ?></a>
    </div>
    </div>
    <?php endif; ?>
    </div>
    <?php } ?>
    
    </div><!-- end sidebar -->
    
    <?php } ?>
    
    <?php } else { ?>
    
    <div id="sidebar">
    <div id="center-column">
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(__('blog-sidebar', TEMPLATE_DOMAIN )) ) : ?>
    <div id="text" class="widget widget_text">
    <h2 class="widgettitle"><?php _e( 'Blog Sidebar Widget', TEMPLATE_DOMAIN) ?></h2>
    <div class="textwidget">
    <?php _e( 'Please log in and add widgets to this sidebar.', TEMPLATE_DOMAIN) ?>
     <a href="<?php echo get_option('siteurl') ?>/wp-admin/widgets.php?s=&show=&sidebar=sidebar-4"><?php _e( 'Add Widgets', TEMPLATE_DOMAIN) ?></a>
    </div>
    </div>
    <?php endif; ?>
    </div>
    </div>
    <?php } ?>
    
    <?php } ?>
    
    <?php } else { ?>
    
    <div id="sidebar"><!--start marketplace sidebar-->
    <div id="marketplace-right">
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(__('marketplace-right', TEMPLATE_DOMAIN )) ) : ?>
    <div id="text" class="widget widget_text">
    <h2 class="widgettitle"><?php _e( 'Marketplace Right', TEMPLATE_DOMAIN) ?> </h2>
    <div class="textwidget">
    <?php _e( 'Please log in and add widgets to this column.', TEMPLATE_DOMAIN) ?>
     <a href="<?php echo get_option('siteurl') ?>/wp-admin/widgets.php?s=&show=&sidebar=sidebar-3"><?php _e( 'Add Widgets', TEMPLATE_DOMAIN) ?></a>
    </div>
    </div>
    <?php endif; ?>
    </div>
    </div>
    <?php } ?><!--end marketplace sidebar-->
    Mason

    Hiya Saunt Valerian,

    Would you mind pasting the code up in pastebin.com or someplace where we can read it a bit more easily. Anything over 10 lines of code is much easier somewhere else

    I believe the last step you need to do here though is to actually just make a copy of sidebar.php and rename the copy sidebar-marketpress-right.php. Of course, you can then edit it/style it according to your needs.

    Then this file will be used for the marketpress-right rather than the default.

    Let us know if this works for you.

    Saunt Valerian

    meh, still not getting. I don't think what you recommended above will work since I still need to input the code to print the marketplace sidebar. Simply copying the file and renaming it, isn't going to give it the code.

    I've now created a sidebar.php in the child theme (should have started with that) using this http://pastebin.com/dsNpStTD

    I still get a syntax error based on the else statement around line 56. What I've done there is taken the original sidebar.php and appended the code for the marketplace sidebar to then end of it. I'm pretty sure I've got all the open/close brackets accounted for, so I'm not seeing what is wrong with the syntax, though I am very much not php coder so I really don't know. It looks right, but I can't see why it doesn't work.

    Saunt Valerian

    Bah! I should have listened to you. I got to work my simply creating the file you suggested in a child theme!

    Thank you!

    I'm almost there too! Here is the result so far (sans any styling changes):
    http://teatra.de/marketplace2

    Click on the categories in the sidebar, you'll notice that the products display the text description when viewing a category page; also it reverts back to the default sidebar on the category pages.

    I have a feeling this is going to require some conditional statements, and this territory is even more foreign to me than what I've been scrambling through already in this thread.

    Saunt Valerian

    This is resolved!

    I now have a full browsable marketplace, built by MarketPress and sorted by category!

    Anyone reading this thread will get confused, next week if I get some time, I'll write up a tutorial, how-to about the best way to create this with a full sidebar. Thank you Mason, I learned alot about WordPress in the last 5 days as I worked on this and you guidance was invuluable!