<p>Make a newsletter with articles posted this month...</p> <p>Select the articles you want to publish in this newsletter by ticking the check box in the list below. Then press the button labelled "Make my newsletter!"</p> <form> <ul>[!Ditto? &parents=`48`&tpl=`articleSelect` &depth=`1` !]</ul> <input type="submit" value="Make my newsletter!" /> </form>
<p>Make a newsletter with articles posted this month...</p> <p>Select the articles you want to publish in this newsletter by ticking the check box in the list below. Then press the button labelled "Make my newsletter!"</p> <form action="" method="post"> <ul>[!Ditto? &startID=`48` &depth=`1` &tpl=`articleSelect`!]<ul> <input type="submit" value="Make newsletter!" /> </form>
<li> <input name="" type="checkbox" value="[+id+]" /> <a href="[~[+id+]~]">[+title+]</a><br> <p>[+summary+]</p> <p>[+link+]</p> <p>[+author+]</p> <p>[+date+]</p> </li>
//This plugin ensures that only the files that are featured in the news directory appear with the jot snippet
$Ditto = "<hr /><br />[!Ditto? &startID=`48` &depth=`1` &tpl=`articleSelect`!]";
/// OK: If on the site index page then there is no document ID which breaks the 'getDocumentIdentifier()' code
if (! isset($_REQUEST['id'])) {
return;
}
$documentId = $modx->getDocumentIdentifier("id");
//Check the parent directory
$parent = $modx->getParent($documentId, 1, 'id');
//The id of the news folder which is the parent directory for the blog posts
$newsletter = 80;
//If the parent directory is the news directory
if (isset($parent['id']) && $parent['id'] == $newsletter)
{
//Append the news snippet to the content displayed in the page
$modx->setPlaceHolder('Ditto', $Ditto);
}
else
{
//Output the page content as normal
}