Categories
CMS Joomla Mastering Development

Create custom fields with installing a template

We use content custom fields in our template overrides. Every time we set up a new Joomla website we have to create those same fields manually. Is there a way to create them with the installation of our template?

Categories
CMS Joomla Mastering Development

Joomla php function which prints the pagename

Is there a php function to insert in the template which prints the name of the menu item of the displayed page?

Categories
CMS Joomla Mastering Development

Get values of other custom fields in field layout override

I am using a repeatable custom field in Joomla! 3.9.16 with an alternative layout (override) of com_fields/layouts/field/render.php and an override of plugins/fields/repeatable/tmpl/repeatable.php to show the fields content in columns “After Display”. This is working fine. The number of columns should depend on the value of a radio-field of the same field-group. I do not get […]

Categories
CMS Joomla Mastering Development

How to refresh only one module with ajax without reload page?

I am using a module mod_globalnews which show all my articles in position ‘portfolio’. Since my articles have different published and finished time I need a solution to refesh the module or module position with ajax every 10minutes without need to reload page. I try the system plugin Add FullAjax but its not working. I […]

Categories
CMS Joomla Mastering Development

How can I call com_contact fields in an article view?

We have linked the author to com_contacts and now I want to show an author image which will be a custom field in com_contacts. I was able to show it as a com_user custom field using the following code: $fields = FieldsHelper::getFields(‘com_users.user’, JFactory::getUser($author), true); foreach($fields as $field) { $fields[$field->name] = $field; } $profilePicture = $fields[‘profilepicture50x50’]->value; […]

Categories
CMS Joomla Mastering Development

JSON to String in Joomla

I have the following method to convert JSON to a String // Convert the JSON-encoded image info into an array $image = new JRegistry; $image->loadString($this->item->image, ‘JSON’); $this->item->imageDetails = $image; But this code works only on an object. Is there any way to use these functions on an array?

Categories
CMS Joomla Mastering Development

Upload and attachement for phpmailer

hello i starting an code to allow sending file via a form i create an input file field <input type=”file” name=”‘.$field_name.'[]” accept=”‘.$values_field[0].'” id=”‘.$field_id.'” ‘.$placeholder.’ aria-label=”‘.$field_label.'” class=”inputfile ‘.$required.'” ‘.$uploadmode.’ style=”margin:0″ maxuploads = 2 > i create this code //upload attachement $files = $jinput->files->get($formid); if (isset($files)) { foreach($files as $attachements) { foreach ($attachements as $file){ // Import […]

Categories
CMS Joomla Mastering Development

How to compare current date to article created date?

I need a code to compare if current date and time is greater than article created time of joomla. I have this example code: function CompareDate() { // new Date(Year, Month, Date, Hr, Min, Sec); var dateOne = new Date(2020, 03, 20, 11, 00, 00); var dateTwo = new Date(2020, 03, 20, 12, 00, 00); […]

Categories
CMS Joomla Mastering Development

Captcha ‘optional’ field displays when it’s really required

I’ve just installed a number of captcha extensions and they all show “Captcha * (optional)” next to the form’s Submit button. Is there any way to prevent the word ‘optional’ from displaying? The input is required.

Categories
CMS Joomla Mastering Development

Retrieve all fields using while in Joomla

I’m trying to retrieve data using while and it won’t work. The page just keeps loading and ends up with a blank page; no errors or anything but, when i use foreach, it works. Any explanation?