How to display a filter for a list of podcasts?

We’re working on this huge site that includes a podcast section. The podcasts are done by many different people (no repetitions), and there are like 70-80 podcasts so far, adding one per week.

Client wants to avoid scrolling, so we added pagination. But now they also requests that all podcasters are visible in some sort of “directory”. Of course, 70-80 names and growing displayed at the same time would be a lot, so we need filters. But here is (are) the issue(s)…

  1. visitors may not know the podcaster name, so adding a filter by name option may mean nothing for visitors
  2. filtering by subject would require a dropdown. Since subject titles are long, it becomes really confusing, specially on mobile (we already tested it).
  3. search is more or less the same than 1.: visitors won’t know what to search for. I even though of some predictive search but I think it will be just cosmetics for a flawed approach
  4. Client’s option (a list) would be giant, as mentioned above
  5. Alphabetic filtering would be the same as 1. and 3.

Is there an option that could help me achieve the desired result?

Gutenberg Block Filter Hook Key

I’m wanting to add some functionality to the featured image block in the Gutenberg editor. I’ve got pretty close:

enter image description here

The problem is, I’m unable to select an image, and posts that already had a featured image assigned, are not loading the image in the block.

I think this must be due to the original block object’s key not being set. I’ve tried a random value, the post id, the media post id, ‘render’, ‘thumbnail’, and ‘post-thumbnail’, but no dice. What is ‘my-key’ suppose to be set to? Why is the featured image not loading, and not able to be set and saved?

window.wp.hooks.addFilter(      'editor.PostFeaturedImage',      'myplugin/myhook',      function( original ) {          console.log (original);         return function() {              return (                 window.wp.element.createElement(                      'div',                      { key: 'outer' + Math.random() },                      [                         'Prepend above',                         _.extend( original( {} ), { key: 'my-key' } ),                         'Append below'                      ]                 )             );         }      }  ); 

Filter customer collection by custom attribute in magento 2

I created a custom attribute for customer and would like to filter my collection through it.

My UpgradeData:

