We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36931
    • 206 Posts
    Good day!

    When I create a resource named 'Stages', on the Setting tab the 'container' checkbox is not checked
    When I create a new resource named 'stages' (as well) child of 'Stages', on the stetting tab of 'Stages' resource is now checked.

    I know, it's confusing, but we want to have the same name(becauce on smartphone, the first level of the menu is clickable to develop the submenu only). Then I have to click on Stages/stages to have the stages content text..

    To avoid the confusion, I added [1] and [2] to Stage[1]/stage[2] to show the id resource and I use a S capital and a small s

    -Home
    -- Home
    -- introduction
    -- other menu
    -Stages[1]
    -- stages[2]
    -- other menu
    -- other menu

    Now I have to create sevral pages under stages

    -Stage[1]
    -- stages[2]
    --- event 1 title and description
    --- event 2 title and desctiption
    --- even 5 title and description
    --- etc..
    the event resource and child pages of Stage[1]/stage[2] will not be displayed in menu. But I create a new Wayfinder which will display all link of all events from the stage[2] page (i call it 'event' to avoid confusion with the word satge...)

    In that way, the page Stage[1]/stage[2] will list all published 'event' resource as a links and if my editor want to add a new event, he will create a new resource under Stages[1]/stage[2].

    The problem
    When I check the resource stage[2] in the setting tab, the 'container' checkbox is not checked
    When I creted a child resource of stage[2], in the setting tab of stage[2], the 'container' checkbox is now checked but the stage[2] mneu is not clickable any more. It's displayed in menu, but when I click nothing happen.

    To make stage[2] (Stage/stage) clickable, I have to edit the resource stage[2] and uncheck the container checkbox and save.

    Of course, I do not want to say to my editor, "each time you create an event", uncheck the container checkbox.

    How can I make the container check box permanently uncheck wathever, I create or modify an event (child resource of stage[2])?

    Thank a lot
    (I hope you understand my menu in spite of Stage and stage shocked) )

    Cheers
      • 3749
      • 24,544 Posts
      In MODX Evolution, when you save a child resource, the parent is automatically set to be a container.
      At one time, MODX Revolution had that setting independent of whether the resource had children or not, but AFAIK, that's no longer true and it now works like Evolution.

      I think you can change the container_suffix System Setting to make container URLs the same as non-container URLS if that would solve your problem.

      Another possible workaround is to create a plugin attached to the OnDocFormSave event with this code:

      $resource->set('isfolder', false);
      $resource->save();
      
      $parent = $resource->getOne('Parent');
      
      if ($parent) {
          $parent->set('isfolder', false);
          $parent->save();
      }


      I'm not sure it would work, but it might be worth a try. I'm not sure how it would affect the checkbox, but it should make sure no resource is marked as a container. If it works, though, it will mean that no resource could ever be marked as a container.

        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting