# fallback logic

**URL:** <https://discourse.citationstyles.org/t/fallback-logic/240>\
**Category:** CSL Development\
**Created:** [November 4, 2006, 7:31pm UTC](https://discourse.citationstyles.org/t/fallback-logic/240 "2006-11-04T19:31:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [November 4, 2006, 7:31pm UTC](https://discourse.citationstyles.org/t/fallback-logic/240/1 "2006-11-04T19:31:44Z")

</div>

I see Dan Stillman joined the list, so may as well move this here  
(rather than the Zotero forums):

A user noted that Zotero doesn’t format web pages\*. I assume this is  
because it’s not properly handling the type and fallback logic, so  
might be worth discussing here.

CSL works on the following ideas:

```
- templates for article, book and chapter are required; these serve  

```

as fallback types, such that:

```
	* processor looks at record and assigns it a type
	* if there is a CSL template that matches the assigned type, then  

```

use that  
\* if not, then use the type that corresponds to the record’s  
generic class

Classes are:

```
1. monograph (book)
2. part-inMonograph (chapter)
3. part-inSerial (article)

```

The issue, then, is the logic to map to these classes and fallback  
types.

The way I have been doing it is to look for characteristics of the  
source. So, for example, in psuedo code:

```
if b:isPartOf then:
	if b:volume = false() then "chapter"; else "article"
else "book"

```

This has the downside of being a little tricky to get the right  
generic rules that correctly directs pretty much any source, but the  
advantage is that it is really robust (because any record gets a  
template that will get pretty close to correct formatting, if the  
style author designed them with this in mind). The processor then  
takes the web page and uses the “article” type to format it.

Bruce

- [http://forums.zotero.org/discussion/129/serious-bibliography-issue](http://forums.zotero.org/discussion/129/serious-bibliography-issue)
