In MODX Evo I uses a very simple tag to bring the all the content from one ID (index page) into a number of other pages so as not to copy n’paste all the time
[[IncludePage? &pageID=1]]
Is there a similar simple way in Revo or do I have to use Get Resources.
If you have the pdoTools extra installed - you can use the pdoField snippet to grab the content of any resource:
[[pdoField?
&id=`1`
&field=`content`
]]
Or you could write your own custom snippet if you’d prefer. You could start with something like this …
Create a snippet called get-field:
<?php
// Get snippet parameters
$id = $modx->getOption('id', $scriptProperties, '');
$field = $modx->getOption('field', $scriptProperties, 'content');
// Check if ID is provided
if (empty($id)) {
return 'Please provide the ID parameter.';
}
// Load the MODX resource
$resource = $modx->getObject('modResource', $id);
// Check if resource exists
if (!$resource) {
return 'Could not find resource with ID ' . $id;
}
// Get the field value
$value = $resource->get($field);
// Return the field value
return $value;
Then you can call it in your templates and chunks like this: