Is there a way to display something based on whether or not a certain document (not the page the visitor is on) is published?
Thanks in advance for your help!
-
☆ A M B ☆
- 24,524 Posts
Yes, of course. A resource’s publish status in in the database, so it’s easy to use a query to determine if resource X is published. Exactly how to do so depends on which version of MODx you’re using.
Thanks for your reply. I’m using 1.0.5.
-
☆ A M B ☆
- 24,524 Posts
Then a simple snippet would do the trick:
$modx->db->getValue($modx->db->select('published', $modx->getFullTableName('site_content'), "id=$x")) ? <it's 1, so do Y> : <it's 0 so do Z>;