1
patagon
CBB blocks questions
  • 2006/4/29 4:34

  • patagon

  • Quite a regular

  • Posts: 235

  • Since: 2002/1/8 0


Hi,

I'm using the latest CBB and have two blocks on the home page, one with the latest topics and one with the 'hottest' topics. It works ok, but I want to display a title (saying 'latest topics' and 'hot topics') above the blocks.

My problem is that both blocks use the same template 'newbb_block_topic.html' so I can only place one title and it appears on both blocks...AFAIK there is no way of making these two blocks use a different template (as it was in original newbb, where there was one block template for each), but I may be overlooking something simple...if anyone can help with this it will be very appreciated.

Thanks

2
Will_H
Re: CBB blocks questions
  • 2006/4/29 12:52

  • Will_H

  • Friend of XOOPS

  • Posts: 1786

  • Since: 2004/10/10


wait, wouldn't it be easier to name the blocks through blocks admin? I'm not sure if am reading this correctly.

Yeah ok after re-reading it you would name the blocks by going to blocks clicking edit, and replacing "hot topics" and "rrt"

3
patagon
Re: CBB blocks questions
  • 2006/4/29 13:30

  • patagon

  • Quite a regular

  • Posts: 235

  • Since: 2002/1/8 0


Thanks Biteronboard,

by going to blocks admin I see that they already have different titles (hot topics and recent topics. the 'name' is always recent topics though). Now my question would be how to display on the template (newbb_block_topic.html, the same on both) the block title...that would work for me, but in my template I dont have an example to get that info...any ideas?

thanks

4
MadFish
Re: CBB blocks questions
  • 2006/4/29 14:09

  • MadFish

  • Friend of XOOPS

  • Posts: 1056

  • Since: 2003/9/27


I dont really get what you are trying to do here. Biteronboard is right - by going to admin/blocks/edit [the block you want to change] you can set the visible name of the block on the public side of your site to anything you want.

If you want to have a separate template for each block well I guess you could do that but not really any need. If you edit that template you will find it has some logic that lets it perform the different functions, you can edit the different bits independently no problem.

5
patagon
Re: CBB blocks questions
  • 2006/4/29 14:28

  • patagon

  • Quite a regular

  • Posts: 235

  • Since: 2002/1/8 0


Madfish, thanks and let me explain:

I set two blocks, that works perfect. I managed to change the names (doing what you said) but the problem is that the blocks only show the content (i.e latest topics and hot topics, it shows a list of topics). I want to display on top of that content a title, so on the template (newbb_block_topic.html) I added this second line:

<{elseif $block.disp_mode == 2}>

this is the line I added. like this it shows on both, so I'm trying to get the block title, like this it doesnt work <{$block.title}>

<{foreach item=topic from=$block.topics}>
<tr class="<{cycle values="even,odd"}>">
<td><a href="<{$xoops_url}>/modules/newbb/viewtopic.php?topic_id=<{$topic.id}>&forum=<{$topic.forum_id}>">
<{if $topic.topic_subject}>
<{$topic.topic_subject}>
<{/if}>
<{$topic.title}></a><{$topic.topic_page_jump}>
</td>
</tr>
<{/foreach}>

So I guess my question qould be how do I display in the block that block title...no need for two templates if I can do this...

thanks

6
patagon
Re: CBB blocks questions
  • 2006/4/30 20:51

  • patagon

  • Quite a regular

  • Posts: 235

  • Since: 2002/1/8 0


ok, investigated this a bit more and found that <{$block.title}> works in theme.html and doesnt work inside a block as I wanted...anyone knows if there is a way of getting the block title from inside the block?

thanks

7
krewl
Re: CBB blocks questions
  • 2006/4/30 21:15

  • krewl

  • Just popping in

  • Posts: 39

  • Since: 2006/3/14


Isn't there a function that controls the title and content in blocks? Like the news block which has <{$news.title}>. Maybe you can add to the function and add the title like you want?

I am still looking for where the block pulls information from so I can add the topic image with the news in the block...
-------------------
www.illinoisbmx.com

8
patagon
Re: CBB blocks questions
  • 2006/5/2 2:12

  • patagon

  • Quite a regular

  • Posts: 235

  • Since: 2002/1/8 0


Thanks krewl. Unfortunately I dont know enough to understand exactly what you mean...my guess is that there has to be a way of getting the #### title from the block (and if no, it would help there was .

Login

Who's Online

164 user(s) are online (141 user(s) are browsing Support Forums)


Members: 0


Guests: 164


more...

Donat-O-Meter

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

Latest GitHub Commits