1

I am fairly new to Craft and I am hoping someone can help point me in the right direction so I am not having to do double the work or have to learn the hard way that there is an easier way.

I am trying to get my head around how I can tie pages together. I am creating a page for videos from speakers but I want the speakers names to be linked back to their staff page.

How do I create an entry that will allow users to select a staff member?

I have already created a staff entry page, that allows all the information to be populated for the staff member. Should that be a categories page instead to allow me to have a the user select the staff member (category) that did the talk for the video? Or is there another way to allow the user to select a field of staff members?

Thanks for the help!

1

You could have two sections:

Staff
Videos

In the videos channel, create a Staff entries field type, select the Staff channel in that field's options.

When you create a new video, you can relate that video to a staff entry.

When displaying a video entry, you could reference that staff that is tied to that video entry like so:

{{ entry.staff }}

If you wanted to be more specific, you would do something like:

{{ entry.staff.title }}

and to get a link to the staff entry that is related to the video entry:

{{ entry.staff.url }}

Here is an article explaining relationships further: https://straightupcraft.com/articles/introduction-to-relations-and-reverse-relations-in-craft-cms-with-examples and documentation on the Entries field type: https://craftcms.com/docs/entries-fields

  • Thanks @Brad, as I had then entry for staff named "speaker" this was my end solution that got me to where I wanted to be: {% for staff in entry.speaker %} <li><a href="{{ staff.url }}" class="note"><span class="icon down-2 left-2" data-icon="t"></span>{{ staff.title }}</a></li>{% endfor %}</code> – Garrett Apr 27 '17 at 20:10
0
{% for staff in entry.speaker %}
                    <li><a href="{{ staff.url }}" class="note"><span class="icon down-2 left-2" data-icon="t"></span>{{ staff.title }}</a></li>{% endfor %}

Tanks for the help and resources!

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.