ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

{ip_address} variable inaccessible

October 01, 2010 10:42am

Subscribe [2]
  • #1 / Oct 01, 2010 10:42am

    Adam Khan

    319 posts

    I’m trying to use the ip_to_nation module (EE v1.6.9 build 20100805) as specified in the docs:

    {exp:ip_to_nation:world_flags type="text"}{ip_address}{/exp:ip_to_nation:world_flags}

    But instead of getting the value of the IP address, the module picks up the variable name “{ip_address}” instead. Outside of the module the variable does work, and if I put the actual IP address within the module’s tags that also works.

    Seems like a parsing order problem, but I’ve not seen anyone mention it elsewhere on the forums.

  • #2 / Oct 01, 2010 11:31am

    Ingmar

    29245 posts

    Are you using that inside a exp:channel tag, nested as it were? If so, does it work if you don’t nest it?

  • #3 / Oct 01, 2010 11:33am

    Adam Khan

    319 posts

    Hi Ingmar, thanks for the speedy response. No, it’s not within any other tag nor conditional.

    I’ve gotten it working using the following (template’s PHP is turned on and set at Input):

    {exp:ip_to_nation:world_flags type="text"}<?php global $SESS; echo $SESS->userdata['ip_address']; ?>{/exp:ip_to_nation:world_flags}

    So it does seem a parsing order issue.

  • #4 / Oct 01, 2010 11:41am

    Ingmar

    29245 posts

    Yes, some quick testing confirmed this. Glad to see you found a solution. Post again as needed, please.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases