Below is a stripped down version of opening channel entries tag pair I have on a business section of my site:

{exp:channel:entries channel="business" limit="1" dynamic="no" search:business_country_code="**COUNTRY CODE**"}

On arrival of the site I am using IP2Nation to grab the users location. I want this to be added into where COUNTRY CODE is above.

I initially thought I could use a basic plugin to output this using something like :

{exp:channel:entries channel="business" limit="1" dynamic="no" search:business_country_code="{exp:country_code:output}"}

But it appears that the EE parse order prevents this.

I have currently resorted to using a URL segment, but I would much prefer to use another way around this, as I would like to have this work on several pages, and don't want to add country codes segments to every URL.

Does anyone have any ideas how I can achieve this?

I did find this channel_entries_query_result but don't really understand what it does. I wondered if its possible to modify the channel entries tag to something like:

{exp:myplugin:entries channel="business" limit="1" dynamic="no"}

and have the search completed in the module/plugin/extension.


  • Going to mark this as a duplicate, as the core functionality you desire is already covered in the older question. – Derek Hogue Aug 13 '14 at 15:17
  • Specifically look at using your plugin as a tag pair, along with inward parsing. – Derek Jones Aug 13 '14 at 15:22