Re: Re: Display a Category as the Content on the Home Page

Ryan Walker <[email protected]>
Newsgroups gmane.comp.cms.xaraya.user
Message-ID <[email protected]>
Wayne,
I'm not sure what you mean by category items... do you mean articles of 
a particular category?  Maybe something like...

<xar:module main="false" module="articles" type="user" func="view" catid="15" numitems="10" />

Pretty sure the 'catid' part is right... but sometimes I forget whether to use catid, cid, or cids.

I'm also a fan of the articles getall function... here's an example... 
your fields and cids will vary:

<xar:set 
name="getall">xarmodapifunc('articles','user','getall',array('fields' => 
array('aid','pubtypeid','title','summary','notes','body','pubdate','dynamicdata'), 
'sort' => 'summary ASC', 'cids' => array('48','49','50','55')))</xar:set> 
<xar:foreach in="$getall" key="$key" value="$val">
<xar:set name="datetime">date('l, F j, g:i a',$val['summary'])</xar:set>
<p>
<span class="eventtime">#$datetime#</span><br />
<span class="eventtitle"><a 
href="#xarmodurl('articles','user','display',array('aid' => $val['aid'], 
'ptid' => $val['pubtypeid']))#">#$val['title']#</a></span><br />
@ <span class="eventlocale">#$val['body']#</span>
</p>
</xar:foreach>

So basically, the getall function gets your articles data in an array, 
and then you loop through the array with xar:foreach to present the 
data.  The 'cids' argument gets articles of particular categories.  To 
get articles of just one category, you would just have one category in 
that cids array. Maybe that will work for you?  I've never used category 
images but no doubt there's some way to get those by getting the 
category ID of each article in the foreach loop... not sure what would 
be the most convenient way.

-Ryan


wwalkerbout wrote:
> Hi,
>
> This is a follow-up on my message from two days ago, as I am still stumped 
> on this issue. Does anyone have any suggestions on how to handle this 
> situation?  My understanding of the Xaraya Blocklayout or API calls is a 
> matter of confusion, to say the least, so I am going around in circles here. 
> This is the last thing I need to get working before I can show my friend 
> their "draft" site.
>
> In clarification, I have formated a page that displays all of the items in a 
> Category with associated thumbnal images. If I select that category, 
> everything displays just fine. The work in pulling together my page of 
> Category items and images (which I added in the Category Tree),  and in 
> formating them, I did through my 
> /themes/devtest/\modules/categories/user-navigation-trails.xt template file.
>
> The URL in my dev environment is:
>
> http://local.devtest/index.php/products/c46/
>
> Now, what I need to do is to display that exact list of categori items and 
> images in my Frontpage Article pubtype, with other content above and below. 
> I have been working on that in my Frontpage Articles template and the 
> remainder of the Frontpage is displaying fine. It is the category item list 
> and images that I can't get to display.
>
> In my ignorance, I have been playing with the following, but without 
> success:
>
> 1.    Using the Window Module to hold the content (seemed to need a link to 
> activate).
> 2.    <xar:module... call. I know how to use that to call an Article, but I 
> gather I should be calling a Category here.
> 3.    xarModAPIFunc(... call. Totally out of my league here. I didn't know 
> what I was doing.
> 4.    <xar:module id=... call. Just clutching at straws here.
>
> So I am probably trying all the wrong things here.
>
> Therefore, I would truely appreciate any feedback on how I might get this 
> Category list to display where I need it, on my Home Page.
>
> Cheers,
>
>
> Wayne
>
> "wwalkerbout" <[email protected]> wrote in message 
> news:[email protected]...
>   
>> Hi,
>>
>> I have a category displaying a set of Category Images (2 rows of 4 
>> images), which i would like to be the main content on the Home Page (with 
>> additional content above and below it).
>>
>> Does anyone know the best way to have a Category displayed as content on 
>> the Home Page?
>>
>> Cheers,
>>
>>
>> Wayne
>>
>>     
>
>
> _______________________________________________
> Xaraya_user mailing list
> [email protected]
> http://xaraya.com/mailman/listinfo/xaraya_user
>
>   


-- 
Ryan Walker
www.WebCommunicate.net:
Insights and resources for effective websites.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.