Working on a new style - small bug, what to do?

I'm currently working on making a CSL/Zotero style for my undergraduate program and I'm surprised how easy it actually is...

I breezed through it so far, but now i'm stumped, and would appreciate a little help.

basically, he're a snippet of my code:

<macro name="bib-support-postcontainer">
<choose>
<if variable="container-title URL" match="all">
<text value="En ligne"/>
</if>
</choose>
</macro>

Basically, I want my style to print a label when it detects that an url has been specified in Zotero. Works wonderfully for books and chapters so far, but i'm testing journal articles now, and even though the specs say that both "container-title" and "URL" are valid variable for that type of support, my if condition never returns true for journal articles.

Thanks for your help!
T.
  • If you can post the full style as a public gist, we'll take a look:

    https://gist.github.com/
  • Sure, take a look!

    git://gist.github.com/756762.git gist-756762

    In susbstance though, I'd really like to know why I can't set conditions against the presence of "URL" and "container-title" for journal articles whereas I can without a hitch when i'm dealing w books - I know there's something I might be missing there, but I don't have a clue what it is.

    Here's hoping to my future enlightenment :)
  • edited December 28, 2010
    Corrected link: https://gist.github.com/756762

    [edit: removed a wrong comment based on feedback from fbennett]
  • @Rintze: It's the other way around, actually ...

    @Takuan: Before we put the style into the test rig, one thought ... will the URL print for you in Zotero? I seem to remember that there is an option in Zotero that will suppress journal URLs under certain conditions. If that is in effect, the URL variable may not be getting passed through to the CSL processor, which would account for the behavior that you see.
  • adding to what Frank says:
    If the option "include URL" in the style tab of the Zotero preferences is not checked,
    <if variable="URL"...> will return FALSE when an item has a page range. Try checking that option that should do the trick - the MLA style has the same issue.
  • I think you're right fbennett and adam, don't really have the time to try right now, but I did go check, and yeah, as a user of other ppl's styles I opted to tick that checkbox off.

    Glad you guys are here, for some reason, I just *knew* it had to be a simple thing like that :D

    T.
Sign In or Register to comment.