Re: HOWTO: Handle 1:n relationshiopsbetween Article pubtypes in 0.9.10

mikespub <[email protected]> Thu, 06 Jan 2005 12:13:36 +0100
Newsgroups gmane.comp.cms.xaraya.knowledge-base
Organization Xaraya
Message-ID <[email protected]>
Manosucias wrote:
> Hi all.
> 
> Now I'm able to display parent links in child templates, but how can I put
> child links in parent articles?
> 
> I tryed to get child article's ID's with
> 
> <xar:set name="where">'ficha eq '.$aid</xar:set>
>    <xar:data-view module="dynamicdata" itemtype="126" where="$where" />
> 
> "126" is my dd itemtype and "ficha" the field name wich contains parent
> ID's.
> 
> Any clues?
> Thanks a lot

If your children are articles, there are two mistakes here :

1. xar:data-view only works with "complete" objects (with a primary key
etc.), not extensions of some articles pubtype.

For articles, you need to :
a. call DD getitems() to retrieve the itemids
b. call articles getitemlinks() to retrieve the article titles and links
[or call articles getall() if you want more]

2. (module + itemtype) determines which DD object we're talking about,
so typically for articles extensions you would have something like

module="articles" itemtype="$ptid"

In your example, the child object belongs to the dynamicdata module,
itemtype 126, not to articles pubtype 2 (or whatever).

Of course, if your children are not articles but a separate dynamic
object, then you might use that approach :-)

HTH,

Mike.