1
JMorris
Can theme elements be displayed by xoops version?
  • 2005/8/20 13:41

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


I was wondering if it is possible to display certain theme elements based on XOOPS version? In particular, can the javascript navigation bar be include if XOOPS version is > 2.1, but excluded if XOOPS version < 2.1?

In psuedo-code:
<{if 
$xoops_version "2.1"}>
//call to javascript navigation bar//
<{else}>
//call to dynamic css navigation bar//
<{/if}>


Something like this would be great for designers that want to make themes that are compatible with both 2.0.x and 2.2.x versions of XOOPS.

Thanks for the help!

James
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

2
WarDick
Re: Can theme elements be displayed by xoops version?
  • 2005/8/20 14:22

  • WarDick

  • Just can't stay away

  • Posts: 890

  • Since: 2003/9/13


Will the navbar work in lower versions?
Urging XOOPS to be the Best It Can Be.
Richard......

3
Mithrandir
Re: Can theme elements be displayed by xoops version?

errrr... the navbar is created completely in the theme in XOOPS 2.2. There is no core (XOOPS-2.2-added) JS code used.

The admin elements are only given in XOOPS 2.2 - but since 2.0.x doesn't give the opportunity to theme the admin section, this is hardly relevant.
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software

4
JMorris
Re: Can theme elements be displayed by xoops version?
  • 2005/8/20 14:35

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


Quote:

Mithrandir wrote:
errrr... the navbar is created completely in the theme in XOOPS 2.2. There is no core (XOOPS-2.2-added) JS code used.

The admin elements are only given in XOOPS 2.2 - but since 2.0.x doesn't give the opportunity to theme the admin section, this is hardly relevant.


I saw this in the structure of the new default theme, that's why I was inquiring as to whether it could be excluded or not based on the xoops_version variable.

The goal is to code themes that will work correctly with both 2.0.x and 2.2.x versions of XOOPS. Less "XX theme doesn't work with xx version of XOOPS" questions that way.

Best Regards,

James
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

5
Mithrandir
Re: Can theme elements be displayed by xoops version?

The only reason why the XOOPS 2.2 default theme won't work in 2.0.x is that
- CSS file won't be found (structure has changed - but the old one with the css file in the theme's root is still valid)
- Language file won't be included (so you'll have to hard-code the strings)
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software

6
JMorris
Re: Can theme elements be displayed by xoops version?
  • 2005/8/20 14:47

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


Ok, so if I'm understanding your correctly... If I want to make a theme compatible with both XOOPS 2.0.x and 2.2.x, I would need to do something like the following:

In psuedo-code:
<{if 
$xoops_version "2.1"}>
//call to javascript navigation bar//
//correct path to css for [b]2.2.x[/b] themes//
//correct path to language files for [b]2.2.x[/b] themes//
<{else}>
//call to dynamic css navigation bar//
//correct path to css for [b]2.0.x[/b] themes//
//hard coded language strings for [b]2.0.x[/b] themes//
<{/if}>


Is the above correct? Also, is <{if $xoops_version > "2.1"}> the correct smarty statement to use?

Thanks!

James
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

7
Mithrandir
Re: Can theme elements be displayed by xoops version?

the variable is <{$xoops_version}>, but whether you can just put a > for comparison, I don't know

Also, you are still not understanding me. The pseudo-code would be something like this:

<{if $xoops_version "2.1"}>
    
//include PHP language file for 2.0.x themes//
<{/if}>
//call to javascript navigation bar//


and pop the style.css, styleNN.css and styleMAC.css files in the themes/themename folder
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software

8
JMorris
Re: Can theme elements be displayed by xoops version?
  • 2005/8/20 15:14

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


Quote:

Mithrandir wrote:
the variable is <{$xoops_version}>, but whether you can just put a > for comparison, I don't know

Also, you are still not understanding me. The pseudo-code would be something like this:

<{if $xoops_version "2.1"}>
    
//include PHP language file for 2.0.x themes//
<{/if}>
//call to javascript navigation bar//


and pop the style.css, styleNN.css and styleMAC.css files in the themes/themename folder


Ok, that's making a bit more sense. Sorry for getting confused. So, if < 2.1, define the path to the language files. And just have a copy of the css files in both locations. Simple enough.

Now, my next question, can the javascript navigation bar be excluded unless the XOOPS version is > 2.1?

That's what I was meaning by:
<{if $xoops_version "2.1"}>
//call to javascript navigation bar//
<{/if}>


I know the javascript bar is not essential, and it can be excluded completely, but I kinda like it, so when the XOOPS version is > 2.1, I'd like to keep it.
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

9
Dave_L
Re: Can theme elements be displayed by xoops version?
  • 2005/8/20 17:07

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


The version check would be more complicated than that. The version string looks like this: "XOOPS 2.2". And there could be a suffix like "Beta2" or "RC1".

Login

Who's Online

309 user(s) are online (195 user(s) are browsing Support Forums)


Members: 0


Guests: 309


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