Login or create new account.

By registering on joomprod.com, you will have immediate access to all our free products and to the public side of our support forum.

Enjoy our subscriptions.

Each of our subscriptions allow you to enjoy the private side of the support forum and all the update of our products for a period ranging from 3 months to 1 year.

Payment And immediate download.

After subscribing to one of our subscription, the products are immediately downloadable.

Login

Or Register
Accueil / forum / Public Forum / Main Forum / Search in only current category

Support Availability Because we must sleep sometimes

Working days: Monday to Friday.
Reply time: Depending on the complexity of your support issue it's usually between a few hours to 48 hours.

Support is only guaranteed to paid subscribers

AdsManager - End of life

It is with great regrets that we have chosen to end the developpement of Adsmanager and its other associated components.

AdsManager is born 10 years ago and, as of today, the number of new subscriptions and downloads have fallen and we cannot maintain the component anymore.

All active subscribers will be able to continue enjoying support until the end of their subscription.

The components will be free and no support will be provided anymore for the other users.

×

Notice

The forum is in read only mode.

× OLD Forum post could be checked here : forum.joomprod.com

Search in only current category

More
7 years 8 months ago #26555 by internis19
Search in only current category was created by internis19
Hello,

I have made many categories in my ads configuration. And for each categorie, I have set up a search module with the field of the selected or current categorie menu. The issue comes when someone try an empty search on ads search module. As results, the search displays results from others categories also. The goal am trying to achieve is to restrict search results only on the current categorie or parent one if needed. What should do to get that result please?

I hope I have been so specific to me more helpful.

Thanks for all assistance
More
7 years 8 months ago #26566 by loic
Replied by loic on topic Search in only current category
Hello,

The solution is to custom the search module.

Create an override of the search module view (www.joomprod.com/support/doc/customization.html) and instead of using a select for the category filter, use a input type='hidden' with the current category as a value.

Best regards.
The following user(s) said Thank You: internis19
More
7 years 8 months ago #26584 by raph17
Replied by raph17 on topic Search in only current category
Can u put the site here to see example please?
More
7 years 8 months ago #26592 by loic
Replied by loic on topic Search in only current category
Hello,

Yes, in the module view (the simple search module or the advanced), replace the search by category block :
<div class="<?php echo $class; ?>">
                    <div class="control-group">
                        <?php if($display_cat_label == 1): ?>
                            <label class="control-label" for="catid"><?php echo JText::_('ADSMANAGER_SELECT_CATEGORY_LABEL') ?></label>
                        <?php else: ?>
                            <label class="control-label" for="catid"><?php echo $searchLabel ?></label>
                        <?php endif; ?>
                        <div class="controls">
        <?php 
        switch(@$conf->single_category_selection_type) {
            default:
            case 'normal':
                JHTMLAdsmanagerCategory::displayNormalCategories("catid",$cats,$catid,array("allow_empty"=>true,'id'=>"catid-".$moduleId));break;
            case 'color':
                JHTMLAdsmanagerCategory::displayColorCategories("catid",$cats,$catid,array("allow_empty"=>true,'id'=>"catid-".$moduleId));break;
            case 'combobox':
                JHTMLAdsmanagerCategory::displayComboboxCategories("catid",$cats,$catid,array("allow_empty"=>true,'id'=>"catid-".$moduleId));break;
                break;
            case 'cascade':
                if ($type == "horizontal") 
                    $separator = "";
                else
                    $separator = "<br/>";
                JHTMLAdsmanagerCategory::displaySplitCategories("catid",$cats,$catid,array('separator'=>$separator,'id'=>"catid-".$moduleId));break;
        }
        ?>
                        </div>
                    </div>	
                </div>

By that line :
<?php echo '<input type="hidden" name="catid" id="catid-'.$moduleId.'" value="'.$catid.'" />'; ?>

Then, you just need to be sure that the category selected in the current one.

You can do something like that just before the last code :
$input = JFactory::getApplication()->input;
$currentCat = $input->get('catid', 0, 'integer');
//We check if the $currentCat exist, otherwise we simply use the default setting
if($currentCat != 0) {
    $catid = $currentCat;
}

I did not test that code, I wrote it here to help you with your custom code.

Best regards.
Moderators: perry
Time to create page: 0.159 seconds
Powered by Kunena Forum