Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Rename attributes in tags to be equal
There are some tag attributes, which names are different from other attributes in tag:
- attr
val
in<txp:custom_field val="22" name="xx" />
- attr
n
in<txp:css n="default" />
Such things are very confusing for novices and i don’t see real necessity for using this attr instead of value
and name
. Let make tag system more and more newbie-friendly – even me, not-newbie txp user this unexpected attributes cautch some times :)
Last edited by the_ghost (2009-03-11 22:51:28)
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
#2 2009-03-11 22:52:53
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Rename attributes in tags to be equal
Also:
c
in <txp:image_index />
sep
in <txp:breadcrumb />
Offline
Re: Rename attributes in tags to be equal
I chickened out of deprecating n
in txp:css (primarily because rvm_css uses n
and the fact that everyone has at least one css tag in their pages) and just made name
acceptable as well. If people prefer, we can always add the deprecation warning message in a little while. If we update Textbook to say that name
is the preferred option and silently ignore n
in the docs, the migration should occur eventually.
Last edited by Bloke (2010-03-07 08:10:07)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Rename attributes in tags to be equal
The “n” thing could be done auto-magically on upgrade couldn’t it? I’m sure Ruud would be happy to do the same with his lovely plugin too. Ought to be part of the base code anyway but you knew I was going to say that didn’t you?
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: Rename attributes in tags to be equal
thebombsite wrote:
The “n” thing could be done auto-magically on upgrade couldn’t it?
Probably. By someone who’s a better coder than I. Since there are myriad different ways you could arrange your attributes in the txp:css tag, it’d likely rely on a regular expression to filter out the ‘n’ part and replace it with ‘name’. My regex kung fu isn’t that great. Given a week of fiddling about randomly I’d probably get it right, but it’s the sort of thing someone else could whip up in an instant.
If anybody has any thoughts on how to do this reliably, I can deprecate the ‘n’ attribute and do the auto-upgrade thing.
Ought to be part of the base code anyway
All good things come to those who wait… probably ;-)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Rename attributes in tags to be equal
I don’t mind changing the attribute from n to name in rvm_css once there’s a new TXP release. Not sure if I’ll support both old and new attributes in a newer version, because people who prefer the old attribute don’t have to upgrade rvm_css and people who install it for the first time shouldn’t use the old attribute name.
Stef are you subscribed to the txp-dev mailing list?
Offline
Re: Rename attributes in tags to be equal
ruud wrote:
I don’t mind changing the attribute from n to name in rvm_css once there’s a new TXP release. Not sure if I’ll support both old and new attributes in a newer version, because people who prefer the old attribute don’t have to upgrade rvm_css and people who install it for the first time shouldn’t use the old attribute name.
Brilliant, thanks.
Stef are you subscribed to the txp-dev mailing list?
I think I was, but I may have fallen off the list for some reason. I’ve just re-subscribed using a different e-mail account.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline