I am using a CCK (Seblod) that extends com_content and allows adding complex fields, like PHP code to be run on onBeforeRender event.
I need to change the values of some
attribs of an article in the article view, specifically set
show_title to 0 to hide native Joomla title and replace it with a custom field, and I am trying to to that through this php field attached to before render event.
I have checked that in this before render context, I cannot access the
$this object (it gives me the classical error "Using $this when not in object context"), but I can access current article via
$article = JTable::getInstance("content"); $article->load($id);
$id is taken from JInput. I have also seen that I can read the
show_title value in the JSON value retrieved with
But, as a beginner Joomla developer, I cannot find a way to change that value. Just to be clear: I don't want to change it in the DB (for which I have read I should use JTable->store), I need to change it in the before render so that native Joomla title is not displayed.
$article->attribs->set... of course does not work since
$article->attribs is just a string... but also maybe JTable is not the correct way to do that because it maps to the db...
Is it possible to do that in this context (no access to $this)?