We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1576
    • 24 Posts
    So I’ve been noticing that whenever I create a weblink as a child of another resource, it makes that resource a container.

    Now this isn’t really an problem, it’s easy enough to disable the container option, but it does seem to effect some things like the creation of IDs in navmenus.

    Not entirely sure why, but anyhow, I think this might be a bug. If it isn’t a bug, then I confess I don’t understand the reasoning behind it.

    Also, there doesn’t appear to be a way to turn an existing resource that is not already a weblink INTO one. Am I mistaken?

    It’d be a really nice feature if you could do that.
      • 3749
      • 24,544 Posts
      Evo or Revo? Evo automatically sets the isfolder field if the resource has children. I don’t think there’s a way around that. In Revo, the isFolder field and $resource->hasChildren() are independent. I think a number of snippets haven’t caught up with the change, though.
        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
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        In Evo, if a resource is not marked as a container any children it has won’t show up in the Tree.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 3749
          • 24,544 Posts
          Quote from: sottwell at Sep 14, 2010, 11:47 PM

          In Evo, if a resource is not marked as a container any children it has won’t show up in the Tree.

          I didn’t know that. I think the container checkbox is set every time you save a resource with children, though, unless that has changed.
            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
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            You are correct; that must have been an older version of MODx I accidentally did that to.
            // check to see document is a folder
            $rs = $modx->db->select('COUNT(id)', $tbl_site_content, 'parent='. $_REQUEST['id']);
            if (!$rs) {
                $modx->manager->saveFormValues(27);
                echo "An error occured while attempting to find the document's children.";
                exit;
            }
            $row = $modx->db->getRow($rs);
            if ($row['COUNT(id)'] > 0) {
                $isfolder = 1;
            }
            
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 1576
              • 24 Posts
              I’m using Revo.