Skip to main content

Questions tagged [querystring]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
25 views

Setting form values based on querystring

I'm working on a project that is using Sprout Forms not for saving form submissions but as an interface for searching Craft entries. So the idea is after submitting the form, the template performs a ...
Tyssen's user avatar
  • 653
1 vote
1 answer
68 views

Search Console showing pages with index.php? in the url

Google Search Console lists page urls that include a query string /index.php?={some_page_name}. I have not been to figure out why. This occurs with valid pages as well as some urls that have redirects....
Roi Agneta's user avatar
  • 1,463
0 votes
0 answers
110 views

How to fetch data from pagination URL with Feed Me plugin

I have a pagination URL http://example.com/v3/?limit=12&page=1 I try this code: {% set page = craft.app.request.getParam('p') %} {% set params = { url: 'http://example.com/v3/?limit=12&...
user2707393's user avatar
1 vote
1 answer
1k views

Updating/replacing query string parameters with twig

I have code similar to below that basically just outputs links with query parameters: {% for country in craft.categories.group("country").all() %} <a href="{{ url('wine') }}?...
A Herrera's user avatar
  • 309
1 vote
1 answer
137 views

Ignore 'action' querystring parameter

Is there a way to ignore part of a querystring if it contains the parameter "action"? We have a 3rd party site which returns to one of our sites and they append "&action=something&...
Jaytrix's user avatar
  • 337
0 votes
0 answers
234 views

Search results not showing all entries

I have a search results page that doesn't show all matching results. The result entries that do show appear to older entries that have smaller ID numbers, although I'm not sure if that has anything to ...
user3092's user avatar
  • 117
1 vote
1 answer
93 views

Search form - Passing only field params that are not empty or selected

Is it possible to have a search form pass (into the search query) the field params of only fields that have been populated/selected? For example, if the following form is submitted, both q and color ...
user3092's user avatar
  • 117
1 vote
1 answer
1k views

Easily update the query string with a link

I'm working on a site with some filters that result in a page with a URL similar to this: domain.com/led-products?series=67&efficacy=1000to5000&lumens=over150 That results page contains ...
A Herrera's user avatar
  • 309
1 vote
1 answer
302 views

Campaign UTM Tracking through to form

My client has asked that I track and send campaign information through a contact form. So basically a user might come to the site on this type of URL: domain.com/?utm_source=Facebook&utm_medium=...
Malcolm Maclean's user avatar
1 vote
1 answer
31 views

List products related to currently active category (url)

My URL: http://localhost/product-family/compressors How can I list the related products? I don't understand how to get access to the compressors (a category entry of the product-family category type)...
nitech's user avatar
  • 679
0 votes
1 answer
96 views

Using action as a key in a query string

I've been tasked with recreating an API within our Craft 2.X installation. For whatever reason, the API specifies the resource it is requesting with the query string parameter action. For example, ...
Erik G's user avatar
  • 103
2 votes
1 answer
476 views

How to create an advanced route with query strings?

I have a main structure as my navigation. Within this structure I have multiple image galleries. I want to make the image gallery's urls dynamic. If I define a gallery within the structure entry: ...
outline4's user avatar
  • 595
0 votes
1 answer
387 views

Template query: Advanced section query to get unique items from custom entry type field

I'm trying to build a filter for a blog section in Craft 3. I'm fairly new to Craft and my client now wants a dropdown filter where they can filter out authors. Thus, I want to write a query that ...
Kristoffer Zaar's user avatar
2 votes
1 answer
190 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 ...
Andrew's user avatar
  • 748
5 votes
1 answer
1k views

Filtering multiple categories with URL queries

I am trying to filter using categories. I have to filters type and size, in the url. /products.html?size=medium,large&type=polo-shirt,jeans In my template, I am doing the following {% set sizes ...
Hassan Mahmood's user avatar
1 vote
0 answers
163 views

Filters using multiple query strings with pagination and Craft Commerce

I want to build the ability for the user to be able to filter by certain categories when browsing an existing category. As well as this I would like the user to be able to control the ordering of ...
Terry Upton's user avatar
  • 1,894
1 vote
2 answers
1k views

Filtering search with checkboxes multiple param querystring

I have a series of checkbox like so: <fieldset data-role="controlgroup"> {% for option in craft.fields.getFieldByHandle('area').getFieldType.options %} <input type=...
Terry Upton's user avatar
  • 1,894
1 vote
1 answer
225 views

Append a string to the end of all rich text links

I'm trying to append a string to the end of all rich text links. Is there an already existing plugin for this?
Morgan's user avatar
  • 45
2 votes
2 answers
335 views

getQuery() returns only one value

I have a URL passing values from form checkboxes to a template. All the checkboxes are grouped with the same name= attribute. When multiple checkboxes are selected, the query string looks something ...
Philip Jones's user avatar
0 votes
1 answer
1k views

Is it possible to search in Craft Commerce by product type?

I am building an API that takes all products from the Craft Commerce Commerce_ProductModel. In this I am using the Element API plugin to build it out. I am running on Craft 2 latest version. I have ...
M dunbavan's user avatar
0 votes
1 answer
139 views

Craft request returns null in test, but works locally

I have a search that is working locally, but not when I push it to my test environment. I imported the database from my local environment into test, so the data should exist. The URL for each is: ...
Molly Harper's user avatar
2 votes
1 answer
4k views

Set cookie and redirect back to referral URL

I'm setting up a site for a brewery that requires age verification. When a user visits the site, I check for the presence of a cookie (I'm using nystudio107's cookie plugin) and if it hasn't been set,...
artmem's user avatar
  • 1,022
1 vote
1 answer
43 views

Entries by non-contiguous postDate years

I'm trying to display and paginate entries by years, that aren't necessarily contiguous. {% set limitPerPage = 6 %} {% set eagerFields = [ 'title', 'press_release_name', '...
plankguy's user avatar
1 vote
0 answers
110 views

Query over multiple split years

I have a list of year from a form field, not in consecutive order. (ES: 2008, 2010, 2012) I have built an url in this way: q=&year[]=2008&year[]=2010 to get all the records of years 2008 and ...
user5439's user avatar
2 votes
2 answers
364 views

How to set multiple 'active' classes from query string

I'm outputting all tags that are in use and then allowing the user to click these build up a query string to filter and display the results. It's all working fine. Except, I'm having difficulty ...
Matt Ellis's user avatar
11 votes
1 answer
7k views

Advanced query/filter based on date and values

I have a channel of events with a field ‘eventDate’ for the date/time of the event. Within that there are ‘types’ of events ‘eventType’. What would be the most efficient way of outputting the NEXT (...
Christopher Healey's user avatar
2 votes
2 answers
7k views

Get query string param that has no value

Is it possible to determine whether or not a query string has a param with no value. For example http://www.test.com?myparam Technically that's a valid url but the craft.request object doesn't ...
Derrick Grigg's user avatar
2 votes
1 answer
318 views

Find Entries with Multiple Matches in a Single Field

I have entries in a channel called "shorts". Each of those entries has a field called "size" that can be a value of small, medium or large. I have created a form where I want users to be able to ...
triplethreat23's user avatar
2 votes
1 answer
114 views

404 when clicking on the Disqus embed urls

I've just noticed on a site that the Disqus comment embed is suggesting other articles but they're adding a token to the end of the URL, for example: http://australia.thegospelcoalition.org/article/...
Steven Grant's user avatar
  • 1,855