I would like to see the list of "resource fields" or "Built in Document Object Fields" in the Revolution documentation. I’m talking about the equivalent of
* [*pagetitle*] = page title
* [*longtitle*] = often h1 or h2
* [*description*] = this can be a handy one to use in a meta description, RSS feeds, or with the Ditto Snippet.
* [*introtext*] = a.k.a. Summary; also may be useful to creating RSS feeds or Ditto Snippets.
* [*content*] = the content of the document.
* [*id*] = the unique numerical identifier of the document.
(I pasted that in from http://wiki.modxcms.com/index.php/Placeholders_used_by_MODx_Pages_and_Templates)
Looking solely at the Revo documentation, I don’t know how anyone would be able to make any useful templates without access to this information. The Templates page does refer to the [[*content]] tag, but not in a very clear way in my opinion.
-does the list above carry over exactly from Evo to Revo (other than tag syntax?
-It seems a bit unclear everywhere (not just in the Revo documenation) just exactly what these things *are*, and what they are officially called? How do they differ from user-created TVs? (Important to know since the tag syntax is the same.) It would be great to see an explanation somewhere.
Definitely.
I would like to see the list of "resource fields" or "Built in Document Object Fields" in the Revolution documentation.
Yes.
-does the list above carry over exactly from Evo to Revo (other than tag syntax?
We call them Resource Fields, but that needs to be shored up in the docs, for sure.
-It seems a bit unclear everywhere (not just in the Revo documenation) just exactly what these things *are*, and what they are officially called? How do they differ from user-created TVs? (Important to know since the tag syntax is the same.) It would be great to see an explanation somewhere.
Quote from: splittingred at Nov 09, 2009, 03:44 PM
So, does that mean that I need to refactor all of my code into their own classes and a similar directory structure, with resolvers, and vehicles, and assets, and documentation and all that jazz-- in order to submit the snippets, lexicon and chunks that I’ve already written from within MODx?
I’m working through trying to learn transport packages now, and even though the tutorial specifically states that you can do things other ways, I’ve always found it easiest to learn when the samples that are given use the bare minimum requirements for a starting point. Jquery tools does a great job of this on their website. Every "tool" has a dedicated page with minimal setup. More complex options are also explained also, but at least there is a clear baseline established as far as what the bare minimum requirements are.
No, that’s just an example. That tutorial even explicitly states:
<?php /** * Component Template * * @package component-template * @version 1.0.2 * @release beta * @author Test <[email protected]> */ $mtime = microtime(); $mtime = explode(" ", $mtime); $mtime = $mtime[1] + $mtime[0]; $tstart = $mtime; /* Get rid of time limit. */ set_time_limit(0); /* Set directories for source files. */ $root = dirname(dirname(__FILE__)) . '/'; $sources= array ( 'root' => $root, 'build' => $root . '_build/', 'lexicon' => $root . '_build/lexicon/', 'assets' => $root . 'assets/', 'docs' => $root . '_build/docs/' ); unset($root); /* Override with your own defines here (see build.config.sample.php). */ require_once $sources['build'].'build.config.php'; /* The following four lines aren't necessary if you run this as a snippet inside MODx. */ require_once MODX_CORE_PATH . 'model/modx/modx.class.php'; $modx= new modX(); $modx->initialize('mgr'); $modx->setLogLevel(modX::LOG_LEVEL_INFO); $modx->setLogTarget('ECHO'); /* Set Package Name */ $name = 'component-template'; $version = '1.0.2'; $release = 'beta'; /* Load the Package Builder and create the package */ $modx->loadClass('transport.modPackageBuilder','',false, true); $builder = new modPackageBuilder($modx); $builder->createPackage($name, $version, $release); $builder->registerNamespace('component-template',false,true); /* get the source from the actual snippet in your database * with $modx->getObject('modsnippet',array('name'=>'SnippetName')); * OR * manually create the object, grabbing the source from a file * as we do here: */ $c= $modx->newObject('modSnippet'); $c->set('name', $name); $c->set('description', "<strong>{$version}-{$release}</strong> {$name} for MODx Revolution"); $c->set('category', 0); $c->set('snippet', file_get_contents($sources['assets'] . 'snippet.component-source.php')); /* Create a transport vehicle for the data object */ $attributes= array(xPDOTransport::UNIQUE_KEY => 'name'); $vehicle = $builder->createVehicle($c, $attributes); /* The sections marked optional should be commented out or removed if you don't need them */ /* (optional) Add a validator that will transfer files at the beginning of the install. * If the files are not transferred successfully, the install will abort */ $vehicle->validate('file',array( 'source' => $sources['docs'], 'target' => "return MODX_ASSETS_PATH . 'components/component-template/';", )); /* (optional) Add a php script that will execute at the beginning of the install. * Must return true or the install will abort */ $vehicle->validate('php',array( 'type' => 'php', 'source' => 'preinstall-script.php' )); /* (optional) Add a resolver to transfer files at the end of the install. * This example will transfer the assets/component-template directory * and all its files to core/components/ */ $vehicle->resolve('file',array( 'source' => $sources['assets'] . 'component-template', 'target' => "return MODX_CORE_PATH . 'components/';", )); /* (optional) Add a php script that will execute at the end of the install * Should return true on success. * * It can use all HTML input variables defined in the user_input.html file * added in setPackageAttributes() below. */ $vehicle->resolve('php',array( 'type' => 'php', 'source' => 'install-script.php' )); /* (required) Add Vehicle to Package */ $builder->putVehicle($vehicle); /* (optional) Load lexicon strings */ $builder->buildLexicon($sources['lexicon']); /* (optional) Include readme, license, and/or an html file that interacts with the user during the install. * Each array member is optional but you should always include a readme.txt file. */ $builder->setPackageAttributes(array( 'readme' => file_get_contents($sources['docs'] . 'readme.txt'), 'license' => file_get_contents($sources['docs'] . 'license.txt'), 'setup-options' => file_get_contents($sources['build'] . 'user-input.html') )); /* zip up the package */ $builder->pack(); $mtime= microtime(); $mtime= explode(" ", $mtime); $mtime= $mtime[1] + $mtime[0]; $tend= $mtime; $totalTime= ($tend - $tstart); $totalTime= sprintf("%2.4f s", $totalTime); $modx->log(modX::LOG_LEVEL_INFO, "Package Built Successfully."); $modx->log(modX::LOG_LEVEL_INFO, "Execution time: {$totalTime}"); exit();