Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [params]

The tag has no usage guidance.

0
votes
0answers
24 views

Using relatedTo with a string of category ids

I have got a list of product variants being filtered by a string of category ids if there is some data in the category parameter with the following code: (Note that I'm using the + character between ...
1
vote
0answers
7 views

Paginate a list of product variants with categories parameters

I have got a category multi-select feature that allows users to filter variants by more than one category. On selection the URL is concatenated as a new category as follows: ?cat=blue ?cat=blue+...
2
votes
1answer
51 views

How to display entries filtered from more than one category

I want to try to learn how I can filter entries by multiple categories. I realise similar questions have been asked in the past, but all the answers are for specific use cases. All I want to do is ...
1
vote
2answers
784 views

Get a named parameter value from request

Yii's named parameters are available in the template. For example, for the following route configuration: 'post/<post_id:\d+>' => ['template' => 'post-entry'], The value of post_id in my ...
2
votes
1answer
104 views

Trying to build params to be able find entries related to an entry and that are related to a specific category

I want to generate a list of events that are related to a specific festival and that are related to a specific category. This goal sits alongside some others that are inspiring me to attempt this in ...
1
vote
1answer
79 views

Using AND with craft.entries()

I'm trying to return entries based on some criteria. I exclude entries with a given value like this: {% set someEntries = craft.entries({ level: 1, id: '1,2,3,4,5', myOtherField: 'not ...
0
votes
1answer
118 views

Display the next and previous category

The examples I have seen to link to previous and next entry all seem to be for sections. I want to get the previous and next category. My category handler is called 'media'. So I might have entries ...
1
vote
1answer
97 views

getParam not working anymore

I encountered a problem which is very similar to this post. I've been using the letter "p" as part of a search string so www.website.com/test?p=querystring. It worked for more 6 months and now all of ...
3
votes
1answer
244 views

search parameter passed to include

I have a template where I would like to pass a search parameter to a craft.entries.section in an included template. The current main template has this: {% include "_includes/testimonial" with { ...
5
votes
1answer
209 views

Filtering on related entries (with an array query param)

I'm getting myself into a potential pickle here and wanting to know the best way to get apply filters on the current scenario: I have a central business section which is getting populated via an API (...
3
votes
1answer
603 views

Empty .getParam() does not return an array with dump()

craft.request.getQuery() returns: array (size=5) 'tags' => string 'anxiety' (length=7) 'maxPrice' => string '' (length=0) 'sessions' => array (size=4) 0 => string 'email' ...
3
votes
1answer
104 views

Dynamically create craft.entries

Basically I want to add certain parameters to my 'craft.entries' based on whether a variable is set: {# Get a start date value from the URL (my use case) #} {% set start_date = craft.request....
1
vote
0answers
2k views

How to get a param from an ajax request in twig?

Ok this has been puzzling me for too long now! I have some code that makes an ajax request: reqAjax: { type: 'get', url: '/mytemplatefolder/myfile.html', data: {town: 'bournemouth'} } ...
0
votes
1answer
221 views

How to check custom field not empty within params?

The following returns entries correctly: {% paginate craft.entries.section('sectionName').customField(':notempty:').limit(10) as products %} {% for product in products %} {% include 'incs/...
2
votes
1answer
74 views

Selecting entries with min value through search param

Trying to do something quite basic but can't seem to get it right.. I'm searching through a form, and want to select entries where the value 'pax' is equal or more than the searched value. {% set ...
2
votes
1answer
203 views

getParam not working on live server?

Not sure what is happening but {% set searchQuery = craft.request.getParam('q') %} Does not seem to be working at all on a different server than staging. Anyone seen this before? Any ideas what ...
2
votes
1answer
998 views

Filtering entries by multiple URL parameters on the front end

This answer here helped me get multiple same-name parameters to filter entries: (ex: ?recipe=healthy&recipe=salad&recipe=dinner) Now I'm looking for a way to get multiple different ...
3
votes
3answers
849 views

Multiple craft.entries field parameters

I have an for entry loop in which I need to look for two different field conditions. Separately they are: craft.entries.eventStartDate('>=' ~ (now.date)) craft.entries.genericEventDate(':notempty:...
1
vote
1answer
148 views

Prevent queries based on condition

I have a set of parameters that need to be checked before outputting an entry in a particular section of a website. The code for that looks somewhat like this: {% for slide in craft.entries.section('...
2
votes
1answer
2k views

How to get query or param from URL and then use in Links?

I'm trying to grab the query or param from an URL and then add it to an URL. like products?price=15 How can I add the ?price=15 to a URL? Like products/category?price=15?
4
votes
2answers
3k views

Determine Entry based on URL Parameters?

I have a bit of code that checks if a page's title has been manually set in a parent template, and if it has to use that, otherwise to use entry.title. This is what that bit looks like: {% set ...
3
votes
1answer
767 views

Build Query relatedTo multiple categories

Trying to build a complex query and I'm sure there is bound to be a better way of doing it that the multiple if statements I currently have. URL for the page is /products/(category1)/(category2)/(...
4
votes
1answer
676 views

Paginate an array with multiple filters

I'm looking to paginate and array with multiple filters. The current url would be: www.example.com/search?filter=shorts&type=leather&brand=sams Clicking on the next next link returns: www....
3
votes
0answers
589 views

Filter entries with segments and params based on categories and fields [closed]

I'm working on a webshop with an advanced filter / search with multiple categories, entry types and fields and sorting options. Schematic URL site.com/template/entry.type/category/?size=category OR ...