Module route on frontend does not work

  • Hi,


    This is what happen when I click on the link in the Menu from my 'Store' Module

    - http://prntscr.com/hbdvcw

    - http://prntscr.com/hbdwc5


    This is my index.php

  • Alright. Let's debug this :)

    You got an empty <a> tag, because your node does not match a route.


    Please enable debug bar and click on "routes". Do you find @store and which controller is assigned?


    P.S. I moved your topic to the development categories :)

  • Alright. Let's debug this :)

    You got an empty <a> tag, because your node does not match a route.


    Please enable debug bar and click on "routes". Do you find @store and which controller is assigned?


    P.S. I moved your topic to the development categories :)

    About Tag:

    <a> tag isn't empt right since it routes to the current route? A <a> tag where the href is empty will not route to the current route.

    Debug:

    @store /store GumController::indexAction

    Controller:

  • Well - your a tag has no href value ;)


    So it's some kind of "empty" ;)


    Check this:






    A <a> tag where the href is empty will not route to the current route.

    Well - I think this is not true. But I did not google the specifications yet.


    I just opened a new file (test.html), added


    Code
    1. <a class="nav-link" href>Test</a>


    and opened it in my browser. And clicking "test" always returned me to test.html ;)


    Please do the following:

    Change

    Code
    1. 'nodes' => [
    2. 'store' => [
    3. 'name' => '@store/',
    4. 'label' => 'Store',
    5. 'controller' => 'xjoeyv\\gumstore\\GumController',
    6. 'protected' => true,
    7. 'frontpage' => true
    8. ]

    to

    Code
    1. 'nodes' => [
    2. 'store' => [
    3. 'name' => '@store',
    4. 'label' => 'Store',
    5. 'controller' => 'xjoeyv\\gumstore\\Controller\\GumController',
    6. 'protected' => true,
    7. 'frontpage' => true
    8. ]
    9. ],


    And

    change this


    Code
    1. 'routes' => [
    2. '/store' => [
    3. 'name' => '@store/',
    4. 'controller' => [
    5. 'xjoeyv\\gumstore\\GumController'
    6. ]
    7. ],
    8. ],


    to


    Code
    1. 'routes' => [
    2. '/store' => [
    3. 'name' => '@store',
    4. 'controller' => [
    5. 'xjoeyv\\gumstore\\Controller\\GumController'
    6. ]
    7. ],
    8. ],



    I did not check, whether the routing is having a problem with the slash at @store/ but I'd remove it.



    Once you have done that, please clear the Pagekit-cache in the settings, as the routes are cached.

  • Alright I will change this buy keep in mind that the Live website is using the same Database as the Dev version. But on the live version there is nothing installed, this all is on my local version.

  • Alright I will change this buy keep in mind that the Live website is using the same Database as the Dev version. But on the live version there is nothing installed, this all is on my local version.


    Hm? It doesn't matter which site is using which database ;) I showed you an example of the behavior of an a tag without a href value. And this is Pagekit's behavior: If there is no matching route for this node, there will be no href value ;)


    I know this, because I had these problems in the backend often when I was working on my first extensions and messed up the admin-menu ;)

  • Hm? It doesn't matter which site is using which database ;) I showed you an example of the behavior of an a tag without a href value. And this is Pagekit's behavior: If there is no matching route for this node, there will be no href value ;)


    I know this, because I had these problems in the backend often when I was working on my first extensions and messed up the admin-menu ;)

    Anyways Locally it is working now, I also changed the Controller to SiteController and moved it in to a Folder/Namesapce Controller.

    And I made the you suggested ofcourse, That made it work locally but not on the Live Site yet since the module it is not uploaded.


    Now I can continue my Store based on GumRoad