rtskoo rtskoo
  • Just popping in
  • Just popping in
  • Joined: 2010/8/30 10:13
  • From CHINA
  • Group: Registered Users
  • Posts: 5
  • Posted on: 2010/8/30 10:30
How to hack about: one block with one template file,not share the same template file ?? #1
Is there anyone knows:
How to make one block have one template file ,not share the same template file ??
Bleekk Bleekk
  • Theme Designer
  • Theme Designer
  • Joined: 2002/12/14 10:13
  • From Vienna
  • Group: Registered Users Designer Group Theme Preparation
  • Posts: 708
  • Posted on: 2010/8/30 10:51
Re: How to hack about: one block with one template file,not share the same template file ?? #2
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}>
rtskoo rtskoo
  • Just popping in
  • Just popping in
  • Joined: 2010/8/30 10:13
  • From CHINA
  • Group: Registered Users
  • Posts: 5
  • Posted on: 2010/8/30 18:29
Re: How to hack about: one block with one template file,not share the same template file ?? #3
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?
Bleekk Bleekk
  • Theme Designer
  • Theme Designer
  • Joined: 2002/12/14 10:13
  • From Vienna
  • Group: Registered Users Designer Group Theme Preparation
  • Posts: 708
  • Posted on: 2010/8/30 18:45
Re: How to hack about: one block with one template file,not share the same template file ?? #4
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">
rtskoo rtskoo
  • Just popping in
  • Just popping in
  • Joined: 2010/8/30 10:13
  • From CHINA
  • Group: Registered Users
  • Posts: 5
  • Posted on: 2010/8/30 19:07
Re: How to hack about: one block with one template file,not share the same template file ?? #5
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.
Bleekk Bleekk
  • Theme Designer
  • Theme Designer
  • Joined: 2002/12/14 10:13
  • From Vienna
  • Group: Registered Users Designer Group Theme Preparation
  • Posts: 708
  • Posted on: 2010/8/30 19:25
Re: How to hack about: one block with one template file,not share the same template file ?? #6
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
rtskoo rtskoo
  • Just popping in
  • Just popping in
  • Joined: 2010/8/30 10:13
  • From CHINA
  • Group: Registered Users
  • Posts: 5
  • Posted on: 2010/8/30 19:45
Re: How to hack about: one block with one template file,not share the same template file ?? #7
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.
Bleekk Bleekk
  • Theme Designer
  • Theme Designer
  • Joined: 2002/12/14 10:13
  • From Vienna
  • Group: Registered Users Designer Group Theme Preparation
  • Posts: 708
  • Posted on: 2010/8/30 20:58
Re: How to hack about: one block with one template file,not share the same template file ?? #8
sorry this is something complete different. i hope someone else can help you
ghia ghia
  • Community Support Member
  • Community Support Member
  • Joined: 2008/7/3 15:19
  • From Belgium
  • Group: Registered Users
  • Posts: 4946
  • Posted on: 2010/8/31 2:42
Re: How to hack about: one block with one template file,not share the same template file ?? #9
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.
How to effectively post a question in the Xoops forums? - Read here...
Design by: XOOPS UI/UX Team