Commonly modules will need the country-appropriate version of nodes.

Proposed method:

country_code_get_country_node()

Passed in a nid, it will load the country-specific version for the current language, if present, or the current langauge, if present, or else just the nid that was passed in.

Logic will be similar to the existing views filter for current country content.

CommentFileSizeAuthor
#2 country_code_get_country_node.patch1.3 KBcatch

Comments

nedjo’s picture

Priority: Normal » Critical
catch’s picture

Status: Active » Needs review
StatusFileSize
new1.3 KB

Here's an initial patch for testing - it copies the views query + adds a check for tnid. Seems to be working but I've only done minimal testing.

nedjo’s picture

I've applied a modified version. Still needs testing.

Two methods:

country_code_get_country_node() accepts a node object, returns a node object.

country_code_get_country_node_id() accepts a nid and optional tnid, returns a nid.

catch’s picture

Status: Needs review » Postponed (maintainer needs more info)

Marking to active (needs more info) since the patch itself is committed.