Show Sidebar Log in
Commons In A Box Logo
  • Home
  • About
    • Project Team
    • Logos and Graphics
  • Showcase
    • CBOX Classic Showcase
    • CBOX OpenLab Showcase
  • Demo
  • Get Started
  • Documentation
    • Technical Guide
    • CBOX Classic Guide
    • CBOX OpenLab Guide
  • Support Forums
    • CBOX Classic
    • CBOX OpenLab
    • Developers Forum
  • News

Group Admins

  • Profile picture of Scott Voth

CBOX Classic Support

Public Group active 4 months ago

This group provides support for Commons In A Box Classic, our original software for community-building. Register for an account or log in to commonsinabox.org, then join the group and post your question here.

Child theming and files in the /engine/includes folder

  • This topic has 2 replies, 2 voices, and was last updated 8 years, 5 months ago by Troy Welch.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • November 14, 2016 at 6:10 pm #6129
    Troy Welch
    Participant

    Hi, just full of questions. I’m noticing that files in the /engine/includes folder of the child theme are not used instead of their parent theme counter parts.

    I need to use modified versions of:

    1. templatetags.php to implement Boone’s fix of the xprofile group tabs on the front-end edit screen. This one will be fixed in the next version, so I’m not so worried about it.
    2. sidebars-cbox-php: in cbox theme documentation there is a wireframe of the home page template that identifies a “free text area” just beneath the slider. It doesn’t seem to exist in the current template. In any event, I want to put a widget there anyway. So I’m using sidebars-cbox.php to define a new widget are to call from a modified homepage-template. The child homepage-template overrides the parent, but the sidebars-cbox.php does not. Such a change in the parent theme would not be future proof.

    Is there a way to add these files or the whole /engine/includes folder to the set of child theme files that supercede the parent theme’s.

    November 15, 2016 at 10:10 am #6131
    Christian Wach
    Participant

    @troy You’re right that none of these files can be overridden by placing modified versions in your child theme. However, this needn’t prevent you from implementing your modifications.

    templatetags.php to implement Boone’s fix of the xprofile group tabs on the front-end edit screen. This one will be fixed in the next version, so I’m not so worried about it.

    There’s no need to override this file – go ahead and modify the file in the ‘cbox-theme’ parent theme directory. It’ll be overwritten with the fixed version in the next update.

    in cbox theme documentation there is a wireframe of the home page template that identifies a “free text area” just beneath the slider. It doesn’t seem to exist in the current template.

    Apologies – this is indeed a mistake in the documentation.

    In any event, I want to put a widget there anyway. So I’m using sidebars-cbox.php to define a new widget are to call from a modified homepage-template. The child homepage-template overrides the parent, but the sidebars-cbox.php does not. Such a change in the parent theme would not be future proof.

    You don’t need to override sidebars-cbox.php to achieve this. The slightly-misnamed “sidebars” (actually widget areas, as you’ve discovered) are registered cumulatively. All you’d need to do is to register your sidebar in addition to the existing ones. So, in your child theme’s functions.php file, add the following and amend to suit your needs:

    /**
     * Register even more sidebars.
     */
    function cbox_child_theme_register_sidebars() {
    	register_sidebar( array(
    		'name' => 'Homepage Free',
    		'id' => 'homepage-free',
    		'description' => "The free text Widget on the Homepage",
    		'before_widget' => '<div id="%1$s" class="widget %2$s">',
    		'after_widget' => '</div>',
    		'before_title' => '<h4>',
    		'after_title' => '</h4>'
    	));	
    }
    add_action( 'widgets_init', 'cbox_child_theme_register_sidebars' );
    

    Hope that helps.

    Cheers, Christian

    November 15, 2016 at 11:28 am #6132
    Troy Welch
    Participant

    Thanks for the quick followup Christian. Actually, between shower inspiration and one of the CBox docs I reached the same conclusion on these.

    My php/Wordpress Dev is “in a state of development”. This is also the first CBox/Buddypress project I’ve tackled and it would not be a stretch to say that it is a little complex for a first project.

    Thanks for all your help.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In
Group logo of CBOX Classic Support
  • Home
  • Forum
  • Announcements
  • Docs
  • Members 287
  • Send Invites

Groups

Newest | Active | Popular | Alphabetical
  • Group logo of CBOX Classic Support
    CBOX Classic Support
    287 members
  • Group logo of CBOX Pioneers
    CBOX Pioneers
    71 members
  • Group logo of CBOX Developers
    CBOX Developers
    40 members
  • Group logo of CBOX OpenLab Support
    CBOX OpenLab Support
    22 members
  • Group logo of CBOX-OL Testing Partners
    CBOX-OL Testing Partners
    12 members

CBOX has its roots in the CUNY Academic Commons, which in turn was made possible through funding from The City University of New York itself.

CUNY Logo

CUNY Academic Commons Logo

City Tech logo

The Commons In A Box was made possible through the generous support of the Alfred P. Sloan Foundation.

Alfred P. Sloan Foundation Logo

NEH Logo

The CUNY Graduate Center has directly contributed to the CUNY Academic Commons, housing the project since its inception, and has contributed to CBOX through its GC Digital Initiatives.

CUNY Graduate Center Logo

CUNY Graduate Center Digital Initiatives Logo

Powered by Commons In A Box
css.php
Skip to toolbar
  • About WordPress
    • WordPress.org
    • Documentation
    • Learn WordPress
    • Support
    • Feedback
  • Log In
  • Register