Hi all…
I’m trying to use a custom field from a single entry as a search parameter in a separate channel entries tag. Is this possible? I’m currently using MX_Jumper plugin to store the custom field as a reusable variable. It works when echoed out elsewhere in the template but I can’t reference this variable from within the channel entries tag definition. Here’s some code…
The following chunk of code saves the data from a custom field called ‘media_type’ to an mx_jumper variable called ‘current_type’
{exp:channel:entries channel="media_review" limit="1" dynamic="yes"}
{exp:mx_jumper:put name=“current_type”}{media_type}{/exp:mx_jumper:put}
{/exp:channel:entries}
MX Jumper variable = {exp:mx_jumper:out name=“current_type”}Notice I can now echo out the mx_jumper variable outside of the channel entries tag… I want to reference this variable as a search parameter in another channel entries tag later on the page. Think of it as showing related articles. I’ve tried accessing this variable using the code below, but it doesn’t work:
{exp:channel:entries channel="media_review" dynamic="no" search:media_type="{exp:mx_jumper:out name='current_type'}"}
// output data here…
{/exp:channel:entries}I’m assuming the above doesn’t work because I can’t call a plugin tag from within a channel entries tag?
I know I could probably use categories to solve this but in this instance i want to use a drop down menu, as I can make it a required field, and restrict the admin to only selecting one option. Anyone know a solution to this? Will I just have to use PHP variables? If so how do I go about doing this?