Skip to content
  1. Extras
  2. pdoTools
  3. General Properties

General parameters for snippets based on pdoTools / pdoFetch

Sample resource parameters

These parameters define the derived objects.

NameDescriptionBy default
&classClass of a derived objectmodResource
&parentsList of parents to search the result, separated by commas. If you put 0, the sample is not limited. If parent id begins with a hyphen, it and its children are eliminated from the sample. If you have to limit the sample by &depth parameter in resource root, you should use &parents=+0Current resource
&depthSearch depth of child resources from its parent10
&resourcesList of resources to search the results, separated by commas. If resource id begins with a hyphen, this resource is eliminated from the sample.
&templatesList of templates to filter the results, separated by commas. If template id begins with a hyphen, resources with it are eliminated from the sample.
&contextSample limitation by the resource context
&whereExtra parameter array of the sample coded in JSON
&showHiddenShow resources hidden in menu0
&showUnpublishedShow unpublished resources0
&showDeletedShow deleted resources0
&hideContainersExclude container resources, that is, resources with «isfolder = 1».0
&hideUnsearchableExclude the resources hidden from the search
&selectList of fields for sample, separated by commas. JSON can be indicated with the array, e.g. {"modResource":"id,pagetitle,content"}.
&leftJoinAnalog SQL of left join
&rightJoinAnalog SQL of right join
&innerJoinAnalog SQL of inner join
&sortbyAny resource field for sorting, it includes TV parameter, if it is indicated in &includeTVs parameter. JSON line can be indicated with array for several fields. Indicate «RAND()» for random sortingpagetitle
&sortdirSorting direction: descending or ascendingASC
&groupbyIndicate the field by which results are grouped
&havingIt is used to limit the sample of grouping lines by condition for the whole group, specified in &groupby
&limitLimitation of sample results. «0» can be used0
&offsetResult skip from the beginning0
&firstNumber of the first iteration in output results1
&lastNumber of the last iteration in output resultsAutomatic formula evaluation (total + first — 1)
&loadModelsList of components, which models should be downloaded for query building, they should be separated by commas, e.g. &loadModels=ms2gallery,msearch2.
&tvFiltersList of TV filters with delimiter AND and OR. Delimiter, indicated in &tvFiltersOrDelimiter is a logic condition OR and its conditions are grouped in the first place. You can define the list of values in each group, separated by &tvFiltersAndDelimiter. Search of values can be held in any specific TV, if it is («myTV==value») or any («value»). E.g. &tvFilters=`filter2==one,filter1==bar%||filter1==foo`. Pay attention: filtration uses LIKE and “%” is metacharacter. Search is on values that physically located in the database, i.e. values from TV settings don’t get here on default
&tvFiltersAndDelimiterDelimiter for conditions AND in &tvFilters.,
&tvFiltersOrDelimiterDelimiter for conditions OR in &tvFilters.`
&sortbyTVAdditional field by which all the results should be sorted. It can be indicated directly in &sortby
&sortdirTVSorting direction on extra fiend indicated in &sortby. It can be indicated directly in &sortby
&checkPermissionsIndicate which permissions should be checked at the output of objects
&disableConditionsIt disables specific class modResource sample parameters

Template parameters

These parameters set up chunks which contain templates for output generation, i.e. they are changed with the overview.

&tplChunk name for resource registration. If it not indicated, ‘field content of the source will be printed to the screen
&tplFirstChunk name for the first resource in the results
&tplLastChunk name for the last resource in the results
&tplOddChunk name for every second resource
&tpl_NChunk name for N-resource, e.g. &tpl_4=tpl4th will set up template for 4th resource
&tpl_nNChunk name for N-resource, e.g. &tpl_n4=tplEvery4th will be applied for every 4th resource
&tplConditionResource field from which the value for selecting chunk will be obtained by the condition in &conditionalTpls.
&tplOperatorOptional operator for comparison of resource field in &tplCondition with array of values and chunks in &conditionalTpls.
&conditionalTplsJSON line with array which in keys has something which &tplCondition will be compared with, and values – chunks which will be used to output if the comparison is successful. Comparison operator is indicated in &tplOperator. Arrays without keys can be used for «isempty» operators
&outputSeparatorOptional line for separation of the results

Results parameters

These parameters define additionally what data and in what way it will be output.

NameDescriptionOn default
&returnIt defines the way of result output. Chunks – gauging, data – output value fields, sql – output of SQL-demand, ids – symbols separated by commaschunks
&fastModeFast more of chunk processing. All raw tags (conditions, snippets and so on) will be cut.0
&nestedChunkPrefixPrefix for “fast placeholders”, included by &fastMode parameterpdotools_
&idxYou can indicate the initial number of iteration for result output
&totalVarName of placeholders for saving the total number of resultstotal
&includeContentInclude the field «content» to the output0
&includeTVsList of TV parameters for the output, separated by commas. E.g.: «action,time» will yield placeholders [[+action]] and [[+time]].
&includeTVListAlias &includeTVs
&prepareTVsList of TV parameters that need to be processed before the output1 means preparation for all TV included in &includeTVs
&processTVsList of TV parameters that need to be processed before the output. If it is set in «1», all TV mentioned in «&includeTVs» will be processed
&tvPrefixPrefix for TV parameterstv.
&prepareSnippetIndicate the snippet that accepts data before the output in chunk and can vary or add them1
&decodeJSONDissemble fields like JSON instead of outputting in line
&schemeScheme of forming url is passed to modX::makeUrl()-1 (concerning site_url)
&useWeblinkUrlEnsure the link subject to resource class
&toSeparatePlaceholdersIf you indicate a word in this parameter, ALL the results will be specified in different placeholders that begin with this word and end with the serial number of the line from zero. E.g. indicating «myPl», you get placeholders [[+myPl0]], [[+myPl1]] and so on
&additionalPlaceholdersInstall additional placeholders
&cache_keyCache keyValue of system setting cache_resource_key for resources (on default resource) or default
&cache_handlerCache handlerValue of system setting cache_resource_handler or xPDOFileCache
&cache TimeCache timeValue of system setting cache_resource_expires or 0 (eternal)

Fenom Parser parameters

These parameters define settings for the fenom parser.

NameDescriptionBy default
&fenomModifiersComma separated list of snippets that could be used as fenom modifier

How to call chunks

All chunks can have one of these prefixes:

  • @INLINE or @CODE. Code after this prefix will be used as template.

      &tpl=`@INLINE <li>[[+pagetitle]]</li>`
      &tpl=`@INLINE <li>[[+pagetitle]]</li>`


    Snippets, other chunks and output filters cannot be indicated in INLINE chunks, because parser MODX handle them in the first place, and snippet will not get what you wanted.

  • @FILE. File content Is used instead of chunk from the database. Track to the file is indicated by system setting pdotools_elements_path. Name of the file have extension .tpl or .html.

      &tpl=`@FILE fileBasedRow.tpl`
      &tpl=`@FILE fileBasedRow.tpl`
  • @TEMPLATE. Identifier or name of template is indicated. If it is empty – its own template will be used for every resource.

      &tpl=`@TEMPLATE 10`
      &tpl=`@TEMPLATE 10`
  • @CHUNK. Similarly to the indication of chunk names.

      &tpl=`@CHUNK tpl.Resource.row`
      &tpl=`@CHUNK tpl.Resource.row`