Hi all,
I have a site that currently uses Playa (for the relationships/Related Entries. I’m looking at upgrading, and wanted to see how I would use the Relationship tag in EE for these relationships. I don’t know quite how I can manage that, though…
Example: A purple shimmer eyeshadow is part of a collection. So it would be related to the collection, and a sibling to all other items in that collection. So far, okay. But now I want to post links to other similar eyeshadows from other collections. They’re eyeshadows from other vendors that are similar to this one. They’re not from the same vendor, they’re not from the same collection. So…how would I display a link to these other “related entries” of my choosing?
I =do= want to: link to up to five other items that are simlar to this item: either its parent collection, OR its children (if it’s a collection or an item in a kit); and other highly similar items from other vendors.
I =don’t= want to: link to any or every other eyeshadow that is also purple and or shimmery.
Here’s an entry with links to related items, relationships created using Play and tags created using Solspace Tag module. Currently, I have to designate related entries for each individual entry - which lets me keep things very specific.
http://www.sparklecrackcentral.com/such/obsessive/addictions/fyrinnaes_biker_chic
How are you currently specifying the relationship with Playa? It sounds like these other entries are manually curated with a separate “related interest” field? If that’s the case, then the native relationships definitely have you covered and will be more performant than Playa.
Currently I’m not associating the entries in Playa at all, other than selecting individual entries to be related to other individual entries. (I know that I was using a small amount of Playa’s capabiilties, but…that’s what worked for me.) I wasn’t entirely sure that the native EE relationships tag would do what I wanted it to, but it appears that it will work. Thanks!
…now to figure out if/how I can replace the functionality of the Tag module - just so that I can use the basic EE functionality to its fullest…
Options for Tag depend on how you’re using it / what you need in terms of taxonomy. That said, Tag is compatible with ExpressionEngine 3 so there’s no need to move away from that solution if you don’t want to.
The channel entry that sets the relationship is the “parent”, and the “related interest” entries are the children, so you can just use the relationship field’s name as a pair like this.
Except all of these entries are in the same channel. (It has never made sense to me to break all of my content up into different channels, so…I don’t.) There are no parents, there are no children. All siblings…kind of.
I think I need to use a combination of the Multiple Entries that you just showed me, and…some siblings syntax?
I have my template working, I have entries related (by me manually choosing specific entries in the Related Entries field), I have the template displaying the images/links like I want…but I’m not seeing the entries I manually chose to be related. I’m seeing many more entries, and I’m not 100% sure how they’re being chosen.
Here’s the code I have in my template:
...lots of other template code, omitted for brevity...
{siblings field="related_entries" limit="15" orderby="random" status="open|Featured"}
<figure><a href="http://{url_title_path=" rel="noopener canonical" target="_top">http://images.sparklecrackcentral.com/clear.gif</a>
<figcaption><a href="http://{url_title_path=" rel="noopener canonical" target="_top">{siblings:title}</a></figcaption></figure>
{/siblings}
I read through the documentation, but I don’t understand how to limit the displayed siblings, to ONLY the entries that I manually selected as related, in the CP Entry form’s Related Entries field.
Please see my response and link above. You are not looking for siblings, you are looking for children, so you would just use the relationship field’s normal variable tag pair.
It looks like you say that I should use the relationship_field tag pair instead of the siblings tag pair. So I tried switching that in my template code: (and my template code is not rendering right in this field…)
<div id="related">{relationship_field field="related_entries" limit="15" orderby="random" status="open|Featured"}
<figure><a href="http://{url_title_path=%27obsessive/addictions%27}" rel="noopener canonical" target="_top">http://images.sparklecrackcentral.com/clear.gif</a>
<figcaption><a href="http://{url_title_path=%27obsessive/addictions%27}" rel="noopener canonical" target="_top">{relationship_field:title}</a></figcaption></figure>
{/relationship_field}</div>
But now the display of related entries is working…even less well than before. I’m not seeing any of the related entries that I chose.
http://www.sparklecrackcentral.com/such/obsessive/addictions/concrete_minerals_flame_collection_kit
Yes, the field name of my relationship field is
related_entries
When I used the above code in my template, but used the siblings tag pair (instead of the
relationships
tag pair), I saw images and titles and links to related entries. Except…it wasn’t ONLY the related entries that I’d manually chosen in the Related Entries field, but almost every other entry in that channel that started with the name “Concrete Minerals”. Which is not what I want.
Give this a shot. Notice that the tag pair uses the field name itself. Please refer to the link in the documentation above as well for prefixing the related entries’ variables within the field’s tag pair.
<div id="related">
{related_entries limit="15" orderby="random" status="open|Featured"}
<figure>
<a href="http://{related_entries:url_title_path=%27obsessive/addictions%27}" rel="noopener canonical" target="_top">http://images.sparklecrackcentral.com/clear.gif</a>
<figcaption>
<a href="http://{related_entries:url_title_path=%27obsessive/addictions%27}" rel="noopener canonical" target="_top">{related_entries:title}</a>
</figcaption>
</figure>
{/related_entries}
</div>
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.