Welcome, Guest
Username: Password: Remember me

TOPIC: Is there a way to set a default image or...

Is there a way to set a default image or... 1 year 8 months ago #5028

Hi!
any option to set a default image? Or maybe set the image field required so users are forced to upload an image?

Thanks,

Jackson
The administrator has disabled public write access.

Is there a way to set a default image or... 1 year 8 months ago #5039

  • Super User
  • Super User's Avatar
  • Offline
  • Administrator
  • Posts: 2759
  • Thank you received: 292
  • Karma: 40
Hi,

Currently there is no option to change the default image. But you can change the image path in the jomclassifieds.php file from the below path,
Root-->component-->com_jomclassifieds-->jomclassifieds.php

In the above file search the below code and change the default image path
define('JOMCLASSIFIEDS_DEFAULT_IMG', JURI::ROOT().'components/com_jomclassifieds/assets/noimage.gif');

Else if you need to make the image field mandatory, Please follow the below steps

1. Open jomClassifieds.js file from the below path,
Root -> Components -> com_jomclassifieds -> js -> jomClassifieds.js

Find the below code in the function "addNewImage"
var input = $jomClassifieds('<input/>', {name:'images[]', type:'file', maxlength:100}).appendTo(li);

And change the above code as the below one,
var input = $jomClassifieds('<input/>', {name:'images[]', type:'file', maxlength:100, class:'required'}).appendTo(li);

2. Open add.php file from the below path,
Components -> com_jomclassifieds -> views -> user -> tmpl -> add.php

Find the below code in the above file
<label class="control-label"><?php echo JText::_('IMAGES'); ?>

Add the below code after the above one
<span class="mandatory">*</span>

3. Open edit.php file from the below path,
Components -> com_jomclassifieds -> views -> user -> tmpl -> edit.php

Find the below code in the above file
<label class="control-label"><?php echo JText::_('IMAGES'); ?>

Add the below code after the above one
<span class="mandatory">*</span>

That's it. Now save all the files and check your front-end

Thanks.
The administrator has disabled public write access.
Time to create page: 0.272 seconds