Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-01-19 15:22:27

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

[request] Making (groups of) custom fields on the fly

This is a dream that floats by occasionally.

Basic usage: a client wants to append a number of related URLs to an article. We don’t know how many they might want to add to each article and they don’t see why they should have to decide up front. Fair enough.

  • They could manually write them into the body with Textile, but that places restrictions on the page layout.
  • They could manually write them into a (textarea) custom field with Textile – one per line – but the client isn’t capable of using Textile reliably (not so far fetched in my experience).

I think there’s a ‘linkify’ plugin somewhere that turns URLs into links, solving the second example. So this hypothetical problem isn’t insurmountable. But it allows me to illustrate something that would apply some qulity control and provide a smooth experience for the CMS user:

What if we could make a ‘related URL’ custom field, append a “add new” link next to it, allowing the user to clone the field so they could add another URL?

I personally can’t imagine how it would be possible (though that’s not saying much). My rough idea is that the extra fields would be created dynamically by jQuery and the data entered would be stored (invisibly) in an array in the original custom field. Then we’d need some nice clean txp:tags to control the output.

I have a real need right now for something that would go one step beyond this functionality – the need to ‘group’ custom fields and clone/duplicate the group:

  1. Group1
    • Title
    • Image
    • Copy
  2. Group2
    • Title
    • Image
    • Copy
  3. Group3
    • etc

That would allow me to organise a really long article into manageable chunks, generate in-page table of contents (without other plugins – I think soo_toc relies on users adding IDs to headings) and it also fits nicely with HTML5 sectioning semantics.

<article>
<section>
Group 1 title
Group 1 image
Group 1 copy
</section>
<section>
Group 2 title
Group 2 image
Group 2 copy
</section>
</article>

I just spoke to the client and agreed to limit him to 6 hard-coded ‘groups’ of custom fields – a reasonable limit to impose – but it’s just added 18 custom fields to the spec and it’s a restriction I’d prefer I didn’t need to impose.

Anyway, that seems far fetched. Just wanted to get it off my chest :-)

Last edited by pieman (2011-01-19 15:40:25)

Offline

#2 2011-01-19 15:36:00

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: [request] Making (groups of) custom fields on the fly

pieman wrote:

I think there’s a ‘linkify’ plugin somewhere that turns URLs into links

rah url to link?

Offline

#3 2011-01-19 15:42:03

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: [request] Making (groups of) custom fields on the fly

Hmmm

I could see the value in some situations of adding a link version of the article_image, so that individual links are associated with individual articles. Of course that would be a core feature, not a plugin.

And that wouldn’t allow for the detailed information you want to be entered on the fly, or multiple links.

Offline

#4 2011-01-19 15:42:47

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: [request] Making (groups of) custom fields on the fly

Thanks Mike. That’s the bunny.

Still, I dream of a perfect world where my custom fields will roll over, play dead or jump through hoops at my command.

Offline

#5 2011-01-19 15:46:21

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: [request] Making (groups of) custom fields on the fly

Your welcome :)

Dreams help us come up with great ideas!

Offline

#6 2011-01-19 15:58:15

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: [request] Making (groups of) custom fields on the fly

maverick wrote:

I could see the value in some situations of adding a link version of the article_image, so that individual links are associated with individual articles.

Yes, I’ve considered that idea too.

Of course that would be a core feature, not a plugin.

Not necessarily. Something like wet_quicklink, but referencing the the txp_files table instead would do the job.

And that wouldn’t allow for the detailed information you want to be entered on the fly, or multiple links.

It would allow for multiple links if it added comma separated link_IDs to a custom field, like wet_quicklink and many of the admin-side image plugins do.

But it wouldn’t be as smooth for the CMS user – to have to go visit the Links tab to add the link(s), then back to the Write tab to associate the link(s) with the article before publishing. I know there are things like bot_image_upload that very nicely simplify the process of associating images with articles, and if a similar workflow could be applied to Links then we’ve got a little party on our hands! I also love the way bot_image_upload makes selected images visible in the Write tab. It would be great if the chosen links were rendered there too, to give more confidence to the CMS user. ID numbers in custom fields are a pretty opaque way of publishing.

Is this pressing anyone else’s buttons?

None of the above would address my second, more complex, use case. But it’s pretty rare situation I don’t expect a solution for that one any time soon :-)

Offline

Board footer

Powered by FluxBB