Is it possible to get the article ID inside an article using sourcerer, so I can pass this value to a SQL query? I tried multiple options, but no luck. Any help is greatly appreciated.
Yes, a standard Joomla article with WYSIWYG editor (TinyMCE). We have other Joomla articles with PHP code working well using Sourcerer (db queries and so forth). The output of what you provided is:
Ok, so I found the issue. The article that I was displaying was not standard (overlooked it), but a custom page (using RocketTheme and Gantry 5 framework). Once I switched the menu item for the page to a single article, I got the article ID.
The $article object refers to a stanard Joomla article.
Gantry does stuff differently.
If you want to get 'article' details from Gantry pages, you'll have to ask them for the php code to collect it.