Hi,
I am trying to make sense of the “search:” parameter mentioned here :
https://docs.expressionengine.com/latest/channels/entries.html#searchfield_name
As shown on the two screenshots, I retrieve from the (url) query parameter the admin username.
I then try to filter the channel using the custom field and the custom field value.
{exp:channel:entries channel='Administrator' search:admin_user_name="{admin_user_name}” limit=”1”}
For some reasons, the same entry field values are always returned although the query parameter value changes.
Could you let me know if the only solution is to purchase the Low Search addon ?
Thanks.
K.
@5BYFIVE Creative : Thanks.
1) I confirm that {admin_username} outputs correctly, depending on the third segment of the url, i.e :
{preload_replace:admin_username="{segment_3}”} {layout='layouts2/_html_wrapper'} {if segment_4 } {redirect='404'} {/if} {admin_username} {!– the variable admin_username gives me the correct admin username depending on the url query parameter –}
2) I read EE6 documentation about embed and looked at all the examples I could find online. For the sake of it, I just tried :
{embed='admin/details' admin_user_name='{segment_3}’} {layout='layouts2/_html_wrapper'} {if segment_4 } {redirect='404'} {/if} {admin_username}
but as expected, this led to :
Error
You have caused a template loop due to improperly nested sub-templates (‘admin/details’ recursively called)
Template load order:
admin/details
admin/details
admin/details
@jelle
I tried :
{layout='layouts2/_html_wrapper'} {if segment_4 } {redirect='404'} {/if} {exp:channel:entries channel='Administrator' search:admin_user_name="{segment_3}” limit=”1” dynamic=”no”} {admin_email_address} {!– the field admin_email_address always gives me the value adonovan@gmail.com no matter what {segment_3} is –} {/exp:channel:entries}
The same email address is outputted no matter what.
Do you have any other suggestions I could try ?
Thanks a lot.
K.
What appears in the screenshot of this response was created using your identical code. happy wheels unblocked
The custom field value can be easily stored mini crossword in a layout variable before the channel entries call with search term is constructed.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.