1
bulinmartin
WFDownloads - category into the block

Hi,

I use the xoops 2.4.4 and WF-Downloads Meta Version: 3.2.002 module.

I would like to have the category of each download in the wfdownloads_block_new.html block.


Is it possible?


I tried <{$download.cat}> and <{$download.category}>, but it doesn't work.


Thanks for answers.

2
underdog
Re: WFDownloads - category into the block
  • 2010/10/31 20:19

  • underdog

  • Just popping in

  • Posts: 44

  • Since: 2007/6/21


If you want the fields
<{$download.cat}> and <{$download.category}>
available in your templates, you need to assign them to the template first.
You need to look in the PHP code where it has code like
$xoTpl->assign(
or something close like that. Then you assign the categories to the template and after the categories are assigned you can access them.
I hope some xoopsers can help you more with this adventure.

3
zyspec
Re: WFDownloads - category into the block
  • 2010/10/31 22:09

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


Yes, it's possible but it's more involved than it would appear since the name of the category is not saved with the entry - the category ID is. Here's the steps you'd need to complete:

* Inside ./blocks/wfdownloads_top.php you need to retrieve the 'titles' for each possible category (call it something like $category_title). The easiest way to do this is to retrieve the category titles using the category class for the allowed categories (you'll see this defined in the file as $allowed_cats).

* Once you have the names of the possible categories you'll need to assign the name of the category for the download entry that you're interested in to the block variables, inside the 'foreach' loop, something like:
$download['category'] = $category_title[$download['cid']];


* Finally you can use the smarty variable <{$download.category}> in the block template.

4
bulinmartin
Re: WFDownloads - category into the block

Thanks for answer, but I still have some problems with retrieving the titles. My PHP knowledge is really bad, I don't know what should I write in that line: $category_title = ????

if u know it and help, thanks :)

5
bulinmartin
Re: WFDownloads - category into the block

Yes, but i still can't manage to retrieve the cat names. Could you please write me that line...

$category_title = ???

I'm really bad at PHP, I see I have to start studying it.

Thanks for answer.

Login

Who's Online

264 user(s) are online (140 user(s) are browsing Support Forums)


Members: 0


Guests: 264


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