Questions tagged [relations]

Questions around Craft's relational field types.

Filter by
Sorted by
Tagged with
0
votes
1answer
471 views

How can I get the parent category group via the category to create multiple relation criteria?

I have two category groups: Cars and Colors My Cars category looks like this: Cars Sports Cars Corvette Lamborghini Porche My Colors category looks like this: Colors ...
1
vote
0answers
328 views

Relating to multiple categories?

Bit of an odd one here I can't quite work out. It's late and my brain is melting. I am creating an Artist listing page. It is a Single where the client can pick which category of Artist they want to ...
4
votes
1answer
507 views

Reverse Related entries with Matrix Field

I have a site with channels ‘articles’ and ‘tutorials.’ An article entry has a matrix field which contains an entry field to link to a tutorial. Every tutorial is linked from within at least one ...
1
vote
0answers
78 views

Entries relation

I have two entries, let's say A and B. In the B entry I can select multiple A entries in a entries field. I want to get B entries that have specific A entries selected. So i have the code: {% set ...
1
vote
0answers
130 views

How to pull out entries related to multiple nested categories?

I have a category set up with nested categories so: Level1 -level2 -level3 In my entries channel each entry can have multiple nested categories so we may have an entry with: cat1 -...
2
votes
1answer
323 views

Output Matrix in relation to category

I'm setting up an FAQ page using a matrix. Each Matrix block contains a question and an answer field. Each Q+A needs to be outputted within a section on the same page such as General, Payments... I'...
3
votes
0answers
268 views

Getting related entries along with entry using the Element API plugin

I want to list all the related entries to the entry I am displaying using the Element API plugin. I have a channel called series and another called episodes, the episodes have a relationship with 1 ...
2
votes
1answer
257 views

How to handle Belongs To User relationship

In a custom plugin is it possible to have a element type with a belongs to relationship to a user, as you can only define half of the relationship (without somehow modifying the userRecord). What ...
1
vote
0answers
247 views

Get entries where relation matches or is empty

I have a channel section (tickets) where each entry has a members field. The members field can either be empty (making the entry 'public') or specific members can be added (making it 'private', to ...
1
vote
1answer
155 views

Nearest entry using related entry Smart Map field

I’m trying to build a query to get the geographically closest entries, based on an Smart Map field value within a related entry. The following template tags were my first guess, but returned an empty ...
1
vote
3answers
314 views

Perform inclusive relatedTo query with multiple categories in Craft 2.5+ [closed]

I'm trying to to display entries related to "all" the given categories instead of "any" using the updated relatedTo method provided in Craft 2.5. In a related question, @BrandonKelly explains how to ...
3
votes
0answers
463 views

How can I use the ElementAPI to get related entries based on two parameters?

I can successfully get entries related the "normal" way, but my list of possible results are getting quite large. Currently I am returning html mixed in with the data. It's obvious I need to get just ...
2
votes
1answer
794 views

How can I get an entry based on category and slug (via url segments)?

I am using (and have used) this S.O post to create a product filter/search using multiple categories. Everything is working perfectly. I am attempting to use the same type of logic to grab ultimately ...
4
votes
1answer
199 views

Filter entries on a page based on related entry

This is blowing my mind! I have a Section with handle practiceAreas. I have a Section with handle barristers with approximately 100 entries. barristers has an Entries fieldType called specialisms ...
2
votes
1answer
839 views

SuperTable and related entries

I'm trying to pull through content based on items within a SuperTable entries field. After searching around I currently have this: {% set individuals = craft.entries({section: 'barristers', ...
2
votes
1answer
82 views

Is it possible to limit the level at which entries can be selected from within an entries field?

I have an entires field which is using a structure as a source. The structure has 3 levels and I would like to be able to limit it so the user can only select entries at the second level. I've had a ...
0
votes
1answer
44 views

Omitting current entry from list of entries generated from a relationship

On my template I am showing detail of an entry. Beneath this I am showing a list of other entries that share the same kind of category relationship as the entry being viewed. This list currently ...
2
votes
1answer
132 views

How do I display entries, grouped by distinct categories where the entries share a relationship to both the category and an entry in another channel

I have 2 channels:survivors, survivorContent and a Category:themes. Relationships are as follows: survivorContent has -> related themes (max 3) AND survivorContent has -> related survivors (max 1) ...
3
votes
1answer
1k views

Checking if current entry exists in an entry custom field in a different entry

I thought this would be simple but I am having no luck with it. I have a channel called "Posts" and for each Post there an "entry" custom field which lists all "Projects" (a structure). The user can ...
2
votes
1answer
666 views

Searching for entries across multiple fields including a relationship

I'm trying to fetch a set of entries based on search parameters. The search is an "and" search, meaning that if criteria exist then they should all match for there to be a result returned. I have ...
1
vote
1answer
150 views

Problem getting relationship between entries to work

I'm having trouble getting what should be a simple relationship between 2 channels to work as expected. This is how things are set up. Channel: Apprenticeships - essentially categories, types of ...
4
votes
1answer
235 views

Limit search results for users by tag (and limit to 5 tags)

I've read as many forum posts and documentation but am a little stumped over a specific use-case. Currently the search page grabs the url segment, loops through a verified user group, and uses the ....
1
vote
2answers
708 views

using craft.request.getParam to filter by relations

I'm requesting entries through a search field like so: {% set params = { section: 'tours', startloc: craft.request.getParam('zoekplaats') } %} {% for entry in craft.entries(params) %} .....
3
votes
1answer
720 views

Search for related entries via AJAX given multiple parameters

I am attempting to create a relationship between products. I have a section named "product" which is a Structure. Each "product" entry has a category field called "species" and a category field called ...
2
votes
1answer
480 views

Using relatedTo, and/or and :empty/:notempty in queries

I got users that has 3 Entries fields in their profile: breadForMonday, breadForWednesday and breadForFriday. I want to differentiate between users with 1, 2 or 3 selected entries. How would I use ...
2
votes
1answer
152 views

List related siblings

I've been reading a lot of documentation (getSiblings, getDescendants etc) but can't get this to work: I have a structure, named 'areas'. When showing an entry that is a child of an area in 'areas', ...
3
votes
1answer
142 views

Showing entries within a category

I have a list of people with skills defined by a category group. I have a category field within the 'people' Section so when a new person (entry) is created, the category field allows the admin to ...
2
votes
1answer
302 views

Category filter returning all entries

I've been trying to build a category filter. I managed to make my buttons respond with categories but the returned entries on the page stay the same. So when I click one of the links "/?category=koop" ...
3
votes
1answer
472 views

Get all entries attributed with category

Maybe I'm going mad here, but I can't figure out how to get all entries which are in a certain category. Following the syntax laid out here: http://buildwithcraft.com/help/entries-related-to-category ...
4
votes
2answers
293 views

Is it possible to order related entries by relevance of tags?

I have a set of entries which each have 0 or more tags (no limit). For each entry, I am aiming to display 3 'related entries', related by the tags field. e.g. If entry 1 is tagged with 'apples', '...
2
votes
2answers
121 views

Only fetch categories that are related to a minimum of entries

Is there a way to only fetch categories that have been assigned to a minimum of entries, i.e. 4? Currently I fetch categories like this: {% set productIds = craft.entries.section('products').ids() %}...
2
votes
2answers
61 views

Associating related entries to a new entry when using the API

This may just be a 5PM Friday issue, but I'm scratching my head over here. I'm trying to associate a string of related entry id's represented by a variable with a new entry via the API. When I pass ...
7
votes
1answer
828 views

How to get entries related to current category only (not children)

I need to get entries which are only in current category, not child categories. So if I have a category structured like this: Food ----Fruit -------Apples -------Bananas I've got a categories ...
3
votes
2answers
167 views

Help developing point system for sports league (w/o plugins)

I'm in the middle of a very long project developing a league site for the National Collegiate Wrestling Association in my spare time (once finished, could be a great showcase for Craft). Currently, I'...
2
votes
1answer
136 views

Get different kind of entries relatedTo one asset (many to one)?

I got an asset field called docs which is contained in 2 different entries. Those entries are in different sections and they contain the docs field directly or through a matrix field called ...
1
vote
1answer
1k views

How to integrate with Hubspot

For a big client we are required to set up their blog on their Hubspot account. However we are developing everything else in Craft. What is the easiest way to make the connection so the client can ...
2
votes
2answers
1k views

Get current entry category

I haven't used categories before so maybe I'm looking at this the wrong way. I currently have a category group named products with the following structure: Featured Fruit ----Apple ----Banana Veg ---...
2
votes
1answer
724 views

Find entries related to user and display field name

If I’m finding all the entries that are related to a user, how could I get the field handle that the found user is referenced from? {% set events = craft.entries.section('events').relatedTo(user) %} {...
4
votes
2answers
577 views

Filter locations by country in Smart Map

I'm using Smart Map to find locations ordered by distance. But I can only set 3 parameters: target, range and units. However, when my range goes beyond the country borders I obviously get results in ...
2
votes
1answer
100 views

Mysql error when defining related tables

I'm trying to create some relational tables from 2 records but I keep getting the mysql error: CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1005 Can't create table ...
1
vote
1answer
478 views

Relationship through Matrix field

I'm having a little trouble wrapping my head around Relations through a Matrix field. I have a Structure called exhibitors. I have a Matrix field on a Page called rooms, This has one block type room ...
1
vote
0answers
266 views

Is there any way to create reciprocal related entries?

I'm working on a sign language dictionary project. Each individual sign (or word) is an entry. I want to be able to have an area that shows words that are similar to the word that is being currently ...
2
votes
4answers
2k views

Get entries NOT related to categories

is it possible to grab all the entries in a section that arent related to a category? So something like craft.entries.section('news').relatedTo('not',category) Doesnt seem to work but is there some ...
0
votes
1answer
658 views

Reverse Relationships

Doing my first Craft job and stuck with a reverse related entries thing. I’ve got a channel of “Sectors” and a channel of “News”. The entries in news have a relationship field back to the “Sectors”. ...
1
vote
1answer
122 views

Display all related entries in a table

I'm building a site that contains a listing of products and distributors. I have a channel for each, and each entry in the distributors channel contains a relationship field to tie it to any number of ...
2
votes
2answers
974 views

How can I use tag slugs in URLs?

This question is a summary of my working with tags yesterday, I'm posting my findings to SE so other people can benefit. For the purposes of this question, I'm going to be using a tag with the title '...
1
vote
2answers
177 views

Organizing repeating content on a single page

I have a page with a slider on it, which includes three rotating slides. In Craft, I am currently setting up each slide as an entry under a "Home Page Content" channel, and then creating an entry ...
1
vote
1answer
189 views

How to link to prev/next entry depending on related data?

I am quite new to Craft and I am not sure how to get a prev/next link only for entries with related data in a specific field. My situation: I have a Structure (let's call it sourceEntry) with an ...
1
vote
1answer
126 views

Get Entrys relationships regardless of context

This might be a little complex, but here it goes: Goal: For any given entry, determine where it's located. (Ex. Entry XYZ exists in a news entry, global field, single (page), etc...) Context: So far ...
3
votes
1answer
538 views

Filtering Matrix through field value and multiple relations

I've the following situation: Accommodations (entry) title description (textfield) ... linkedTo (matrix block) Sport (category) targetGroup (category) minimumAge (number) maximumAge (number) What ...