I’ve got a bunch of pages that have registered user content only. On most, I’m using @binding in a template variable to show an information request form. This is fine when registered users view the page, but when unregistered, I want to swap out the info form for a registration form. My thought process is that it would be simplest to just change the @DOCUMENT, like so:
<?php
$private = $modx->documentObject['registeredUserContent'];
$loggedIn = $modx->isMemberOfWebGroup('Registered Users','Site Admins');
$normalContent = $modx->documentObject['content'];
$formBeingAdded = $modx->documentObject['formAddition'][1];
if(if($private[1]!=""){
if("" == $normalContent && !$loggedIn && "" != $formBeingAdded){
$formBeingAdded = "@DOCUMENT 47"; // show a registration form instead of an info request form
}
}
?>
I tried this in a snippet and while it would say that the key was changing to 47, the form wouldn’t. Now I’m trying it in a plugin, but it still doesn’t seem to be working. Is there a way to get this to work, or am I just missing something?