• 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

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hello Hans @hanswitteprins,

    I think your position is the right way. I read a lot about this and stop with the custom copies of the templates.

    You can share these templates?

    Sureno, from the south end of this pandemic world.

    Thread Starter Hans Schuijff

    (@hanswitteprins)

    Hi @sureno,

    of course you can have them. I just forked the plugin as is on github and added them to it in a template subdir, so there you can find it. The link will bring you there.

    I haven’t further looked into it, so for now I just placed the templates in a sensei sub-directory of my child-theme so sensei will use them instead of changing the plugin. I probably will find out how to add the templates from within a plugin to make it child-theme independent. Perhaps genesis connect for woocommerce has done something like that and I can model it to that, when I want to spend some more time on this.

    Making the templates was not that difficult. I just selected all templates that started with get_header and ended with get_footer and removed that part and put the rest in a function I hooked to genesis_loop and after that I just called genesis() like always. As I remember, I just needed to add the pagination somewhere, but it seems to work like this.

    The rest was basically adding some custom css to my theme.

    The part of the plugin that forces the layouts, I disabled for now, since it’s not perfect and I rather do that in the settings or in my core functionality plugin.

    Hope it helps.

    regards, Hans

    Hi @hanswitteprins
    Thank you very much for explaining the operation so clearly. Very little information is available online.

    Sure it helps me a lot.

    Regards from the south end of this pandemic world, Sureno

    Thread Starter Hans Schuijff

    (@hanswitteprins)

    Hi @sureno,

    Since my attention was with this problem today, I decided to dive into the genesis connect voor woocommerce and add a template loader to my fork of the plugin. I updated it to version 1.2.1.

    The version in my repo now loads the genesis versions of the templates automatically and, just like genesis connect for woocommerce, it first looks for the templates in the theme, so you can overrule the plugin templates at any point.

    When you now download the version from my repo and install the zip (you can delete the old version and reinstall it from that zip, or use an ftp-program to copy the new plugin files over the old ones) it should work.

    In this version I have removed (disabled) the function that forces the layout, since that can now better be done in the settings, or by adding that to your theme.

    If you would like it back, just uncomment the add_action statement in src/site-layout/site-layout.php (line 30).

    It works for me.

    Hope it helps. Enjoy!

    Hans

    Amazing! Thank you again!

    Thread Starter Hans Schuijff

    (@hanswitteprins)

    Hi @sureno,

    My pleasure, I wanted to reprogram it for myself anyway, so no worries.

    Already updated it again to 1.2.2, because I made a last minute change that broke the previous version. Sorry for that. This version works fine again. Those last minute small changes will byte you, when you don’t test them again. ??

    Have a nice day!

    regards,

    Hans

    Hi Hans,

    In fact the 1.2.1 shows a white screen in all sensei and woocommerce pages. But the new one works smoothy.

    Have a nice day!

    Thread Starter Hans Schuijff

    (@hanswitteprins)

    @sureno,

    Yes, I know. That’s what happens when the template path gets corrupted and the template can’t be loaded. I still had mine in the theme, so I found out somewhat later.

    Glad to hear it works now for you too.

    Cheers, Hans

    Thread Starter Hans Schuijff

    (@hanswitteprins)

    @sureno,

    You might want to refresh versions, since I found an error loading the single message template. I renamed my fork, since it is now mostly different from the original and is namespaced.

    I added some core functionality I needed (like adding a sortable modules column to the lesson list) and I found that the is_sensei() function did not include all Sensei LMS pages, so I added some custom code for that too.

    I won’t inform you this way again, since it is off topic here, but you know where to find the fork, if you need to reach me.

    regards,

    Hans

    Hi Hans,

    Thanks a lot for the info.

    Have a nice day!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Going nosidebar shows problems with layout settings’ is closed to new replies.