I'm just learning EE and I have the following example url, http://mydomain.com/work/preview/clientname

where I want clientname to match a channel field I have setup ("client_name") and to pull in channel content only if it matches that channel field.

For example, http://mydomain.com/work/preview/google, would display channel content if the specified channel field "client_name" for a particular entry is "google".

I know how to use the following to pull in content from the channel "videos":

{exp:channel:entries channel="videos"}

...but how do I accomplish this for different url segments?

1 Answer 1


This code will do the trick:

{exp:channel:entries channel="videos" search:client_name="{segment_3}" limit="1" require_entry="yes"}
    {if no_results} {redirect="404"} {/if}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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