Ability to create custom pages in new Store

Discussion in 'News & Announcements' started by dkolvakh, Jul 22, 2013.

  1. dkolvakh

    dkolvakh Odin Team

    Messages:
    348
    Hello.

    There was no ability to create a custom pages in new Store (f.e. to show partners, affiliates, certificates, advertising and so on), without chance to lose customization upon upgrade. This was taken into account during 4.3.4 development and I want to introduce this feature right now.

    There are two files added, which will not be overwritten during upgrade to next versions:
    • /var/opt/hspc-store/includes/routing_custom.yml - contains custom routing rules
    • /var/opt/hspc-store/includes/Entity/ControllerCustom.php - contains custom controllers

    So, to add new page you have to:
    • Create a unique custom route in routing_custom.yml
    • Create a controller for it in ControllerCustom.php
    • Create a template, if needed (example located at /var/opt/hspc-store/templates/custom_page.html.php) within your customization path (/var/opt/hspc-store/customization/vendor/[VENDOR_ID]/templates/)
    • Delete cached routes /var/opt/hspc-store/cache/ProjectUrlGenerator.php, /var/opt/hspc-store/cache/ProjectUrlMatcher.php
    • Add link to the custom page somewhere in the Store layout (header.html.php or footer.html.php within your customization path (/var/opt/hspc-store/customization/vendor/[VENDOR_ID]/templates/)

    More details about creating routes and controllers can be found in Symfony Documentation.

    Your comments and suggestions are welcome.

    --
    Regards,
    Denis Kolvakh
    Parallels
     
    Last edited: Jul 23, 2013

Share This Page