Most Popular

1500 questions
4
votes
1 answer

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.example.com/search/p2 effectively removing the search…
Kyle
  • 367
  • 1
  • 6
4
votes
1 answer

Set up Craft 3 when the craft folder is above public_html on shared hosting

I'm trying to setup Craft 3 on a shared host. It succeeds when I place all files in the public directory and then go to /web. But if I move the craft files to the folder /private_html/craft and the web files in /public_html it won't work (error…
noregt
  • 1,062
  • 9
  • 16
4
votes
2 answers

How can I get cookies that were set in javascript from a twig template?

The docs state that {{ craft.request.getCookie(name) }} will not work for cookies that were set in JavaScript, because all cookies in Craft go through some validation to ensure that they aren't tampered with. This is understandable, but is there…
Ben Croker
  • 7,341
  • 26
  • 55
4
votes
2 answers

What's the best way to make sure external URLs aren't interpreted as relative links?

I have a field where the client can enter a URL, and then that field's value is put into the 'href' of a link in the template. The client will sometimes prepend it with "http://", sometimes with "www.", and sometimes with nothing. Unless it's…
shanecavaliere
  • 509
  • 1
  • 6
  • 14
4
votes
1 answer

How to grab the full URL in a plugin?

When writing a plugin is there a Craft request to grab the entire url? I want to grab everything including http://domain.com/uri preferably without writing my own function. I see getUrl but craft()->request->url only returns 'uri' of…
Adam McCombs
  • 1,695
  • 12
  • 25
4
votes
1 answer

Display related entries across different entry types using tags in different tag groups?

I'm working on a site that has two different entry types (e.g., "blog" and "photos"), and each type has it's own tag group. When viewing a particular entry, I'd like to display related entries found in both entry types. So, for example, let's say…
Jason Morehead
  • 255
  • 1
  • 6
4
votes
1 answer

Live Preview has No Style

I am a complete novice. Live Preview does not seem to be accessing the stylesheets, which are called in my _skeleton.html. My template is sample.html. I am live, not in dev environment,in case that matters. And this is a single, not channel or…
4
votes
2 answers

How to query with relatedTo of a Relationship Field in a Matrix Field block

I have structures called Instrument and Person. On the person structure, I have a Matrix field called Roles. Roles has a block called Musician. And That block type has a Relationship Field called Instrument. This allows someone to be a musician and…
Bill Columbia
  • 896
  • 1
  • 8
  • 18
4
votes
2 answers

What would be the best way to track downloads by user?

Is anybody familiar with a plugin (similar to EE's Link Vault) that tracks all downloads, by user?
4
votes
1 answer

Easy way to copy sections to a new install

Is there an way way to copy sections I have in an existing site to a new website I am doing with a fresh install? E.g. To Copy the News Channel Section and all the field types Also copy the structure section and all it's entry types etc? I suppose I…
mmc501
  • 1,779
  • 13
  • 34
4
votes
1 answer

How would I pass and entry's field value to an include?

I have this: {% include "partials/includes/page-header" with { 'title' : '{{ entry.heading }}' } %} But it seems that nothing I do will actually pass {{ entry.heading }} as 'title' in the include.
Steve Adams
  • 1,671
  • 2
  • 15
  • 27
4
votes
1 answer

Postpone sending activation codes; Creating a user as "Inactive"

I'm finding the user activation process a bit confusing... I was trying to create a handful of users, but I didn't want to send out the activation emails yet. I incorrectly assumed if I unchecked "send activation email" when creating, it would…
Tim Kelty
  • 3,081
  • 1
  • 18
  • 29
4
votes
1 answer

Using search to display entries based on a value in a number field

I'm trying to return results based on a year stored in a custom field. For example, returning entries with a model year greater than 2006 and less than 2009. Is there a search syntax to support this? For example: for entry in…
Kyle
  • 367
  • 1
  • 6
4
votes
2 answers

Output structure in a

Given a structure that has, for example, three levels of content—how do I just iterate over it and create a nested
    reflecting the hierarchy and containing the title and slug (as a link) of each entry? The following just gives me a flat…
hamishtaplin
  • 776
  • 8
  • 16
4
votes
2 answers

Don't use localized slugs for templates

We are building a multilingual site. We have different domains and slugs for German and English pages/sections i.e. projects is called projekte... Right now the template used is called "projects.html" which we want to use for all languages, but…
nexflo
  • 539
  • 4
  • 13