- Posts: 69
COMMUNITY FORUM
Extra field values - ordering
- Uldis
- Offline
- Senior Member
Less
More
11 years 7 months ago #63382
by Uldis
Replied by Uldis on topic Re: Extra field values - ordering
I'm also very interested in this. If you need to add new value in alphabetic order there is now possibility to do this. Maybe someone found a solution for this?
Please Log in or Create an account to join the conversation.
- Micha
- Offline
- New Member
Less
More
- Posts: 14
11 years 7 months ago - 11 years 7 months ago #63383
by Micha
Replied by Micha on topic Re: Extra field values - ordering
I was looking for a working answer on this one to.
Never find one that really worked.
I started searching for a better way to fix the order of extra fields and found this.
Go to your phpmyadmin or whatever you use for your database. (See image)
1. Click on '????_k2_extra_fields' in the left column.
2. Click one time on the extra field number you want to change in the 'ID' column and start sorting it that way.
Worked out fine for me!
Never find one that really worked.
I started searching for a better way to fix the order of extra fields and found this.
Go to your phpmyadmin or whatever you use for your database. (See image)
1. Click on '????_k2_extra_fields' in the left column.
2. Click one time on the extra field number you want to change in the 'ID' column and start sorting it that way.
Worked out fine for me!
Please Log in or Create an account to join the conversation.
- Mohamed Abdelaziz
- Offline
- Platinum Member
- Joomla Developer
11 years 7 months ago #63384
by Mohamed Abdelaziz
Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store
Replied by Mohamed Abdelaziz on topic Re: Extra field values - ordering
I will add this feature to
Multiple Extra Fields for K2
very soon, after the weekend.
Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store
Please Log in or Create an account to join the conversation.
- Bernd Duhnke
- Offline
- New Member
Less
More
- Posts: 1
11 years 6 months ago #63385
by Bernd Duhnke
Replied by Bernd Duhnke on topic Re: Extra field values - ordering
The best option is, when entering a new option to the dropdown list, the option automatically sorted alphabetically, or from small to large. Or changing it manually in backend like the extra fields.
Please Log in or Create an account to join the conversation.
- K Coyne
- Offline
- New Member
Less
More
- Posts: 5
10 years 11 months ago #63386
by K Coyne
Replied by K Coyne on topic Re: Extra field values - ordering
I also very much need this capability to re/order values for extra values as lists grow/change. The lack of this capability is an EXTREME limitation on extra fields.
Please Log in or Create an account to join the conversation.
- Jim Van Zile
- Offline
- New Member
Less
More
- Posts: 6
10 years 7 months ago #63387
by Jim Van Zile
Replied by Jim Van Zile on topic Re: Extra field values - ordering
Just checking in, a post over 10 moths ago indicated this capability might be added to K2 shortly after the post, then a couple more posts from others interested in this feature. I too could really benefit from the feature. Any update coming in the near future?
Please Log in or Create an account to join the conversation.
- Catherine Mollet
- Offline
- New Member
Less
More
- Posts: 8
7 years 3 months ago #163202
by Catherine Mollet
Replied by Catherine Mollet on topic Extra field values - ordering
Sorry to re-open this thread, but still nothing new about this since 2012? Any way to reorder extra fields values (or to sort them by alphabetical order) without changing values IDs in database?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 3 months ago #163214
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Extra field values - ordering
Mohamed delivered on his promise to extend this functionality in a plugin www.joomreem.com/multiple-extra-fields-groups-mefg-for-k2#.WYMJS9OGOis
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Ronny Van Der Borght
- Offline
- Senior Member
7 years 3 months ago #163292
by Ronny Van Der Borght
Replied by Ronny Van Der Borght on topic Extra field values - ordering
In your front-end templates you could do this:
Convert your extra field to a list with:
<?php $extrafieldtolist = explode(',',$this->item->extraFields->MyExtraField->value); ?>
<ul id="sortable-list">
<?php foreach ($extrafieldtolist as $extrafieldtolist): ?>
<li class="<?php echo $extrafieldtolist; ?>"><?php echo $extrafieldtolist; ?></li>
<?php endforeach; ?>
</ul>
and then do some jQuery magic:
<script>
(function( $ ) {
$(function() {
$( "li", "#sortable-list" ).sort(function( a, b ) {
return $( a ).text() > $( b ).text();
}).appendTo( "#sortable-list" );
});
})( jQuery );
</script>
Convert your extra field to a list with:
<?php $extrafieldtolist = explode(',',$this->item->extraFields->MyExtraField->value); ?>
<ul id="sortable-list">
<?php foreach ($extrafieldtolist as $extrafieldtolist): ?>
<li class="<?php echo $extrafieldtolist; ?>"><?php echo $extrafieldtolist; ?></li>
<?php endforeach; ?>
</ul>
and then do some jQuery magic:
<script>
(function( $ ) {
$(function() {
$( "li", "#sortable-list" ).sort(function( a, b ) {
return $( a ).text() > $( b ).text();
}).appendTo( "#sortable-list" );
});
})( jQuery );
</script>
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 3 months ago #163307
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Extra field values - ordering
Ronny,
Since you are a dev, why not include your website or some contact info in your signature ;)
Since you are a dev, why not include your website or some contact info in your signature ;)
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.