TOPIC:

Listenansicht konfigurieren 4 years 10 months ago #189118

  • lovre's Avatar
  • lovre
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 2667
  • Karma: 76
  • Thanks: 329
Hello,

unfortunately this can't be done using a item wrap code and a current listview sort. The resulting set of data is being sorted on the database level and the item wrap code executed after that. A possible solution would be to do the sorting by php instead of sql, we would ask you for a bit of patience while our developers come up with a best way to implement this in CB. We'll be sure to post the solution here as soon as we have it.

Regards,

Lovre
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
===========================================
Need to renew Pro Support?
Buy Here!
===========================================
Satisfied?
Consider a membership!
===========================================
Like us on Facebook
===========================================

Please Log in or Create an account to join the conversation.

Last edit: Post by lovre.

Listenansicht konfigurieren 4 years 9 months ago #191696

  • Topic Author
  • Kevik
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 22
  • Thanks: 0
Hello Lovre,
is there a solution for the sorting problem in the meantime?

Best regards
Ralf

Please Log in or Create an account to join the conversation.

Listenansicht konfigurieren 4 years 9 months ago #191756

  • lovre's Avatar
  • lovre
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 2667
  • Karma: 76
  • Thanks: 329
Hi,

Do you mean the issue of not being able to sort date database entries as birthday's...to exclude the year?

or are you having another issue?

If the first one is the case then you will still have to wait for this to come up as a feature in CB - for the wrap code to affect the sort.

In the meantime you could create an additional field which doesn't even have to be visible...and its contents would be populated with the birthday of an user on form submission. Then you could use this field as the initial sort field.

Regards,

Lovre
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
===========================================
Need to renew Pro Support?
Buy Here!
===========================================
Satisfied?
Consider a membership!
===========================================
Like us on Facebook
===========================================

Please Log in or Create an account to join the conversation.

Listenansicht konfigurieren 4 years 8 months ago #194208

  • Venexian
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 52
  • Thanks: 0
Hello Kevik,
this is my workaround to the date sorting issue
make it editable and choose Calendar
Set Format to: %Y%m%d
Set Transfer Format to: YYYY/mm/dd
This way the date is written in the format 2017/03/20

Add the following code in Item Wrap Code:
<?php $value = substr($value,8,2) . '/' . substr($value,5,2) . '/' . substr($value,0,4); ?>

and you get the dates sorted correctly.

To get only the day and month add the following insted:
<?php $value = substr($value,8,2) . '/' . substr($value,5,2); ?>

I'm using two views (one for the edit and one for the display) since my application is lot more complex but the above should work even with one view only.
Let me know if works for you.
Venexian

Please Log in or Create an account to join the conversation.

Listenansicht konfigurieren - day/month sort 4 years 8 months ago #194239

  • Venexian
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 52
  • Thanks: 0
Hello Kevik,
I've missed part of your question about sorting birthday date by day/month excluding the year.
Here's my solution:
Set the field type to Regular Text
make it editable and choose Calendar
Set Format to: %m/%d
Set Transfer format to: mm/dd
This way the date is written in the format 03/22 (today)

Add the following code in Item Wrap Code:
<?php $value = substr($value,3,2) . '/' . substr($value,0,2); ?>

Save the view and you're done!
HTH,
Venexian

Please Log in or Create an account to join the conversation.

Listenansicht konfigurieren 4 years 8 months ago #194283

  • lovre's Avatar
  • lovre
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 2667
  • Karma: 76
  • Thanks: 329
Hi Venexian,

please don't mind me asking... You are successfully changing the rows sort order in the listview by applying wrap code to the field that the list is ordered by?

I haven't succeeded in doing so in none of my tests... The date 06.06.2013 would be sorted as it would when not substringed... Taking out the years had no effect on the sort outcome.

Any additional info would be greatly appreciated.

Regards,

Lovre
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
===========================================
Need to renew Pro Support?
Buy Here!
===========================================
Satisfied?
Consider a membership!
===========================================
Like us on Facebook
===========================================

Please Log in or Create an account to join the conversation.

Time to create page: 0.048 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!