Paul Gillingwater wrote:
> 
> I'm sure this is reinventing the wheel, but I couldn't find any prior art, so I'll 
>post this in case it helps other Midgarders.
> 
> I am not happy with the way that a page has to be linked to a topic solely by 
>hardcoding with the topic ID.
> 

In release version 1.4.1  (and in CVS much earlier than that) there is a
bunch of functions called mgd_get_xxx_by_name(int id, string name)
the ID is the id of the parent object, but since root level topics/pages
have parent set 0 we can start walking the topic tree upwards from there
to get the correct parent (or if we know a common parent somewhere
upwards of the tree we can use it's ID [better way is to use it's guid
and mgd_get_object_by_guid and then use $object->id)

This all naturally only works only if you're using a version that
supports these functions.

/Eero

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to