We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7327
    • 195 Posts
    Hi,

    Is there a way to use a specific ditto instances’ ID name (specified via a ditto call parameter &id=`dittoname`) in a placeholder (something like [+dittoname+])? I’m thinking of using the ID name with PHx for some interesting effects.

    Cheers,
    Les
      • 7327
      • 195 Posts
      Ok I’ve figured out a basic way to retrieve this via a ditto extender:

      <?php
      
      /* Filename: dittoinstance.extender.inc.php
       * Title: Ditto Instance
       * Purpose:
       *  	Returns the instance ID of Ditto
      */
      
      
      
      $placeholders['dittoinstance'] = array(array("returnDittoInstance"),"returnDittoInstance");
      
      if (!function_exists("returnDittoInstance")) {
      	function returnDittoInstance() {
      		return substr($GLOBALS["dittoID"],0,-1);
      	}
      }
      
      
      ?>
      



      1. Save the file in your Ditto extenders directory
      2. Include &extenders=`dittoinstance` in your Ditto call
      3. Include the placeholder [+dittoinstance+] in your chunks

      In case anyone here’s looking for a way to display content (typically in the same page) differently via PHx depending on which ditto instance is calling, the above will help.

      Cheers,
      Les