I have tried to customize the APA csl file to fit my institute's style sheet. However, I am having a hard time to understand why my macro for accessed date is not working properly for DOI (but it does work for URL). The DOI itself will be printed, but not with access date.
The MWE for my access macro:
<macro name="access">
<choose>
<if variable="DOI" match="any">
<text variable="DOI" prefix="https://doi.org/"/>
</if>
<else-if variable="URL">
<text variable="URL" suffix=" "/>
<group delimiter=" " prefix="(" suffix=")">
<text term="retrieved" suffix=":"/>
<date variable="accessed" form="numeric"/>
</group>
</else-if>
</choose>
</macro>
The full file can be found here: https://github.com/yin-ori/open-research/blob/main/ioa-template.csl
Already answered over at Zotero, but again here for completeness's sake: There are actually two reasons the access date isn't appearing for DOIs:
https://doi.org/prefix, and only when you don't have a DOI you're printing. Instead, you'll want something like:nullfor articles with a page range unless you check the "Include URL" box in the Cite tab of the Zotero preferences. With that box checked, you should get the access date with the above code (which, frankly, is a bit of a silly requirement for DOIs, which are meant to be stable).Finally, and unrelated to the access date, you also want to make sure to change the style ID, otherwise your style will get overwritten by the standard APA style regularly.