if (version_compare($  context->getVersion(), '1.0.6', '<')) {      $  attributesInfo = [         'celular'  => [         'label'    => 'Celular',         'type'     => 'varchar', // can be static too         'input'    => 'text',         'unique' => true,         'position' => 90,         'visible'  => true,         'required' => true,         'system'   => 0, // Important otherwise attribute is not seen as custom attribute     ], ];      foreach ($  attributesInfo as $  attributeCode => $  attributeParams) {         $  customerSetup->addAttribute(\Magento\Customer\Model\Customer::ENTITY, $  attributeCode, $  attributeParams);     }      foreach ($  attributesInfo as $  attributeCode => $  attributeParams) {          $  attribute = $  customerSetup->getEavConfig()->getAttribute(\Magento\Customer\Model\Customer::ENTITY, $  attributeCode);         $  attribute->setData(             'used_in_forms',             ['adminhtml_customer']         );         $  attribute->save();     } } 

My Collection:

$  objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $  customerObj = $  objectManager->create('Magento\Customer\Model\ResourceModel\Customer\Collection');          $  customer = $  customerObj->addAttributeToSelect('*')         ->addAttributeToFilter('celular',$  username)         ->load()->getData(); 

Even though I am attaching a value to this field, no customer is found, what should I do?

–EDIT!

Images database: eav_attribute

customer_entity_varchar

Magento 2 REST API – Get filterable attributes of a category before and after applying filter with multiselect

I am trying to achieve multiselect filter in custom script to be able to use it in custom REST API.

While I am able to get all filterable attributes specific to a category. But after applying filter through params (e.g. Size), the size attribute get removed from the filterable attribute list after apply (default magento behaviour).

Need filters to behave as multiselect. I tried to implement it using classes of some 3rd party modules but of no help.

Below is my code

<?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); // Copyright 2009, FedEx Corporation. All rights reserved. // Version 12.0.0 use Magento\Framework\App\Bootstrap; /** * If your external file is in root folder */ require __DIR__ . '/app/bootstrap.php'; $  params = $  _SERVER; $  bootstrap = Bootstrap::create(BP, $  params); ini_set('display_errors', 1); $  obj = $  bootstrap->getObjectManager(); $  state = $  obj->get('Magento\Framework\App\State'); $  state->setAreaCode('frontend');  $  objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $  categoryFactory = $  objectManager->get('Magento\Catalog\Model\CategoryFactory'); $  storeManager = $  objectManager->get('Magento\Store\Model\StoreManagerInterface'); $  resource = $  objectManager->get('Magento\Framework\App\ResourceConnection'); $  request = $  objectManager->get('Magento\Framework\App\Request\Http'); $  params = $  request->getParams(); $  connection = $  resource->getConnection(); $  storeId = $  storeManager->getStore()->getId(); $  categoryId = 824;  $  category = $  categoryFactory->create()->setStoreId($  storeId)->load($  categoryId); $  storeManager->setCurrentStore($  storeId);  $  filterableAttributes = $  objectManager->get(\Magento\Catalog\Model\Layer\Category\FilterableAttributeList::class); $  appState = $  objectManager->get(\Magento\Framework\App\State::class); $  layerResolver = $  objectManager->get(\Magento\Catalog\Model\Layer\Resolver::class); $  filterList = $  objectManager->create(     \Magento\Catalog\Model\Layer\FilterList::class,     [         'filterableAttributes' => $  filterableAttributes     ] );  $  layer = $  layerResolver->get(); $  layer->setCurrentCategory($  category); $  allFilters = $  filterList->getFilters($  layer);  $  beforefinalFilters = []; foreach ($  allFilters as $  filter) {     if ($  filter->getName() != 'Category' && $  filter->getName() != 'Price'){         if ($  filter->getItemsCount()) {             $  output = [];             foreach ($  filter->getItems() as $  item) {                 if($  item->getFilter()->getData("attribute_model")){                     $  flag = false;                     $  code = $  item->getName();                     $  name = strip_tags($  item->getLabel());                      $  beforefinalFilters[$  code][] = array(                                                'name'=> $  name,                         'value'=> $  item->getValue(),                         'code'=> $  item->getFilter()->getAttributeModel()->getAttributeCode(),                         'isActive' => $  flag                     );                 }             }         }     } }  echo "Before filter: \n"; echo "<pre>"; print_r($  beforefinalFilters); echo "</pre>"; echo "----------------------------------------------------------------------------------"; echo "<br>";  $  appliedFilters = array(); foreach ($  allFilters as $  filter) {     if ($  filter->getName() != 'Category' && $  filter->getName() != 'Price' && $  filter->getItemsCount() && isset($  params[$  filter->getAttributeModel()->getAttributeCode()])) {         $  appliedFilters[$  filter->getAttributeModel()->getAttributeCode()]['label'] = $  filter->getAttributeModel()->getFrontendLabel();         $  appliedFilters[$  filter->getAttributeModel()->getAttributeCode()]['value'] = isset($  params[$  filter->getAttributeModel()->getAttributeCode()])?$  params[$  filter->getAttributeModel()->getAttributeCode()]:'';         $  appliedFilters[$  filter->getAttributeModel()->getAttributeCode()]['filter'] = $  filter;         $  request->setParam($  filter->getAttributeModel()->getAttributeCode(), $  params[$  filter->getAttributeModel()->getAttributeCode()]);     } }  foreach ($  appliedFilters as $  key => $  value) {     $  filter = $  value['filter'];     $  filterValue = $  value['value'];     if($  key == 'price' || $  key == 'category'){         continue;     }else{         //apply filter         //Magento\Catalog\Model\Layer\Filter\Attribute         $  filter->apply($  request);     } }  $  collection = $  layer->getProductCollection(); $  collection->getSelect()->group('e.entity_id');   //get filters after applying $  allFiltersAfter = $  filterList->getFilters($  layer);  $  afterfinalFilters = []; foreach ($  allFiltersAfter as $  filter) {     if ($  filter->getName() != 'Category' && $  filter->getName() != 'Price'){         if ($  filter->getItemsCount()) {             $  output = [];             foreach ($  filter->getItems() as $  item) {                 if($  item->getFilter()->getData("attribute_model")){                     $  flag = false;                     $  code = $  item->getName();                     $  name = strip_tags($  item->getLabel());                     $  afterfinalFilters[$  code][] = array(                                                 'name'=> $  name,                         'value'=> $  item->getValue(),                         'code'=> $  item->getFilter()->getAttributeModel()->getAttributeCode(),                         'isActive' => $  flag                     );                 }             }         }     } }  echo "\n After filter: \n"; echo "<pre>"; print_r($  afterfinalFilters); echo "</pre>"; 

ajax filter and select

I am wanting to run an ajax command to return just one column from one row. The first query returns all rows, but just with the Title column. The second query returns just one row, but with all columns.

How do I modify it to return just one column, from one row?

    $  .ajax({        url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('Project%20List')/Items?$  select=Title&amp;$  filter=Title%20Eq%20%27ABC%27", //THE ENDPOINT        method: "GET",                                                              headers: { "Accept": "application/json; odata=verbose" },        success: function (data) {             console.log('hhh '+data.d.results) //RESULTS HERE!!        }     });    $  .ajax({    url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('Project%20List')/Items?$  filter=Title eq 'ABC'&amp;$  select=Title", //THE ENDPOINT    method: "GET",                                                          headers: { "Accept": "application/json; odata=verbose" },    success: function (data) {         console.log('kkk '+data.d.results) //RESULTS HERE!!    } }); 

Interestingly, if I put the following line into Chrome, I do just get the one row, one column.

<snip>_api/web/lists/getbytitle('Project%20List')/Items?$  Select=Title&$  Filter=Title%20eq%20%27ABC%27 

Magento 2 grid filter(active filter) lost on page reload

I am using Webkul Marketplace ext. and they have issue on active filters.

after filtering whenever reloading the page or visiting other page and backing on the filter page then filter get losses and it opens normally(without any filter).

actually there is separate dashboard for the seller where sellers can manage orders,products etc.so these UI’s are some similarity like admin.

Snippet:-

After Filter:- it works as expected.

enter image description here

Revisiting on Filter Page:- Filter gets lossed and act as normally.

enter image description here

I R&D and they suggested to use “” used but no luck.

please help me to resolve this problem.

Magento 2 Load UI grid only after filter search

I have created custom module. In that I am displaying product collection in Ui grid. I have extend \Magento\Catalog\Ui\DataProvider\Product\ProductDataProvider to display collections.

What is my requirement : I want to display(load) collection only after user search anything from filter.

The UI grid should not display any product until user search anything from filter.

My code For this file app/code/Company/module/Ui/DataProvider/Product/Vendor/ProductDataProvider.php

<?php /**  * Copyright © 2015 Magento. All rights reserved.  * See COPYING.txt for license details.  */ namespace Company\module\Ui\DataProvider\Product\Vendor;  use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;  /**  * Class ProductDataProvider  */ class ProductDataProvider extends \Magento\Catalog\Ui\DataProvider\Product\ProductDataProvider {      /**      * Construct      *      * @param string $  name      * @param string $  primaryFieldName      * @param string $  requestFieldName      * @param CollectionFactory $  collectionFactory      * @param \Magento\Ui\DataProvider\AddFieldToCollectionInterface[] $  addFieldStrategies      * @param \Magento\Ui\DataProvider\AddFilterToCollectionInterface[] $  addFilterStrategies      * @param array $  meta      * @param array $  data      */     public function __construct(         $  name,         $  primaryFieldName,         $  requestFieldName,         CollectionFactory $  collectionFactory,         array $  addFieldStrategies = [],         array $  addFilterStrategies = [],         array $  meta = [],         array $  data = []     ) {         parent::__construct($  name, $  primaryFieldName, $  requestFieldName, $  collectionFactory, $  addFieldStrategies, $  addFilterStrategies, $  meta, $  data);         $  this->collection->addAttributeToFilter('type_id', 'configurable');         $  this->collection->addAttributeToFilter('has_options', '1');         $  this->collection->joinField(             'qty',             'cataloginventory_stock_item',             'qty',             'product_id=entity_id',             '{{table}}.stock_id=1',             'left'         );     } } 

How to use Filter property of SPOSitePropertiesEnumerableFilter class

I would like to know how “Filter” property can be use. This is a string value but I do not see any example anywhere on how to use this property.

I would really appreciate if someone can share some working examples here. Also would like to see what all types of filters I can do with “Filter” property.

https://docs.microsoft.com/en-us/previous-versions/office/sharepoint-csom/mt779490%28v%3doffice.15%29

can I use a wildcard in a datasheet view custom filter to NOT show titles that begin with certain words?

I have a calendar list view and want to be able to filter on the title to NOT show items that begin with the word Deleted.

Can you use a wildcard at the end of Deleted to grab all titles that begin with deleted?

Example Does Not equal Deleted*

Thanks, Rhonda

Magento2 Security: How to best filter GET parameters before they reach Magento?

I want to increase the security of one of our Magento2 installations by filtering GET parameters. It seems that, according to our WAF, especially “filter” parameters are often tried to be exploited; for example:

/sweets/candies/natural-flavours.html?product_filter_tryout=1133%25%27%20UNION%20ALL%20SELECT%20NULL%2CNULL%23 

This happens, no matter if filters are used on the website or not. I therefore want to block all requests to ?product_filter_tryout*, or better whitelist all actually used parameters on the site (like ?p=* etc.). How can I achieve this?