Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-03-11 22:46:51

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Rename attributes in tags to be equal

There are some tag attributes, which names are different from other attributes in tag:

  1. attr val in <txp:custom_field val="22" name="xx" />
  2. 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

#3 2010-03-06 20:15:50

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

Re: Rename attributes in tags to be equal

Done, done and done.

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

#4 2010-03-07 12:09:48

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

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

#5 2010-03-07 12:52:22

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

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

#6 2010-03-07 15:17:55

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

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

#7 2010-03-07 15:27:38

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

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

Board footer

Powered by FluxBB