Skip to main content

Questions tagged [plugin-sprig]

Questions about the Sprig plugin.

Filter by
Sorted by
Tagged with
0 votes
0 answers
19 views

Sort entries by related categories when using Sprig filtering & pagination

tl;dr Craft 4.8.6; Sprig 2.8.0 When using Sprig for filtering entries by related categories, and for pagination, how can I sort the listing of entries according to the order of some of those category ...
Sandwich's user avatar
  • 636
1 vote
1 answer
62 views

Local Storage with Sprig

I have a changing sort dropdown using Sprig, works great. Though, I'd like to save this sort order to local storage and pass it as the default to my sprig component. What's the best way to do this? Is ...
JMKelley's user avatar
  • 1,426
0 votes
0 answers
54 views

Sprig add to cart display cart

products index.twig file include a Sprig component with filters: {{ sprig('_components/productCategoryList.twig', { entryId: entry.id }) }} productCategoryList.twig file includes a list of all ...
jjem's user avatar
  • 497
1 vote
1 answer
60 views

Sprig request Getting 414 Request-URI Too Long

I have sprig components on multiple pages, Some are working fine but some get '414 Request-URI Too Long ' Looking at the networks tab, it sends many elementId={ids}&CRAFT_CSRF_TOKEN={token} after ...
Prashant sharma's user avatar
0 votes
0 answers
37 views

Sprig "View Less" Button

I'm trying to build off the "Load More" button, and essentially "Load Less" by reverting back to the initial state. The code below resets it back to 0 and just starts load from the ...
JMKelley's user avatar
  • 1,426
0 votes
1 answer
56 views

I'd like to create a Wishlist and save it into a cookie, instead of having to login

I'm a bit lost. I'd like to create a wishlist for products and save them into a cookie. I don't want anybody to have a login and I don't mind if the list is not sharable and only available on the same ...
outline4's user avatar
  • 595
0 votes
0 answers
26 views

Does descendantOf only accept a single value?

I have a products page on which I'm filtering with Sprig. There are some categories in the form of checkboxes. These categories have some subcategories. The categories are a structured section with ...
Matthias's user avatar
  • 311
1 vote
1 answer
233 views

Create deep copy of twig variable

I'm building a filter page with Craft and Sprig. The goal is to show the amount of products for each filter. So for example if we want to filter on color we show 2 checkboxes "Red" and "...
Matthias's user avatar
  • 311
1 vote
2 answers
72 views

Load More Entries based on Parameter Category Filtering

so i filter some entries via the url parameters... that works fine. But if i load more entries (based on the category parameter), the result includes also all other entries with other categories... ...
Marcel Boer's user avatar
2 votes
2 answers
156 views

How to prevent Twig Syntax Error when a plugin is disabled?

I am using the Sprig plugin, and for some reason I'm disabling it in some environments. In config/general.php I have added: 'disabledPlugins' => ['sprig'] And in my twig template, I have a ...
Romain P.'s user avatar
  • 1,895
1 vote
2 answers
327 views

Sprig: how to redirect to a URL after submitting to a custom controller?

I have a multi-pages form which is submitting using Sprig plugin. The action is targeting a controller in a custom module. Each step of the form is loading using the current step stored in session. ...
Romain P.'s user avatar
  • 1,895
1 vote
1 answer
263 views

Sprig - Use a view all button in conjunction with a load more

I'm trying to create a page where I can view entries in a list and have the option where I can view all entries at the click of a button, or choose to load more as and when I want. With the view all ...
Thomas.hewitt2201's user avatar
1 vote
1 answer
69 views

Filtering entries via a dropdown inside a Matrix Block

I have Entries with a Matrix field called events. I have an Entries field and a Dropdown field inside those Matrix blocks (block type event). I'm currently filtering by entry using andRelatedTo(['and',...
bigdev's user avatar
  • 25
1 vote
1 answer
132 views

Offset on an array (Sprig)

I'm trying to create a load more function using a filtered set of entries, then passing those entries into the Load More component using Sprig. I get the error "Impossible to invoke a method (&...
JMKelley's user avatar
  • 1,426
0 votes
2 answers
82 views

How to dispatch equally entries from different channels?

I have entries from two different channels, where each channel has a different total of entries, and I want to display them equally by batch. Example: Channel #1 | Channel #2 | Channel #1 Channel #1 | ...
Romain P.'s user avatar
  • 1,895
2 votes
1 answer
125 views

Sprig load more: prevent repeating entries with random output

On an article page i show 3 random entries, and a load more button via sprig. {% set query = craft.entries().section(section).orderby('RAND()').offset(offset).limit(3) %} {% set items = query.all() %}...
Henrik's user avatar
  • 425
1 vote
1 answer
460 views

Sprig resets value on render

