ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How do I select a default field in the upload popup menu

July 18, 2007 3:35pm

Subscribe [2]
  • #1 / Jul 18, 2007 3:35pm

    aquaadmin

    64 posts

    My entry pages have quite a few fields. One of the fields is a “lead image” field. I like this to be at the bottom of the order because it’s the last thing I do when I create an entry. When I want to upload an image the default field in the popup menu for where you’d like to insert the img code is usually the very top field, which is not the image field in my case. Is there any way to set a default field on the popup menu so I don’t have to scroll through lots of entry fields? That way when I click upload the image field is always highlighted. I suppose I could move the image field to the top, but this is inconvenient to my work flow, as I have lots of entries to add and they all follow a certain order.

  • #2 / Jul 19, 2007 12:52pm

    Robin Sowell

    13255 posts

    An easy way to do it isn’t leaping out at me.  The code itself is easy enough to hack- it’s in cp.publish.php around line 9760:

    $query = $DB->query("SELECT field_id, field_label FROM exp_weblog_fields WHERE group_id = '".$data['field_group']."' AND field_type NOT IN ('date', 'rel', 'select') ORDER BY field_order");

    That’s the code that grabs the fields- and it’s ordering them by field_order.  You could change up the order easily, but I’m not sure what would be an improvement.  Hm- if you dinked with your naming conventions a bit, that would do it.  And I vaguely recall a way to force a sort so that whatever you want is the first returned.  But that’s vague.  Other option is to sort the resulting query array- hm.

    But if I needed to do it, that’s where I’d start.

  • #3 / Jul 19, 2007 2:15pm

    aquaadmin

    64 posts

    Hmm that seems pretty complicated. I thought there would be an easy fix. Kind of in a crunch now so I’ll try to live with it. Thanks.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases