21
highlander
Re: Xoops 2.0.13.2 hack to add centre blocks above and below content block.
  • 2005/11/12 15:36

  • highlander

  • Not too shy to talk

  • Posts: 151

  • Since: 2004/12/5


LB's post can be found here.

Greetings Highlander

p.s. LB why post that you have a possible solution if you don't want to post a link ??
So, I'm in the park wondering why frisbees get larger as they get closer when suddenly, it hits me...
www.AnimalPedigree.com

22
LazyBadger
Re: Xoops 2.0.13.2 hack to add centre blocks above and below content block.

I can recall, what I done, not where... and finding it in a heap of #OOPS# isn't my problem - I always can restore my ideas and code... it's just gift to lame Mr. Everybody
Quis custodiet ipsos custodes?

Webmaster of
XOOPS2.RU
XOOPS Modules Proving Ground
XOOPS Themes Exhibition

23
Herko
Re: Xoops 2.0.13.2 hack to add centre blocks above and below content block.
  • 2005/11/12 15:46

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


dang, I found it too, but a wee bit too late, I guess

Quote:
p.s. LB why post that you have a possible solution if you don't want to post a link ??

He's a lazy badger... so here's the post LazyBadger wrote:
Quote:
I think, I found my way of implementing more or less universal solution for creating "special blocks" in theme.
I want to discuss it and ask for possible refactoring of not-so-elegant (from my humble POV) smaty-peace.

Preface:
Imagine you have different designs for your theme, and want to implement in (template|language)-independent form with minimal work from end-user side.

Suggested solution:
Use blocktitle and add to titles special signs, which identify "special requirement" for this block. Before display blocktitle technical part must be removed

Implementation:
For block-types Alpha, Bravo, Charlie created 3 piece of code and types names used as block identity. No idenity means default block

Theme used something like

<{if $block.title|regex_replace:"/.*Alpha/":"Alpha" eq "Alpha"}>
      ...
       
Alpha block code with
       
<{$block.title|replace:"Alpha":""|strip}>
      ... 
      <{/if}>
      <{if 
$block.title|regex_replace:"/.*Bravo/":
      
Bravo block code with
      
....
      <{/if}>
      <{if 
$block.title|regex_replace:"/.*Charlie /":
      
Charlie block code with
      
...
      <{/if}>
      default 
block code


Problem with this is that it puts application logic in the presentation layer. It's a nice enough solution using basic smarty features, which is good. But it shouldn't *have* to be in the theme itself.

24
davidl2
Re: Xoops 2.0.13.2 hack to add centre blocks above and below content block.
  • 2005/11/12 15:48

  • davidl2

  • XOOPS is my life!

  • Posts: 4843

  • Since: 2003/5/26


Still ... it's good to "think outside the box"

Well done to all in this thread - some clever ideas.. and i'll be surprised if somethings based on some ideas here dont make it to a core level at some point...

25
LazyBadger
Re: Xoops 2.0.13.2 hack to add centre blocks above and below content block.

Quote:

Herko Coomans wrote:
It's a nice enough solution using basic smarty features, which is good. But it shouldn't *have* to be in the theme itself.

1. There aren't ways to redefine modules's block design in theme for XOOPS before 2.2.3
2. Still there aren't ways to redefine design of one (any) specific block in theme now
3. If your credo is such pure, any PHP-inclusions in theme and <{assign var='varname' value='varvalue'}> inside themes must be outlaws... We get poor stupid lame idiotic #OOPS# as theme in result
Quis custodiet ipsos custodes?

Webmaster of
XOOPS2.RU
XOOPS Modules Proving Ground
XOOPS Themes Exhibition

26
Herko
Re: Xoops 2.0.13.2 hack to add centre blocks above and below content block.
  • 2005/11/12 16:14

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


Quote:

LazyBadger wrote:
Quote:

Herko Coomans wrote:
It's a nice enough solution using basic smarty features, which is good. But it shouldn't *have* to be in the theme itself.

1. There aren't ways to redefine modules's block design in theme for XOOPS before 2.2.3
2. Still there aren't ways to redefine design of one (any) specific block in theme now

I don't *fully* agree, but share your frustration there. It IS very well possible to give each block a unique design using the old core and the new core. Just don't use the theme.html file for that. The theme file defines the *positioning* of the static and dynamic elements, and adds classes to them (and perhaps IDs to static elements, but the use for those is limited to specifics). Actual markup of the dynamic elements (such as blocks) is done in the templates. That's how it has been from the very start since we introduced templates.
However, I share part of your frustration because block titles are defined in the theme.html file, and not in the block template. This IMO goes against the theme/template logic, and produces mixed themes.
When I design a new theme, the block positioning code (the smarty loops for all blocks) only define a <div> in which each block *series* is placed (center-center, center left etc.), and I use CSS and the templates to design the blocks themselves. As it should be, IMHO.
Quote:
3. If your credo is such pure, any PHP-inclusions in theme and <{assign var='varname' value='varvalue'}> inside themes must be outlaws...

Correct. The credo is to keep presentation and application logic separated. Look at the web usability discussions, at csszengarden.com, at alistapart, at the w3c standards, they're all aimed towards facilitating this. If used properly, our theme.html files would only contain a series of <div>s, and nothing more. The whole layout and design is done via CSS.
We're not there yet, tho. That's where the frusration comes from.
Quote:
We get poor stupid lame idiotic #OOPS# as theme in result
Not because we follow the pure logic, but because we don't. And it is nearly possible. The core isn't the biggest problem here tho, the modules are. ALL presentation logic should be in the templates, and not every module does that.

So I think we agree on this

Herko

27
LazyBadger
Re: Xoops 2.0.13.2 hack to add centre blocks above and below content block.

If follow strict rules AND use current possibilities, how you (for example) will define own unique design for one (this!!! and only this... in any clients's locale... block)?
THIS - can be any instance of any block in any version of XOOPS...
Xaraya can handle it, XOOPS without mixing logic and code - can't
Quis custodiet ipsos custodes?

Webmaster of
XOOPS2.RU
XOOPS Modules Proving Ground
XOOPS Themes Exhibition

28
alitan
Re: Xoops 2.0.13.2 hack to add centre blocks above and below content block.
  • 2005/11/12 17:33

  • alitan

  • Quite a regular

  • Posts: 399

  • Since: 2004/3/14


OK, I agree with Herko, but one thing that I cannot understand is that, if there is templating system, then why we do use block_title variables in the theme in the first place? I know it is easier to do it that way, but it's just the waste of time for both a theme developer and also for a user to change all these templates and the themes.
What I suggest is that, we should either put this block styling in the theme.html away forever, and use the actual templating system or either there should be an option in the blcok administrating area so that if I choose the false value in the block setting, the block title may not be displayed. This is the best way of all I think, since there is no need to basically change anything in the themes, and also you can change the block appearance in the templating system to what ever you like.
<edit>
As for LazyBadger's smarty codes, I think they are very useful, but if you want to define for each block what should it look like in theme.html, firstly, it is very difficult, secondly, you may not get what you want at the end due to block height stuff, and lastly, it takes a lot of time, and for every block you add you have to change your theme.
</edit>
Alitan{{<<>>}}
My Persian Xoops Project:
http://www.MPXP.org

29
Herko
Re: Xoops 2.0.13.2 hack to add centre blocks above and below content block.
  • 2005/11/12 17:41

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


Quote:

LazyBadger wrote:
If follow strict rules AND use current possibilities, how you (for example) will define own unique design for one (this!!! and only this... in any clients's locale... block)?
THIS - can be any instance of any block in any version of XOOPS...
Xaraya can handle it, XOOPS without mixing logic and code - can't


You're only right when dealing with multiple instances of the same block. Any other block instance you can design and layout perfectly fine using only the template system. If the developer followed the basic logic of why we have a template system in the first place (to separate design logic and application logic), this wouldn't be a problem at all.

So again, I think we agree here, for the most part.

Alitan: that's what I said: the block titles shouldn't be there... That doesn't follow the logic.

Herko

30
alitan
Re: Xoops 2.0.13.2 hack to add centre blocks above and below content block.
  • 2005/11/12 17:48

  • alitan

  • Quite a regular

  • Posts: 399

  • Since: 2004/3/14


So what I ask here, is the we should some how contact the developers and the designers and thell them that they should change this!
If we can't then one of the best ways is to do what I just said1 We should make an option for the block to be displayed or not!
My Persian Xoops Project:
http://www.MPXP.org

Login

Username:
Password:

Lost Password? Register now!

Who's Online

57 user(s) are online (32 user(s) are browsing Support Forums)


Members: 0


Guests: 57


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