Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
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
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
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
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