How to modify mobile templates

OMF themes can also apply custom template files, i.e. if your custom OMF theme already has a template, it will override the default OMF template file.

There are two fundamental advantages to following this approach:

  1. You can always revert to the default OMF theme. This way you are safe to experiment with your custom theme, change the layout and even mess up the code.

  2. You get to keep your changes when updating OMF and you don't have to remember which files you have modified.

Here's how to safely modify OMF templates: 

    1. Create a custom OMF theme, if you don't have one already.
    2. Create a template directory. Go to your custom mobile theme directory
      /catalog/view/theme/your_omf_theme
      create a new directory there and call it template.
    3. Create the template subdirectories. You need to have the same file structure in your custom OMF theme to be able to override a default template.

      Example:
      If you want to modify the file
      /catalog/view/theme/omf2/template/product/product_mobile.tpl
      go to /catalog/view/theme/your_omf_theme/template
      create a new directory there and call it product.
      If you want to modify the file
      /catalog/view/theme/omf2/template/common/footer_mobile.tpl
      go to /catalog/view/theme/your_omf_theme/template
      create a new directory there and call it common.
    4. Copy the template files to your theme. Copy the file you wish to modify to the corresponding directory in your custom OMF theme.

      Continued from the previous example:
      If you wish to modify the product page on the blue theme, copy the file
      /catalog/view/theme/omf2/template/product/product_mobile.tpl
      to /catalog/view/theme/your_omf_theme/template/product/product_mobile.tpl

      If you wish to modify the product page on the white theme, copy the file
      /catalog/view/theme/omf2/template/product/product_mobile.tpl
      to /catalog/view/theme/your_omf_theme/template/product/product_mobile.tpl

      If you wish to modify the footer, copy the file
      /catalog/view/theme/omf2/template/common/footer_mobile.tpl
      to
      /catalog/view/theme/your_omf_theme/template/common/footer_mobile.tpl

      Please note: The default white theme has 3 templates of its own (product/product_mobile.tpl, module/category_mobile.tpl and checkout/cart_mobile.tpl). If you want to modify this theme, make sure to copy the corresponding templates from /catalog/view/theme/omf2-min/.
    5. Apply your custom theme. When you're finished modifying the template files in your custom theme directory, apply your custom theme via the OMF Admin panel.
Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk