Branches API

Last edited: 5/16/2011

Also see the branches overview article.

Display mode: list

Show

before_show, after_show

Here are the tags available to show_before in the branch list:

TagDescription
__records__
The number of records returned
__searchterm__ If search parameter was used, the term is returned
__googlemap__ See the church howto for more info on this
__pagination__ Splits up the content into smaller chunks
show

Here are the tags available to show in branch list:

TagDescription
__name__ outputs the branch title
__slug__ the URL safe version of the title (more info)
__website__ The website entered for the branch
__email__
__phone__  
__fax__
__description__

__categories__ A comma separated list of all categories for this branch
__categoryslugs__ A comma separated list of all category slugs for this branch
__imageurl__
__location__ The backend title of the location
__locationslug__
__postal__
__address__  
__street__
__street2__
__city__
__state__
__stateAB__  
__zip__

__country__  
__googlemap__ See the church howto for more info on this
__count__ The number the current record is in the list
__group__ The names of groups assigned to the church
Any Custom Fields setup for Branches will output their API tags
group_show
TagDescription
__title__ the title of whatever we are grouping by
__slug__ will be the city's zip code if grouping by city

Parameters

 

find_category

Only show items assigned to that category. Can find multiple categories with a comma separated list. If category slugs are separated by , or || any item assigned to ANY specified category is returned. If && is used to separate only items assigned to ALL specified categories will be returned.

Example:

"find_category:category1,category2,category3",

"find_category:category1 && category2 && category3",

hide_category

Will not show items assigned to that category.

Example:

"hide_category:category-slug,category-slug2",

find_group

Only show items assigned to that group. Can find multiple groups with a comma separated list. Uses group slugs.

Example:

"find_group:group-slug1,group-slug2,group-slug3",

search_branch

Finds a list of branches whose name or description contains the search term.

Example:

"search_branch:search term",

search_name

Searches only the title field. Can be combined with search_description.

Example:

"search_name:pizza",

search_description

Searches only the description field. Can be combined with search_name.

Example:

"search_description:pizza",

search_location

Finds a list of branches in a given zip code or country,state,city string. If city can't be found, a list of branches in the specified state are returned.

Example:

"search_location:98765",

Example:

"search_location:US|WA|Seattle",

radius

To be used with search_location. Sets the number of miles to search from the center of the specified city or zip code.

Example:

"radius:50",

search_state

Find a list of branches in a given state. Accepts either the full name of the state or an abbreviation.

Example:

"search_state:WA",

search_country

Find a list of branches in a given country.

Example:

"country_state:CA",

find_location

Find all locations with a given name.

Example:

"find_location:joes-garage",

groupby

Sets a criteria to group the list by. Grouping by website will only return churches which have entered a web site.

Available grouping criteria:

  • group
  • state
  • country
  • city
  • website

Example:

"groupby:state",

 

nocache

Prevents the output from being cached. Caching increases the speed of getContents considerably so this tag is not reccomended except for testing purposes, places where the output is random, events lists where the output is time sensitive, or context sensitve getContents. nocache does not apply to monklets.

example:

"nocache",

noecho

getConents default to 'print' the output. With noecho, you can assign the contents to a variable to be printed later. This is helpful if you have repeated content on a page.

example:

"noecho",

emailencode 

 By default email addresses in content areas are encoded with javascript. emailencode can disable this for all content areas in a getContent.

example:

"emailencode:no",

 

Display mode: detail

Show

show

The same tags are available for display:detail as with display:list

Parameters

find

Will accept the slug of a branch.

Example:

"find:branch-slug",

Display mode: categories

Show

level#
TagDescription
__bid__ Internal system ID of the category for unique identification.
__count__ Numerical count of the articles belonging directly to the category.
__level__ Hierarchical level of the category. The root level is considered level 1.
__name__ Name of the category as entered in the backend.
__parentid__ Internal system ID of the category's parent. This is set to '0' if the category has no parent.
__slug__ Slugged version of the category name.

Parameters

parent_category

Specifies the parent category slug to use as the hierarchical root to start from.

Example:

"parent_category:slugged-category-name",

Full Example

getContent(
   "MODULETYPE",
   "display:categories",
   "level1:Parent: __name__ (__count__) ",
   "level2:Child: __name__",
   "level3:Grandchild: __name__",
);