WordPress.org

Ready to get started?Download WordPress

Forums

BP My Home
[resolved] Custom Widgets (9 posts)

  1. deepbevel
    Member
    Posted 2 years ago #

    Hi imath,
    Me again, I've accomplished quite a bit with your code help, I'm still working on the same project!
    http://www.foursticks.net/TravelBlog4/

    This time I actually have a question about BP my Home (imagine that!)
    With previous versions I was able to create cutom sidebars that can accomodate php widgets in bp my home. However after upgrading to this latest one the method no longer seems to work.
    The way I did it was to register the new sidebars in functions.php, then copy and rename your example widget to match the sidebars. Then I just changed a bit of code at the bottom of the widget.php files to associate with the sidebar.

    /**
    * main function called by BP My Home
    */
    function bpmh_example_c_widget_display(){
    	?>
    	<?php dynamic_sidebar( 'imath-bpmh-first-b' ) ?>	<?php
    }
    ?>

    Is there a new way to do this now? I'm still using the old version of BP my home but it seems to brake the sidebar on the My Home page, otherwise it works fine accept It only seems to show all my php widgets if I refrain from using more than one iframe. I wanted to see if these things could be remidied with the new version.

    (still using previous version of Buddypress, waiting for Custom Community theme upgrade)

    Thanks Again!

    http://wordpress.org/extend/plugins/bp-my-home/

  2. imath
    Member
    Plugin Author

    Posted 2 years ago #

    Well, it seems the trick is still working for me on WP 3.2.1 + BP 1.5.1 ...

    in my functions.php i registered a sidebar :

    function imath_dtheme_widgets_init(){
    	register_sidebar( array(
    		'name' => __( 'Fifth Footer Widget Area', 'buddypress' ),
    		'id' => 'fifth-footer-widget-area',
    		'description' => __( 'The fifth footer widget area', 'buddypress' ),
    		'before_widget' => '<li id="%1$s" class="widget %2$s">',
    		'after_widget' => '</li>',
    		'before_title' => '<h3 class="widgettitle">',
    		'after_title' => '</h3>',
    		) );
    }
    
    add_action( 'widgets_init', 'imath_dtheme_widgets_init' );

    then in my bpmh-example.php widgets i simply edited the main function with this :

    function bpmh_example_widget_display(){
    	?>
    	<ul>
    	<?php dynamic_sidebar( 'Fifth Footer Widget Area' );?>
    	</ul>
    	<?php
    
    }
  3. deepbevel
    Member
    Posted 2 years ago #

    Thank you, I'll try it again.

  4. mfgnet
    Member
    Posted 1 year ago #

    I need to transform the notepad into a rich editor with html input. Can you help with this? I'm still a student and just now beginning php.

  5. deepbevel
    Member
    Posted 1 year ago #

    I wouldn't know where to start on that. I would guess the notepad is in a custom post type for bp my home. I've used plugins to add new fields to post types. That's probably where I'd start but I'm quite sure my solution would be awkward and involve lot's of trial and error.

  6. deepbevel
    Member
    Posted 1 year ago #

    concider registering a new sidebar for a text editor widget. It's been a while since i've used this plugin but I think you can do that.

    You can also make your own widgets for bp my home. Although I never tried it. But I was able to register the new sidebars and add any widget to bp my home. It was my intro to wordpress.

  7. imath
    Member
    Plugin Author

    Posted 1 year ago #

    DeepBevel is right, you should try to create a new widget by adapting the example widget that comes with the plugin to your needs. Then, the wp_editor class can be an interesting way to try to add a rich text editor to your widget.

  8. deepbevel
    Member
    Posted 1 year ago #

    Hi imath, The set up I was working on for this old thread turned out great, thanks to your help. I'm still waiting for my clients to write all the travel itineraries for the interative flash map, it's going to take another few years to complete, but should be very cool and useful to travelers when complete.

  9. imath
    Member
    Plugin Author

    Posted 1 year ago #

    great new ! congrats for your work on this project ;)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags