What you could do it, open the article in the backend and in the editor, click the small "html" button. You will see your article text and title will be wrapped around a <p>
tag. So firstly, add a class to it like so:
<p class="my_module_article">Title of Article</p>
<p class="my_module_article">Text for article</p>
Then in your module default.php use an if
and else
statement and inside a little CSS like so:
$results = "the code you used to get the articles from the category";
if ($results) {
//code to display the articles
}
else {
$doc = JFactory::getDocument();
$doc->addStyleDeclaration(".my_module_article { display: none; }");
echo "There are no articles to be displayed";
}
I hope this helps