• Jimako
    Main Admin
    Posts: 328
    Joined: 2 years ago
    Wed Jun 27 2018, 15:45  Jimako

    Here are instruction how to do it correct way (official way)


    Here are steps I used to get old theme Race work correctly with Theme manager and Menu manager without big effort:

    1you need theme.xml file

    Way how to get it: 

    copy from other theme and replace related things or use convert tools for it Theme Manager. 

    There is problem how to fill some fields so look at other themes to get inspired.

    Generated theme.xml with convert tool:

    <?xml version="1.0" encoding="utf-8"?>
    <e107Theme name="Race" lan="LAN_PLUGIN" version="2.0" date="1529833978" compatibility="2.0" livedemo="">
    <author name="Flash" url="http://www.themesbase.com/e107-Themes/7106_Race.html" />
    <summary lan="">Race Theme made by Flash</summary>
    <description lan="">Race Theme made by Flash</description>
    <layout name='default' title='Default' default='true' />

    Warning:  you got error if your theme is Race and your folder is Race_cars. So just copy displayed file and create file manually

    Note: you can use this tool only if theme.xml doesn't exist. If you have one, renamed it to somewhere else.

    From this file important part is:

    <layout name='default' title='Default' default='true' />



    There is problem because there are 2 layouts and Menu Manager doesn't work.

    2. you need to fix layouts in generated theme.xml

    - check for all  $CUSTOMPAGES[] in your theme.php and add them as layout

    - set custompages for saving your time. You can change this in theme manager.

  • Jimako
    Main Admin
    Posts: 328
    Joined: 2 years ago
    Wed Jun 27 2018, 15:48  Jimako

    3. fix theme.php  

    1.  replace variables $HEADER and $FOOTER  (to rid warning about using deprecated headers and footers).

    Each custompage's header and footer needs use different variable name (in my case $OLDFOOTER01,  $OLDFOOTER02, but header is the same for all pages, so just $OLDHEADER)

    2. add new headers and footers for version 2

    $LAYOUT['_header_'] = '';

    $LAYOUT['_footer_']  = '';

    If you have one version of header, you can use it directly.

    3. add new layouts (according theme.xml)

    add $LAYOUT['default']  with {---} 

    add all needed layouts according theme.xml

    add correct footers 

    Menu manager is now fixed.

    Important:  Check if Go button displays Menu areas, if not, something is wrong.

    Correct result:


  • Jimako
    Main Admin
    Posts: 328
    Joined: 2 years ago

    4. Add menus to new layout

    This is new in version 2, each layout has the separate set of menus. 

    Warning:  Be sure that you set correct default layout in Theme Manager at the beginning. If you change it later, you will do this again. 

    Just check what menus are used for default and add the same menus with the same config for new layout.

    Be sure you are on the correct layout and be aware that menu left checked after you add it to layout, so without unchecking you add it again with new menu.

  • Jimako
    Main Admin
    Posts: 328
    Joined: 2 years ago


    You did everything right and it still doesn't work as should be?

    In my case  url /forum/  displays wrong layout.

    1. how to check what layout is really used? 

    - open page source and find body tag.

    <body id='layout-default' >

    So default layout is used and fix is in Theme Manager (Site theme)

    2. how to fix correct layout?

    in my case needed layout has this definition when to use it:

    <span>page.php e107_plugins/ submitnews.php download.php upload.php forum.php forum_post.php forum_viewtopic.php user.php usersettings.php</span>

    but my url is /forum/ so changing forum.php to forum is fix 

    <body id='layout-no-right-menu-area' >

    3. great, layouts are correct, but menus are not displayed with second layout. 

    Go to Menu manager and check if menus are there. 

    In my case they didn't (no idea why, I was sure I did it).