Trouble with Macro

steelej's Avatar

steelej

15 Nov, 2012 10:04 PM

If someone could kindly take a look at what I'm trying to do here, I'd really appreciate it. My macro is not executing. I'm pretty confident my x-paths are done correctly. I'm not getting the macro though.

Jim Steele

  1. 1 Posted by Ryan Griffith on 16 Nov, 2012 01:21 PM

    Ryan Griffith's Avatar

    Hi Jim,

    On thing that jumps out initially is that your macro is called listCoop but you are calling it with ListCoop. You'll want to make sure your macro call matches the name of the macro.

    #listCoop($appmath)

    Let me know if this does the trick.

    Please let me know if you have any questions.

    Thanks

  2. 2 Posted by steelej on 16 Nov, 2012 03:50 PM

    steelej's Avatar

    Ryan,
    Thanks. Something simple is better than being way off kilter. The only problem left is with the sort tool. I was unsure if I was doing this the best way when I wrote it. Right now, the line $_SortTool.sort($item) is printing on my page at the top of each entry. Can you take a look?

  3. 3 Posted by Ryan Griffith on 16 Nov, 2012 04:20 PM

    Ryan Griffith's Avatar

    Hi Jim,

    I believe this is because $item is not a list, so your sort is failing. You'll want to move the three sort lines above the foreach and change the object you are applying the sort on:

    $_SortTool.addSortCriterion("start-date", "en", "number", "descending", "upper-first")
    $_SortTool.addSortCriterion("title", "en", "text", "ascending", "upper-first")
    
    $_SortTool.sort($list)
    
    #foreach ($item in $list)
    ...
    #end
    
    ...
    
  4. 4 Posted by steelej on 16 Nov, 2012 04:52 PM

    steelej's Avatar

    Ryan,
    Thanks. I was very dubious about where to place the sort-statement when I wrote this. It's working now.

    Jim

  5. 5 Posted by Ryan Griffith on 16 Nov, 2012 05:38 PM

    Ryan Griffith's Avatar

    Glad to hear you got things working, Jim.

    Have a great day!

  6. Ryan Griffith closed this discussion on 16 Nov, 2012 05:38 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac