1
tzvook
Divide category's articles (Phppp's Article) into 3 colums
  • 2006/5/23 6:21

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Just a small smarty addition for those who need to divide the articels list @ the category template in the articles module, here's a very simple way of doing that:

open your category template ( /templates/art_category.html ... or any custom template you made ) and look for the "article loop" ... around line 67 ....

before:

<{if count($articles)>0}>
<
div id="article">
<
div class="title">
<{
php}>echo art_constant("MD_ARTICLES");<{/php}>
<{if 
$featured}>
 (<{
php}>echo art_constant("MD_FEATURED");<{/php}>)
<{/if}>
div>
<{foreach 
item=article from=$articles}>
<
div class="title-list">
    <
a href="<{$xoops_url}>/modules/<{$dirname}>/view.article.php<{$smarty.const.URL_DELIMITER}>c<{$category.id}>/<{$article.id}>"><{$article.title}>a>
div>
<
div class="item">
<
a href="<{$xoops_url}>/modules/<{$dirname}>/view.author.php<{$smarty.const.URL_DELIMITER}><{$article.author.uid}>"><{$article.author.name}>a>
<{if 
$article.author.author}>(<{$article.author.author}>)<{/if}> 
<{
$article.time}>
div>
<{if 
$article.summary}>
<
div class="item"><{$article.summary}>div>
<{/if}>
<
div class="clear">div>
<{/foreach}>
div>
<{/if}>



After:

<{if count($articles)>0}>
<
div id="article">
<
div class="title">
<{
php}>echo art_constant("MD_ARTICLES");<{/php}>
<{if 
$featured}>
 (<{
php}>echo art_constant("MD_FEATURED");<{/php}>)
<{/if}>
div>

<
table width="100%" cellpadding="0" cellspacing="0" ">
top">

<{foreach item=article from=
$articles}>
33%">title-list">
    <{$xoops_url}>/modules/<{$dirname}>/view.article.php<{$smarty.const.URL_DELIMITER}>c<{$category.id}>/<{$article.id}>"><{$article.title}>

item">
<{$xoops_url}>/modules/<{$dirname}>/view.author.php<{$smarty.const.URL_DELIMITER}><{$article.author.uid}>"><{$article.author.name}>
<{if 
$article.author.author}>(<{$article.author.author}>)<{/if}> 
<
{$article.time}>

<{if $article.summary}>
item"><{$article.summary}>

<{/if}>


    <{if $category.articles is div by 3}>
      
    <{/if}>
    
<{/foreach}>    



clear">

<{/if}>


Of course it can be divided to the number you need, so
<{if $category.articles is div by 3}>
has to be changed along with your table cell precentage...

I do hope Phppp will add a way to sort articles as he did with categories, this is one fine module !!!!!
After 2 weeks of work with it, I simply fell in love with it's abilities and it's simplicity ... especially for article editors (a lot can be done via the end user interface to those who has the right privilages).

There's should probably be some more vars in "category record" in order to control visibility a little more, and make the module a little bit more flexible...

2
davidl2
Re: Divide categorys articles (Phppps Article) into 3 colums
  • 2006/5/23 8:32

  • davidl2

  • XOOPS is my life!

  • Posts: 4843

  • Since: 2003/5/26


Some good tips indeed... thanks!

Login

Who's Online

423 user(s) are online (270 user(s) are browsing Support Forums)


Members: 0


Guests: 423


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits