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... 3 years 3 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... 3 years 3 months ago #5039

  • Super User
  • Super User's Avatar
  • Offline
  • Administrator
  • Posts: 2941
  • Thank you received: 336
  • Karma: 45
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.441 seconds

Contact us

  No.2/A, Venkateshwara Nagar,
1st Main Road, 100 Feet Road, SBM Towers, Velachery,Chennai - 600 042,India.
 skype.jomclassifieds
 
 
Copyright © 2013-2018 Jomclassifieds.com. All rights reserved. The Joomla! name, and logo are used under a limited license granted in the United States and other countries.

We accept cookies to provide you the best viewing experience. By using our services, you agree to our use of cookies