Sorry for this question, but I’m just a beginner

I know, that programs based on a GPL program, have to be licensed under the GPL as well.
But can I write a standalone program and just make a snippet to integrate it, without licensing it under GPL?
For example: I write a news system, which can run on it’s own and without modx CMF. But then I want to display the news with modx (through a snippet), is it allowed to sell the news system without putting it under GPL ?
I hope you can help me.
(I don’t want to build the whole site without modx and it’s great features, just besides)