Getting Help with MODx

We provide the very creative custom development and support for php web sites. Let us know your needs / ideas / questions: contact us, request a quote for template / custom developments. 

There's an old maxim in procuring programming. You can either have quality, speed, or cost, but not all three. We try to incorporate all the three aspects while working with clients.  In a 'normal' market choice between two coders - one who knows the API and one who doesn't - the client would go for the one with the API skills. As that dev is now in demand (compared to the other dev). The 'art' in business, is for the API developer to charge at such a rate that they remain competitive against the PHP dev over time - eg charging 10% (relative to the PHP dev) for developing 50% faster.

Although, our and modx support team strives to constantly add to and refine the documentation to help you get up to speed with MODx and get back to us if you are stuck or need something extraordinary | not common | not usual | innovative. Here you can give it a try:

Some very frequently used MODx API calls

    <?
      // Get and set placeholders
      $var=$modx->getPlaceholder('placeholder_name');
      $modx->setPlaceholder('placeholder_name', $var);

      // Print placeholders in HTML
      ?>
       
      <?

      // Run snippet
      $params['test']=1;
      $params['dummy']=2;
      $snippet=$modx->runSnippet('snippet_name', $params);

      // Run snippet in HTML
      ?>
       
      <?

      // Get chunk
      $chunk=$modx->getChunk('chunk_name');

      // Print chunk in HTML
      ?>
       
      <?

      // Parse chunks
      $params['test']=1;
      $params['dummy']=2;
      $chunk=$modx->parseChunk('chunk_name', $params, '');

      // Get MODx documents
      $id=$modx->documentIdentifier;
      $document=$modx->getParent($id);
      $document=$modx->getDocument($id);
      $document=$modx->getDocumentChildren($id);
      $document=$modx->getActiveChildren($id, 'menuindex', 'ASC');

      // MODx document array
      $id=$document['id'];
      $pagetitle=$document['pagetitle'];
      $longtitle=$document['longtitle'];
      $description=$document['description'];
      $alias=$document['alias'];
      …

      // Get the value of template variables
      $document_tvs=$modx->getTemplateVarOutput(true, $id);
      $templatevar_output=$document_tvs['template_variable_name'];

      // Print template variables in HTML
      ?>
       
      <?

      // Make URL
      $url=$modx->makeUrl(intval($id));

      // Make URL in HTML
      ?>
       [~id~]
      <?

      // Send Redirect to the Browser
      $count_attempts=1;
      $modx->sendRedirect('http://www.newdomain.com', $count_attempts, 'REDIRECT_HEADER', 'HTTP/1.1 301 Moved Permanently');

      // Forward to a new MODx document without reloading the page
      $modx->sendForward($id);

      // get MODx configuration
      $site_name=$modx->config['site_name'];
      $site_url=$modx->config['site_url'];
      $site_start=$modx->config['site_start'];
      $error_page=$modx->config['error_page'];
      $base_path=$modx->config['base_path'];
      $base_url=$modx->config['base_url'];
      $rb_base_dir=$modx->config['rb_base_dir'];
      $rb_base_url=$modx->config['rb_base_url']; 
      $modx_charset=$modx->config['modx_charset'];
      …

      // Get MODx configuration in HTML
      ?>
       MODx Support - Hire dedicated MODx developer
       https://modx-cms.sergeymiracle.com/
       …
      <?

      // Handle MODx events
      $event=$modx->Event;
      switch($event->name)
      {
       case "OnBeforeDocFormSave":
         …
       break;
      }

      // TV @SELECT
      @SELECT pagetitle FROM modx_site_content WHERE parent = 329 ORDER BY pagetitle
    ?>

    Some code reference and shared on Github please visit: https://github.com/modxcustomize
    This proves our devs 10 years+ portfolio in Web development.
    Ask more details via Socail links and the form below, thanks


    Rate this information:
    • Currently3/5 Stars
    • 1
    • 2
    • 3
    • 4
    • 5
    Votes: 9

    May we recommend:
    Wordpress for a Dental Project  Remove malicious code from website  Warehouse software  Content Management  

    MODX CMS extensions Sale:

    6h support  1h support  import products into opencart  5h support  


    Modx Extras for advanced content