Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2015-07-09 08:26:43
- ax
- Plugin Author
- From: Germany
- Registered: 2009-08-19
- Posts: 153
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: 4,026
- Website
Offline
#3 2015-07-09 11:11:22
- jstubbs
- Moderator
- From: Hong Kong
- Registered: 2004-12-13
- Posts: 2,395
- Website
Offline
#4 2015-07-09 11:31:49
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,236
Re: if_version tag?
Isn’t that doable with reverse thinking and the Not really.<txp:if_plugin name="xyz_plugin" version="4">
tag?
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: 8,456
- Website
Re: if_version tag?
What version would it parse for those who use the svn or hacked installs?
Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.
Offline
#6 2015-07-09 13:29:39
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,300
- 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
- Plugin Author
- From: Germany
- Registered: 2009-08-19
- Posts: 153
Re: if_version tag?
Offline
#8 2015-07-09 14:09:04
- etc
- Developer
- Registered: 2010-11-11
- Posts: 4,056
- 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
- Plugin Author
- From: Germany
- Registered: 2009-08-19
- Posts: 153
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,300
- 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