Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-11-08 13:40:29

wornout
Member
From: Italy
Registered: 2009-01-20
Posts: 256
Website

Use IDs to call section or categories

Many times when in development process section and category names could change.
Changing them comport you to update pages or forms where sections were used.
Why don’t use ID attribute in <txp:section /> or <txp:category /> tags?

What do you think about it?

Last edited by wornout (2012-11-08 13:41:10)

Offline

#2 2012-11-08 14:20:55

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: Use IDs to call section or categories

wornout wrote:

Why don’t use ID attribute in <txp:section /> or <txp:category /> tags?
What do you think about it?

good idea


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2012-11-08 14:36:36

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

Re: Use IDs to call section or categories

I’m in favour of it!

“Hey, I can do it all by myself!” said the client and renamed the section from Shop to Store ;)


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

Offline

#4 2012-11-08 14:53:48

sacripant
Plugin Author
From: Rhône — France
Registered: 2008-06-01
Posts: 479
Website

Re: Use IDs to call section or categories

When you change, you change name AND title or only title ?
To avoid trouble I change only Title.

Offline

#5 2012-11-08 15:12:12

wornout
Member
From: Italy
Registered: 2009-01-20
Posts: 256
Website

Re: Use IDs to call section or categories

I think at this feature like an option for developers.
Each of us has its own techniques. My suggestion allows you to have one more.

Offline

#6 2012-11-08 16:05:30

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Use IDs to call section or categories

Sections don’t have numerical IDs like articles, the name is the primary key and unique tie-in. Categories on the other hand do, so for those technically there could be an ID attribute.

The problem with all this visible ID relation Textpattern has, is that it generates rather unreadable code and makes linking content very much not ideal. While having IDs is must for internal relations, we should’ve never had to relay on them like we do. In number of cases the ID is the only tool for linking and selecting content — which is just nuts.

If there was one thing I could do, that would go back in time and remove ID attributes and the strong presence from the admin-side interface. Those IDs shouldn’t be used for much of anything else than for internal relations. The main tool for selecting a static article could be the title or a custom field with a textual hint of the content, not an ID that tells nothing about the selected content.

As with articles, sections could benefit from custom fields. In perfect world all content would have configurable custom fields, even sections and categories. Which would allow selecting section while keeping the name free for changes.

The first thing I do when setting up Textpattern is adding a custom field that is used for selecting static articles. I try to avoid using IDs as much as possible.

Offline

Board footer

Powered by FluxBB