Download the PHP package mage-obsidian/module-search without Composer

On this page you can find all versions of the php package mage-obsidian/module-search. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package module-search

MageObsidian โ€” Search

Latest Version License

Star MageObsidian

๐Ÿ“š Documentation ยท ๐Ÿš€ Live demo ยท ๐Ÿ’ฌ Discussions

Filtering, sorting and paging a category or search listing stop re-assembling the whole page. The first view is still server-rendered HTML; every interaction after it fetches only the regions that change.

What it actually does

A listing URL with ?obsidian_fragment=1 runs the native controller in full โ€” category registered, layer resolved, custom design applied, layout built โ€” and then, instead of rendering the page, answers with the regions that change:

The HTML is produced by the page's own blocks, classes and templates, so it cannot drift from the markup it replaces. Prices in particular come out of the renderer pool the page uses rather than being re-derived from raw numbers.

Nothing here is required for the listing to work. Every filter, sort and pager control is a real link or a <select> whose options are real URLs; without JS, with the feature off, or after a failed exchange the same click navigates.

Measured

Magento 2.4.8, production mode with an optimised classmap and opcache, Luma sample data, p50 of 15 uncached requests measured at nginx:

page fragment
Category listing 94,4 ms ยท 152 KB 75,7 ms ยท 117 KB โˆ’20 %
Category, one filter applied 129,7 ms ยท 105 KB 115,5 ms ยท 66 KB โˆ’11 %
Category, page 2 91,6 ms ยท 152 KB 75,0 ms ยท 117 KB โˆ’18 %
Search results 92,9 ms 76,8 ms โˆ’17 %

The saving is page assembly, not data: the layout is still generated in full so that the fragment is the page's own markup โ€” only the head, the chrome and the page template are skipped.

Install

On by default. Stores โ†’ Configuration โ†’ MageObsidian โ†’ Frontend โ†’ Product Listing turns it off; ?obsidian_data=0 turns it off for one visit.

Theme contract

The module swaps regions the theme marks. mage-obsidian/theme-default already carries them; a custom theme needs one attribute per region:

Section Where the attribute goes Page
filters root of Magento_LayeredNavigation::layer/view.twig, outside its visibility check both
listing root of Magento_Catalog::product/list.twig category
results root of Magento_CatalogSearch::result.twig search

The attribute must wrap the block's whole output, including its empty state โ€” a filter combination with no results still has to leave something to swap back.

Search marks result.twig rather than the grid inside it on purpose: that template asks for the result count before rendering the grid, and that call is what settles the toolbar's sort state. A fragment built from the grid alone reproduces the markup of a page that was never rendered that way.

Animation

A swap runs inside document.startViewTransition, so the exchange is animated rather than snapped in. The choreography is entirely CSS, scoped to the obsidian-listing-swap class the navigator holds on <html> while a swap is in flight โ€” nothing here reaches a full page navigation.

A theme gets all of this by carrying the names above on .product-item and the toolbar-top / toolbar-bottom classes on its toolbars. Carrying neither is not an error: the swap still animates, just as one crossfade instead of many parts.

It steps aside where an animation would be wrong: browsers without the API, a visitor with prefers-reduced-motion (the theme neutralises every ::view-transition-* animation), and while a modal <dialog> is open โ€” the mobile filter drawer lives in the top layer, which is painted into neither snapshot, so transitioning around it would blink the drawer out of existence.

Scrolling, when a swap needs it, happens before the transition opens, so both snapshots share a viewport and a surviving card moves one slot instead of the length of the page.

Extending

SectionPool is the whole contract. A module that adds a region to a listing declares it:

Declaration order is render order, and it has to match the page. The sidebar sits before the content in every two-column layout, and rendering the layered navigation is what settles the layer before the grid asks it anything; listing first and the toolbar comes back with a different sort and page size than the page had. Set a block name to an empty string to switch a section off.

mageobsidian_listing_fragment is a layout handle added before the layout is built; it removes the page furniture. Override it if a servable region of yours lives in a container it drops.

The exchange announces itself on the event bus as listing_navigate_before, _after and _failed (mirrored on window as obsidian:listing_navigate_*). _after is what re-binds enhancers whose elements were just replaced.

Failure behaviour

Caching

The fragment is exactly as cacheable as the page it comes from: the same layout decides it, and X-Magento-Tags is stamped from the same blocks, so a product or category save invalidates both. Fragments are separate cache objects from the pages, and the client sorts the query string so one set of filters is one object however the visitor clicked into it.

Cardinality is the limit, not configuration: a single category with 13 filter groups has more combinations than any cache can hold. What caches is the head of the distribution โ€” one or two filters โ€” which is what the traffic actually is.

Known limits

Documentation

For more details, visit the official documentation.


All versions of module-search with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
mage-obsidian/module-modern-frontend Version ^2.13
mage-obsidian/module-storefront Version ^3.20
mage-obsidian/module-catalog Version ^3.5.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mage-obsidian/module-search contains the following files

Loading the files please wait ...