Results 1 to 3 of 3
  1. #1
    Join Date
    January 17th, 2005
    Orange County
    using if condition on form.sort
    Hi David,

    I'm using AE 071104. I'm attempting to add sortable columns for the list results and wanted the column links to change on the sort condition like:

    <a href="{cfg.script.url}{if form.type}type={form.type}/{endif}{if form.mode}mode={form.mode}/{endif}{if form.sort == "+titlerank"}sort=-titlerank{else}sort=+titlerank{endif}">Name</a>

    so if they sorted by product name A-Z first by passing sort=+titlerank, it will then update the column url to have sort=-titlerank so that when they click it again, it will sort descending.

    When I try the above, I get "Unknown if condition: form.sort == "+titlerank"

    I've also tried:
    {if form.sort is +titlerank}
    {if form.sort = +titlerank}

    and tried putting quotes around +titlerank too.

    Any ideas or does not support this value properly in the expression or condition? simply echoing the value seems to work fine using {form.sort} and will properly echo "+titlerank"


  2. #2
    ABW Ambassador cusimano's Avatar
    Join Date
    January 18th, 2005
    Toronto, Canada
    You're thinking of DySE's "if" parser. AE's "if" statement parser is not that sophisticated. AE only handles boolean (0/1) conditions in "if" statements.

    You could set your own variable in the URL (to 0/1) such "sorttitleaz" and check for it, such as:

    {if form.sorttitleaz}&sort=-titlerank&sorttitleaz=0{else}&sort=+titlerank&sorttitleaz=1{endif}

    (actually, you can leave out the &sorttitleaz=0 since undefined variables automatically equate to false; I put it in so that the two URL's are symmetric).

    Yours truly,
    Cusimano.Com Corporation
    per: David Cusimano

  3. #3
    Join Date
    January 17th, 2005
    Orange County
    great idea! Thanks!

  4. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. We have updated our Terms and Condition
    By delsol in forum Google Affiliate Network - GAN
    Replies: 2
    Last Post: November 19th, 2009, 01:09 AM
  2. What does Low Funds Condition mean?
    By johnnyWebAffiliate in forum ShareASale - SAS
    Replies: 3
    Last Post: November 6th, 2006, 07:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts