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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | country_code_get_country_node.patch | 1.3 KB | catch |
Comments
Comment #1
nedjoComment #2
catchHere'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.
Comment #3
nedjoI'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.
Comment #4
catchMarking to active (needs more info) since the patch itself is committed.