Going nosidebar shows problems with layout settings
-
Hi Christoph,
Is this plugin still supported? If so, perhaps you will want to look into this…
After changing a Sensei website to full-width-content I started noticing that your plugin doesn’t seem to respect the genesis layout setting. In the code I saw you call get_sidebar instead of genesis_get_sidebar and that is part of the problem. genesis_get_sidebar skips adding a sidebar when layout is set to ‘full-width-content’.
Also I noticed that a lot of pages even when I made this change, don’t even use genesis to build the page. They have their own template that overrules the genesis template and there genesis() isn’t called.
To really connect genesis to sensei you should include genesis versions of the following templates in plugins/woothemes-sensei/plugins/sensei-lms/templates/ (or plugins/sensei-lms/templates/ in the free version) and use them:
archive-course.php archive-lesson.php archive-message.php course-results.php learner-profile.php single-course.php single-lesson.php single-message.php single-quiz.php taxonomy-module.php teacher-archive.php
Also the hook “genesis_pre_get_option_site_layout” isn’t called for post_type_archive pages, like the course archive page. There it prefers to get the layout via genesis_get_cpt_option( ‘layout’ ) and there get_option is called with key “layout” and setting “genesis-cpt-archive-settings-” followed by the post_type id (so “genesis-cpt-archive-settings-course” for the course archive page).
Using the “genesis_pre_get_option_site_layout” hook in the plugin means of course that the user settings for layout are overruled, so one needs to be able to customize in php to even change the default setting the plugin sets, but that can be a strategy since genesis framework users tend to be more willing to do that. You could also make that filterable or set it off by default and offer a filter to activate that.
At the moment the plugin isn’t really connecting Sensei to genesis for most pages. By setting Sensei theme support, most Sensei pages just don’t use genesis at all. Forcing the sidebar just obfuscated that fact. When one wants to go without sidebars that fact becomes visible. Adding the genesis layout setting to archives was a nice touch, but the settings are not used in the frontend layout ( and even if the frontend was build using genesis, setting the layout in the plugin would overrule that setting anyway).
For now I have made custom copies of the templates (that use genesis) and put them in my child theme. Perhaps at some point I will look how to incorporate them in the plugin when you haven’t done that at that point. Up until now I had solved this issue by using css to not diplay the sidebar, but I wanted to stop generating them too.
Hope it helps,
Regards, Hans
- The topic ‘Going nosidebar shows problems with layout settings’ is closed to new replies.