We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36669
    • 12 Posts
    (I hope, I chose the right subforum. If not, please move.)

    My question: How do I retrieve the category of an instance of modElement?
      • 28215
      • 4,149 Posts
      Either the ID:

      $categoryId = $element->get('category');
      


      Or the object:

      $category = $element->getOne('Category');
      

        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 36669
        • 12 Posts
        Ah OK, thank you.
        It’s a bit difficult to find out via the API-docs as the inherited methods are not listed.