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

"Michael Cortez" <[email protected]> Sat, 23 Oct 2004 09:35:20 -0700
Newsgroups gmane.comp.cms.xaraya.knowledge-base
Message-ID <[email protected]>
>> Can you post an example about howto use xarModURL() to build 
>> links on 
>> this items please?
>> 

I usually use something like this:

=============================
<xar:set
name="link">xarModURL('articles','user','display',array('aid'=>$article['aid
'])</xar:set>

<a href="#$link#">#$article['title']#</a>
=============================

By using dropdownlist() or getall() or a similar function to get an array of
articles, I use the above code in a for loop like this:

=============================
<xar:foreach in="$articlesArray" value="$article">
  <xar:set
name="link">xarModURL('articles','user','display',array('aid'=>$article['aid
'])</xar:set>

  <a href="#$link#">#$article['title']#</a>
</xar:foreach>
=============================

May require some minor adjustments depending on which function you use to
retrieve the articles, as the array of arrays returned may differ slightly.

I often use the following to see what I get back:

=============================
<xar:set
name="$myArray">xarModAPIFunc(..."getall/dropdownlist"...)</xar:set>

<pre>
<xar:set name="foo">1;
print_r($myArray);
</pre>
=============================

Have fun!
--
Mike C.