1
rtskoo
How to hack about: one block with one template file,not share the same template file ??
  • 2010/8/30 14:30

  • rtskoo

  • Just popping in

  • Posts: 5

  • Since: 2010/8/30


Is there anyone knows:
How to make one block have one template file ,not share the same template file ??

2
Bleekk
Re: How to hack about: one block with one template file,not share the same template file ??
  • 2010/8/30 14:51

  • Bleekk

  • Theme Designer

  • Posts: 940

  • Since: 2002/12/14


you can do it by checking the block id or block title
<{if $block.title=="block-name"}>
  <
div class="thisclass">
<{elseif 
$block.title=="blockname"}>
  <
div class="anotherclass">
<{/if}>

3
rtskoo
Re: How to hack about: one block with one template file,not share the same template file ??
  • 2010/8/30 22:29

  • rtskoo

  • Just popping in

  • Posts: 5

  • Since: 2010/8/30


Thanks. But I have set the $block.title null, so I cannot use it in "IF". $block.id can be used.
Is there any better way without "IF" in template file?

4
Bleekk
Re: How to hack about: one block with one template file,not share the same template file ??
  • 2010/8/30 22:45

  • Bleekk

  • Theme Designer

  • Posts: 940

  • Since: 2002/12/14


hmm you can ad a counter in the foreach loop so you will get for each block listed a new class
something like this
<div class="something<{counter}>">

result:
<div class="something0">
<
div class="something1">
<
div class="something2">
<
div class="something3">

5
rtskoo
Re: How to hack about: one block with one template file,not share the same template file ??
  • 2010/8/30 23:07

  • rtskoo

  • Just popping in

  • Posts: 5

  • Since: 2010/8/30


good idea!thank u
but I need PHP code hacking the core so that I can use the template file in menu "System Configuration"->"Templates" which is empty berfore hack.Or other better way?
And I have try the module "Defacer".However it is for page,not for a block in the page.

6
Bleekk
Re: How to hack about: one block with one template file,not share the same template file ??
  • 2010/8/30 23:25

  • Bleekk

  • Theme Designer

  • Posts: 940

  • Since: 2002/12/14


you are welcome.
sorry but I do not understand what you are trying to do. maybe you can explain it one more time for me

7
rtskoo
Re: How to hack about: one block with one template file,not share the same template file ??
  • 2010/8/30 23:45

  • rtskoo

  • Just popping in

  • Posts: 5

  • Since: 2010/8/30


We know that when a new block is cloned ,its template file is empty ,even saved after some code written in this empty template file . Because this new block shares the same template file with the old block.So how can we do to make this new block's template file usefull ? That means this new block's template file will be not empty after modify it,and it will take effect for the new block.

8
Bleekk
Re: How to hack about: one block with one template file,not share the same template file ??
  • 2010/8/31 0:58

  • Bleekk

  • Theme Designer

  • Posts: 940

  • Since: 2002/12/14


sorry this is something complete different. i hope someone else can help you

9
ghia
Re: How to hack about: one block with one template file,not share the same template file ??
  • 2010/8/31 6:42

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


You want not a cloned block, but a changed copy of the block.
Check out the module tutorial on kaotik.biz, there is a section that deals with blocks.
Then edit the xoops_version file of your module and add a new block by duplicating the target block entries and giving it new names. Then go to the file where the original block function is defined and duplicate there also the code and rename the function. Duplicate also the template file with the new name.
Update the module.
You now have two blocks with the same function, yet different setup and templates.

Login

Who's Online

232 user(s) are online (112 user(s) are browsing Support Forums)


Members: 0


Guests: 232


more...

Donat-O-Meter

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

Latest GitHub Commits