I Have a sprig component that has two variables, but the moment Sprig changes one of them, the other value resets. Please Help products.twig {% extends "_layout/base" %} {% set wrapClass = '...
Prashant sharma's user avatar
0 votes
1 answer
240 views

Sort entries by separate related entries count

I am working on a sprig board that filters out Lessons from a structure in Craft. This screenshot better illustrates this and how it works. The main table is built using the following: {# Sets default ...
Terry Upton's user avatar
  • 1,894
0 votes
0 answers
180 views

Craft Commerce variants and stock limit

I'm working on solution that shows product variants with ability to select attributes in the front end. Now I have code like this: {% set colour = colour ?? [] %} {% set length = length ?? [] %} {% ...
Lukas Snarskis's user avatar
1 vote
1 answer
479 views

Sprig replacing search field even with s-preserve="true"

I have a relatively simple search of a section called articles. Each entry within articles has a category assigned. I've named the category animal. Layout is as follows: Header Search/filtering ...
InanisAtheos's user avatar
2 votes
2 answers
182 views

Hiding categories in real time with Sprig in a faceted search

I've built three buttons with checkbox dropdowns that display categories that filter the content below based on categories. I am currently using the relatedTo function to only display the categories ...
Elektra Murphy's user avatar
1 vote
1 answer
688 views

Sprig use category filtering AND load more

I have some checkboxes that filter entries by category. All that is working fine on its own. I also have a load more button that is supposed to append additional entries to the query results. The ...
Bryce's user avatar
  • 251
2 votes
1 answer
680 views

Re-initialize / layout Masonry after a sprig change

I've got Sprig set up to filter entries by a few categories. I'm trying to re-layout Masonry JS after this update takes place. For starters, I add Masonry to the window variable (defined as global in ...
Bryce's user avatar
  • 251
2 votes
1 answer
331 views

Swiper breaks when using Sprig

Not sure if this is the right place to ask my question, but I hope someone can help me. I am using Sprig to re-render some cards based on some parameters (with a dropdown filter). These cards also use ...
user avatar
1 vote
2 answers
294 views

Using sprig for category filter but keep getting deprecation errors

I'm using sprig, following the https://craftquest.io/courses/commerce-product-filtering-with-sprig example. I have 3 selects (thickness, look, finish), each using categories from a different group. ...
erwinheiser's user avatar
1 vote
1 answer
1k views

How to use Sprig to filter categories using a dropdown

I'm having an issue where I'm adding a dropdown to my search to filter through the first parent attribute in a category (Winter 2020, Spring 2021, and so on). The search field works, but nothing ...
JBrew30's user avatar
  • 102
1 vote
1 answer
272 views

Simplifying code using the new andRelatedTo param

I have the following code that works with Sprig. But with the new andRelatedTo param, I am wondering if this could be simplified? However, I am a little unsure if/where to start on this and how the ...
Terry Upton's user avatar
  • 1,894
1 vote
1 answer
690 views

Sprig "Load more" not loading over https

I've recently added an SSL to the site I'm working on, and it seems to have broken my "load more" buttons via sprig. When I click the button now, I get Blocked loading mixed active content “...
Justin Kendall's user avatar
1 vote
1 answer
385 views

Load currentUser using Sprig with Blitz

I'm having an issue with Sprig + Blitz Caching. I'm trying to load a user image if currentUser exists, though I'm having an issue with the caching. Sprig is loading in the unregistered user photo when ...
JMKelley's user avatar
  • 1,426
1 vote
1 answer
612 views

Sprig - Filter entries by custom field checkbox values, separate values as well as all values

I am having a question regarding Sprig. I do want to filter my entries for values that are defined in a dropdown field (example below is simplified). It does work to the point where I want to filter ...
HendrikEng's user avatar
  • 1,064
1 vote
1 answer
133 views

Show matrix fields based on quantity [Sprig]

I'm using Commerce to sell tickets to an event and need to get the names of each person. I would like to do this via a Matrix field, showing fields based on the quantity selected. I followed along ...
supazu's user avatar
  • 526
2 votes
2 answers
1k views

How to filter entries by checkboxes using Sprig

I am using the Sprig plugin to filter news entries on a news overview page. I have three checkboxes for the categories related to the news entries. I have the page working for the basic functions by ...
MisterMike's user avatar
1 vote
1 answer
856 views

How to use Sprig's "Load More" Recipe After Update

This is a continuation of a previous question I had (Here). I am using Sprig's Load More Recipe. In my category page, I want the load more function to only pull up entries that equals the current ...
Justin Kendall's user avatar
2 votes
1 answer
390 views

Using Sprig's live search but show all entries first

I want to display all results in the games section to start with, then once you search, it shows the filtered results. Sprig's starting point I think assumes that you're showing nothing, like a normal ...
darylknight's user avatar
  • 3,290
0 votes
1 answer
396 views

Sprig/Snaptcha CSRF issue/question

We have a site using Sprig and Snaptcha. One of our forms is always returning a 400 error "Unable to verify your data submission" which is usually a CSRF issue but thought Sprig takes care ...
Cole Henley's user avatar
  • 1,741