OroCommerce Forums

Covering OroCommerce topics, including community updates and company announcements.

Forums Forums OroCommerce Issues while creating a Layout Theme

This topic contains 15 replies, has 4 voices, and was last updated by  msulima 6 years ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #31709

    mike.mckean
    Participant

    Hello! I’ve been following the Quick Start guide for Layout Themes, and have run into a couple problems after making the controller. Below is my controller (example copied from the guide):

    First, I was blocked by the fact that routing would not work in the Controller (annotation type). The ‘/test’ route was not recognized by Symfony. After research I tried including this in app/config/routing.yml:

    … and that worked! So, I think it should be noted in the docs that this change is required for routing to work.

    However, I then went to /test and the page only contained a header and footer, with empty content. I tried to place some HTML in various places in the default.html.twig file, but none of it showed up. Does anyone know what I might be missing? I followed the Quick Start exactly as far as I know.


    UI Developer at E7 Solutions
    http://www.e7solutions.com

Viewing 15 replies - 1 through 15 (of 15 total)
  • Author
    Replies
  • #31710

    mike.mckean
    Participant

    Is it possible my reference to the layout is not written correctly? It is in the same directory as the default. (everything else is directly copied from the Quick Start)


    UI Developer at E7 Solutions
    http://www.e7solutions.com

    #31711

    dnahrebecki
    Moderator

    Hello mike,
    please check following points:
    – if your definition of “store” theme meets requirements link
    – if you set your theme as a default link
    – if you are working in dev mode you can check all layout structure in debug toolbar
    – if you are working in dev mode you can enable “System -> Configuration -> General setup -> Development settings -> Include Block Debug Info Into HTML” and check in your browser which layout blocks are rendered

    Also, you can have a look at theme and layout documentation

    Best Regards,
    Daniel Nahrebecki

    #31712

    mike.mckean
    Participant

    Sorry Daniel, I had to continue this through email. Here are some points that helped me solve the issue, that I didn’t get from the docs:

    1. Be sure to set the theme in the Admin panel, not just in config.yml. Otherwise the ‘default’ theme (which is actually the id of Oro’s layout theme) overrides it.
    2. The Quick Start docs work for Platform, but not for OroCommerce. When you set ‘groups’ in theme.yml, you need to include the ‘commerce’ group:


    UI Developer at E7 Solutions
    http://www.e7solutions.com

    #31713

    dnahrebecki
    Moderator

    Thanks for pointing this out. I’ve created a ticket to make documentation more clear for this case.

    #31714

    mike.mckean
    Participant

    Thanks!


    UI Developer at E7 Solutions
    http://www.e7solutions.com

    #31715

    karl.arreola
    Participant

    Hi Mike,

    I’m having the same as you were before, but I’m stuck with my controller not being detected or not routed properly in my bundle since I get a 404 error when I try to load to page with the assigned route. Any tips?

    #31716

    msulima
    Moderator

    Hello, karl.arreola.

    It seems few mistakes in your code. Please pay attention on file paths and namespaces of php classes.
    Next I added you code with fixes and it works correct.

    You need frontend: true to use this route on front store part of OroCommerce application.

    And check that required route is available:


    #31717

    karl.arreola
    Participant

    I was able to register the bundle the previous way before, I just thought my controller wasn’t routed correctly but will try this anyways. I have a few questions though, Is it just a convention with the way you packaged the bundle or is it an actual requirement with oro/symfony? What does priority 255 do in bundles.yml?

    #31718

    msulima
    Moderator

    Is it just a convention with the way you packaged the bundle or is it an actual requirement with oro/symfony?

    This is recommendations for Symfony bundles. http://symfony.com/doc/2.3/cookbook/bundles/best_practices.html

    What does priority 255 do in bundles.yml?

    This is order of bundle for loading it in Symfony kernel. As result, will be generated /app/cache/prod/bundles.php and your bundle will be in the end of list bundles to loading in application.


    #31719

    karl.arreola
    Participant

    The controller seems to be working but the theme and layout aren’t loading. I have the theme and layout exactly the same as the quickstart doc. I also ran clear:cache, assets:install, and assetic:dump but hasn’t changed anything.

    #31720

    msulima
    Moderator
    #31721

    karl.arreola
    Participant

    It doesn’t show up in System Configuration

    #31722

    msulima
    Moderator

    Open “System / Configuration” in menu on admin panel.
    Then open “System Configuration / Commerce / Design / Theme” and choose your theme in “Theme Settings”.
    Next click “Save settings”.


    #31723

    karl.arreola
    Participant

    I meant the theme is not showing up in the drop down of themes

    #31724

    msulima
    Moderator

    Maybe something wrong with your custom theme. Next article may help you with that https://oroinc.com/b2b-ecommerce/doc/current/dev-guide/theme/layout#application-themes.

    Also, you can customize exists default theme for example.

    If you can’t fix your theme. Please post your theme configuration. I’ll try to fix it.


Viewing 15 replies - 1 through 15 (of 15 total)

The forum ‘OroCommerce’ is closed to new topics and replies.

Back to top