0

I'm working on an ExpressionEngine website that someone else built and trying to figure out how to make some edits.

When editing an entry, there are lists of Related Elements and Hubspot Call to Action items which I can add or remove from the page by clicking the left/right arrows.

In the template for the same entry, I see this: {display_related_elements}

However, when I go to the list of functions, I don't see anything called display_related_elements. So perhaps the template is trying to call a function that doesn't exist. In any event, the Related Elements do not display.

All I want to do is display Related Elements and Hubspot Call to Action items on my page. Is there a built-in function for this in ExpressionEngine or do I need to write my own database query?

Thank you!

1

From your description it looks like you are working with what is called a Relationship field.

Check the documentation, but I suspect what is going on is that the template designer called the relationship field display_related_elements which you would access within a template using the tag {display_related_elements} - this would explain why you cannot find this tag in documentation for EE.

Relationship fields are pretty straight forward to work with but if you have any problems post back here, I'm sure you'd get good answers to any specific questions.

PS - it is always helpful to include info in questions here about what version of EE you are working with.

3
  • I found another query which sort of does what I want, that I can use to get the related elements. It has this: exp_playa_relationships.parent_field_id=52 and exp_playa_relationships.parent_entry_id=3089 but I'm not sure where those IDs are coming from. Can I somehow modify those IDs with a variable that will point to the current page?
    – BB Design
    Jul 8 '19 at 17:29
  • 1
    OK. Playa is / was an addon for EE2 that provided effectively the same function as the relationship field before the relationship field was a thing. I'm not sure if the Playa field is still a thing or not - the field was sold by its authors to an addon aggregator some years ago, who maintain compatability for the field with modern EE versions, but do not appear to develop it beyond that. If you plan to continue with EE it would be sensible to migrate the playa fields to relationship fields - there is a migration tool for doing this. Jul 8 '19 at 18:26
  • 1
    So the ID numbers you refer to probably link to rows in the Playa tables within the EE database, but may also relate to channel entry IDs - check the docs I guess (eeharbor.com/playa/documentation). Jul 8 '19 at 18:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.