Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2015-07-09 08:26:43

ax
Member
From: Germany
Registered: 2009-08-19
Posts: 150

if_version tag?

In view of anticipated changes in upcoming Textpattern versions, that could be non-compliant with existing applications, perhaps there is a need for a <txp:if_version> tag, that would allow more easily to up-/downgrade the whole system?

Last edited by ax (2015-07-09 08:27:26)

Offline

#2 2015-07-09 09:49:29

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,588
Website

Re: if_version tag?

+1


TXP Builders – finely-crafted code, design and txp

Offline

#3 2015-07-09 11:11:22

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,394
Website

Re: if_version tag?

+1

Offline

#4 2015-07-09 11:31:49

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,208

Re: if_version tag?

Isn’t that doable with reverse thinking and the <txp:if_plugin name="xyz_plugin" version="4"> tag? Not really.

Last edited by uli (2015-07-09 13:17:35)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#5 2015-07-09 11:59:04

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,374
Website

Re: if_version tag?

What version would it parse for those who use the svn or hacked installs?


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | Respbublika! | NeMe @ github

Offline

#6 2015-07-09 13:29:39

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,226
Website

Re: if_version tag?

<txp:adi_globals name="version" />

<txp:if_variable name="version" value="4.5.7">
	Latest release!
</txp:if_variable>

Offline

#7 2015-07-09 13:59:48

ax
Member
From: Germany
Registered: 2009-08-19
Posts: 150

Re: if_version tag?

gomedia wrote #292973:

<txp:adi_globals name="version" />...

Perfect!

Offline

#8 2015-07-09 14:09:04

etc
Developer
Registered: 2010-11-11
Posts: 3,414
Website

Re: if_version tag?

ax wrote #292975:

Perfect!

At least if no further releases are planned. :) Such a tag could be useful for themes, indeed, but it needs more power than simple equality check:

<txp:etc_query globals="prefs" functions="strnatcmp" query="strnatcmp('{?version}', '4.6')>=0">
	New era
<txp:else />
	Outdated version
</txp:etc_query>

Offline

#9 2015-07-09 14:58:19

ax
Member
From: Germany
Registered: 2009-08-19
Posts: 150

Re: if_version tag?

etc wrote #292976:

At least if no further releases are planned. :) Such a tag could be useful for themes, indeed, but it needs more power than simple equality check:

<txp:etc_query globals="prefs" functions="strnatcmp" query="strnatcmp('{?version}', '4.6')>=0">...

Very interesting tag. Thanks!

Offline

#10 2015-07-10 00:41:32

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,226
Website

Re: if_version tag?

And to skin the cat one more time:

<txp:adi_globals name="version" />

<txp:rah_function call="version_compare" version1='<txp:variable name="version" />' version2="4.5.7" operator=">" _is="TRUE">
	<txp:variable name="version" /> is the future
<txp:else />
	<txp:rah_function call="version_compare" version1='<txp:variable name="version" />' version2="4.5.7" operator="<" _is="TRUE">
		<txp:variable name="version" /> is the past
	<txp:else />
		<txp:variable name="version" /> is the present
	</txp:rah_function>
</txp:rah_function>

Offline

Board footer

Powered by FluxBB