Normally fields are added by the Fields plugin. You can trigger onContentPrepare event to run this and other content plugins:
JFactory::getApplication()->triggerEvent('onContentPrepare', ['com_content.article', &$article, &$article->params]);
Fields will be available via jcfields property on the article object.
Another option is to manually ...
Looking at the source code for com_content - ArticlesModel does not have any filtering capabilities for custom fields. What it does have is tag filtering, so would it be possible to modify your code so that instead of writing a value to a custom field you instead assign a custom tag to the article which you can then use filter.tag when getting your ...
Just to clarify, inside the article view, you can get the ID of the article:
$app = Factory::getApplication();
$app->input->get('option') === 'com_content'
&& $app->input->get('view') === 'article'
// Get the article ID
$article_id = $app->input->getInt('id');
If you use the previous code inside a blog ...
According to a forum post in Joomla (link below), you could check to see if the Session Path Writable is set to NO. If the Session Path Writable is set to no, you will need to contact your hosting provider to change this.
Her is a link to a thread for the same problem: https://forum.joomla.org/viewtopic.php?t=971335
Custom Fields in Articles Anywhere is a Pro feature, so there's the first thing you need to address.
From there, you need to use the Custom field name to show the value of the custom field for that article.
If the custom field is called "Habitat" - that has a ...
SAVE THE DATA
I want to share how I have created the solution to my problem.
Along with the plugin there is a component than is relate with the work I doing, and both will work together. The component has other purposes, but taking advantage of the fact that much of the logic that the plugin needs, is already made or is reusable through the model classes, ...
If I understand your problem correctly then you just have to change the first few lines of your original code because you do not just want look for the user ID from the database (user table) but you also need to define the user ID from the particular article's URL. So try it with using the following at the beginning of your code:
$articleUrl = \Joomla\CMS\...