On the related question: it's possible, either with a quick hack on the plugin, or (eventually) we could add that functionality into the plugin itself for a new release.
The quick hack approach would look like this. Bear in mind that this hasn't gone through any real testing to make sure that the validation works out correctly.
In CommentingPlugin.php, add queue_js('tiny_mce/tiny_mce')
to the hookPublicThemeHeader
method so it looks like:
public function hookPublicThemeHeader()
{
queue_css('commenting');
queue_js('commenting');
queue_js('tiny_mce/tiny_mce');
}
Then, in /views/public/javascripts/commenting.js add the tinyMCE init code, so the last few lines look like this:
jQuery(document).ready(function() {
jQuery('.comment-reply').click(Commenting.moveForm);
tinyMCE.init({mode:"textareas", theme:"simple"});
});
That should at least add the editor, I don't know if any other problems might come in with the editor's validation vs the plugins validation.
For the unrelated question -- BTW, it'll be helpful for everyone to start a new thread for questions unrelated to the thread :) -- that'd roughly be it.
Depending on what item types have that field, you could use item_has_type('Relevant Type')
to check whether to continue. item()
will return an empty string, not NULL, for an empty field. So something like this might be what you need:
`
if(item_has_type('Relevant Type')) {
$data = item('Item Type Metadata', 'URL or Embedded Object');
if($data == '') {
echo display_random_featured_item();
} else {
echo $data;
}
}
HTH.
If there are followup questions, lets move those to a new thread.