<a href="[[~[[+parent]]]]">Link</a> and <a href="[~[*parent*]~]">Link</a>
Do you mean the resource that the symlink is taken from?
$content = $modx->resource->get('content');
Sometimes the pagetitle, longtitle, description, introtext will be the same as the resource being linked to, sometimes it will be that of the symlink resource. Having the various tags uncached seems to help.
A snippet to get the class_key always returns modDocument, even though it's obviously a modSymLink. A snippet to get the content directly from the database will return the linked resource's content.
$content = $modx->resource->get('content');
@SELECT content from modx_site_content where id = 4
$thisId = $modx->resource->get('id'); $result = $modx->query("SELECT * FROM modx_site_content WHERE id=$thisId"); if (!is_object($result)) { return 'No result!'; } else { $row = $result->fetch(PDO::FETCH_ASSOC); return 'Result:' . $row['content']; } return;
Got it! Use a snippet:[ed. note: jamesb last edited this post 10 years, 10 months ago.]
$thisId = $modx->resource->get('id'); $result = $modx->query("SELECT * FROM modx_site_content WHERE id=$thisId"); if (!is_object($result)) { return 'No result!'; } else { $row = $result->fetch(PDO::FETCH_ASSOC); return 'Result:' . $row['content']; } return;
the raw xPDO query doesn't process symlink content the way that the modResource object does.
http://rtfm.modx.com/display/xPDO20/xPDO.query