1
jimkarvo
Diferent blocks for diferent themes!
  • 2006/4/5 16:28

  • jimkarvo

  • Not too shy to talk

  • Posts: 169

  • Since: 2005/9/19


I want to add a block for "x" theme! but at "y" theme didn't work aproximately, and I must make new! Block is written at html code!

How I add diferent block, for diferent theme?

eg: at "x" theme, load "x" block

at "y" theme, load "y" block!

thenx

-JimKarvo
whttp://www.pc4allgr.com - Greek community for PCs

PC4ALL Admins' Team!

2
jimkarvo
Re: Diferent blocks for diferent themes!
  • 2006/4/6 11:46

  • jimkarvo

  • Not too shy to talk

  • Posts: 169

  • Since: 2005/9/19


Anyone knows?
whttp://www.pc4allgr.com - Greek community for PCs

PC4ALL Admins' Team!

3
zoullou
Re: Diferent blocks for diferent themes!
  • 2006/4/6 12:22

  • zoullou

  • Quite a regular

  • Posts: 250

  • Since: 2004/3/2 0


You can't do that with XOOPS

4
davidl2
Re: Diferent blocks for diferent themes!
  • 2006/4/6 13:05

  • davidl2

  • XOOPS is my life!

  • Posts: 4843

  • Since: 2003/5/26


At least not on versions before 2.3 ... later versions may be possible.

5
stefan88
Re: Diferent blocks for diferent themes!
  • 2006/4/6 13:32

  • stefan88

  • Community Support Member

  • Posts: 1086

  • Since: 2004/9/20


You can do this if you have positions that you do not use.

For example put block "x" in "centerLeft" and block "y" in "centerRight". In theme "x" exclude "centerRight" loop, so block "y" will not show and in theme "y" exclude "centerLeft" loop.

If you use all positions, you may still do it with multiblock hack to add ne positions ...

..

6
jimkarvo
Re: Diferent blocks for diferent themes!
  • 2006/4/6 13:41

  • jimkarvo

  • Not too shy to talk

  • Posts: 169

  • Since: 2005/9/19


Quote:

stefan88 wrote:
You can do this if you have positions that you do not use.

For example put block "x" in "centerLeft" and block "y" in "centerRight". In theme "x" exclude "centerRight" loop, so block "y" will not show and in theme "y" exclude "centerLeft" loop.

If you use all positions, you may still do it with multiblock hack to add ne positions ...



Xm.. good answer!

But that means, I mustn't have any blocks @ right, or left! Corectly?

OK, Good Idea! how I do it?
whttp://www.pc4allgr.com - Greek community for PCs

PC4ALL Admins' Team!

7
blueteen
Re: Diferent blocks for diferent themes!
  • 2006/4/6 14:08

  • blueteen

  • Quite a regular

  • Posts: 379

  • Since: 2004/7/16


Here's a thing i've tried on a XOOPS 2.0.13.2
It's a tip of the multimenu module (Solo71) to integrate a menu directly in a theme.
tell me if i'm wrong with my response :

we must change some code in theme, but it's easy :)

i've 2 theme : "sable" and "automne"
i want to display a block "sable_only", only in "sable theme".
not in "automne theme".

here's the code change.

create a block named : sable_only
put in it, whatever you want
configure it to display in left column.

then, some changes to appply to the first theme :

edit themes/sable/theme.html
look for :

<{foreach item=block from=$xoops_lblocks}>
   <{include 
file="sable/theme_blockleft.html"}>
<{/foreach}>


add before these 3 lines :

<{foreach item=block from=$xoops_lblocks}>
  <{if 
$block.title == 'sable_only'}>
    <{include 
file="sable/theme_blockleft.html"}>
  <{/if}>
<{/foreach}>


and change original code to :

<{foreach item=block from=$xoops_lblocks}>
   <{if 
$block.title != 'sable_only'}>
    <{include 
file="sable/theme_blockleft.html"}>
   <{/if}>
<{/foreach}>


these depends on wich theme you are using.
ok ?

in the first 'foreach' code, i display only the block named 'sable_only'.
in the second 'foreach', i display all blocks, except 'sable_only'.

edit the second theme's file :
themes/automne/theme.html

look for code who's displaying left column.
in my case :

<{foreach item=block from=$xoops_lblocks}>
<
table cellspacing="0" cellpadding="2">
<
tr>
<
td class="blockTitle">&nbsp;<img src="<{$xoops_url}>/themes/<{$xoops_theme}>/images/maru.gif">&nbsp;<{$block.title}>td>tr>
<
tr><td class="blockContent"><{$block.content}>td>tr>table>
<{/foreach}>


and change it to :

<{foreach item=block from=$xoops_lblocks}>
<{if 
$block.title != 'sable_only'}>
<
table cellspacing="0" cellpadding="2">
<
tr>
<
td class="blockTitle">&nbsp;<img src="<{$xoops_url}>/themes/<{$xoops_theme}>/images/maru.gif">&nbsp;<{$block.title}>td>tr>
<
tr><td class="blockContent"><{$block.content}>td>tr>table>
<{/if}>
<{/foreach}>


in order to display all blocks, except blocks named 'sable_only'

thus, if i'm on my website, with sable theme activated, i can see the block 'sable_only', and all others left blocks.

and if i switch theme to "automne", i can see all blocks of the left column, except the 'sable_only' block.

i hope this post responds to your question, and help you a little !

and scuse my very bad english ! :-p

8
jimkarvo
Re: Diferent blocks for diferent themes!
  • 2006/4/6 14:29

  • jimkarvo

  • Not too shy to talk

  • Posts: 169

  • Since: 2005/9/19


I will test it I and Ι will say if it is work!

May install any module, or only changes to theme.html / theme.php?

-JimKarvo

EDIT:

Thanx for your help-post

PS: And I, don't know very good english!

I am too litle to know good English

Anywhene, If something don't understand, tell me!

English is too different by Greek
whttp://www.pc4allgr.com - Greek community for PCs

PC4ALL Admins' Team!

9
blueteen
Re: Diferent blocks for diferent themes!
  • 2006/4/6 14:53

  • blueteen

  • Quite a regular

  • Posts: 379

  • Since: 2004/7/16


you have only to apply change to themes

10
jimkarvo
Re: Diferent blocks for diferent themes!
  • 2006/4/6 15:22

  • jimkarvo

  • Not too shy to talk

  • Posts: 169

  • Since: 2005/9/19


What you mean?

I will shave changes of theme? Then? I may do any changes at system?
whttp://www.pc4allgr.com - Greek community for PCs

PC4ALL Admins' Team!

Login

Who's Online

228 user(s) are online (178 user(s) are browsing Support Forums)


Members: 0


Guests: 228


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