Skip to content

General Variables

When any resource is published or updated in Sanity, the getResourcesData() function fetches a set of shared variables that apply to all content types in the dev_Resources_NET index. These variables are used for filtering and display in the Resource Center.

Source file: algolia/custom_actions/types/getResourcesData.js


The following fields are fetched for every resource type:

VariableFetch MethodDescription
typeNameclient.fetch(queryTypeName)Localized display name of the content type
topics_slugfetchTopics()Array of topic slugs for filtering
topics_textfetchTopics()Topic display text (returned alongside slugs)
topics_languagesfetchTopicsLanguages()Localized topic names across all languages
solutions_slugfetchTaxRepeaterSlug()Array of solution taxonomy slugs
industries_slugfetchTaxRepeaterSlug()Array of industry taxonomy slugs
products_slugfetchTaxRepeaterSlug()Array of product taxonomy slugs
technology_slugfetchTaxRepeaterSlug()Array of technology taxonomy slugs
compliance_slugfetchTaxRepeaterSlug()Array of compliance taxonomy slugs
regions_slugfetchTaxRepeaterSlug()Array of region slugs (excludes podcasts and events)
countries_slugfetchTaxonomiesSlug()Array of country slugs
taxonomy_slugfetchTaxRepeaterSlug()Array of event type slugs
main_topicfetchMainTopic()Primary topic reference

algolia/custom_actions/types/getResourcesData.js
const getResourcesData = async () => {
...
// Fetch localized type display name
var queryTypeName = `*[_type == 'post_type_names'][0].${type}`
typeName = await client.fetch(queryTypeName)
// Topics (slugs + display text)
var resulttopics = await fetchTopics(props, client);
topics_slug = resulttopics.topics_slug
let topics_text = resulttopics.topics_text
// Localized topic names
topics_languages = await fetchTopicsLanguages('topics', 'topics', props, client)
// Taxonomy slugs (solutions, industries, products, etc.)
solutions_slug = await fetchTaxRepeaterSlug('solutions', 'solutions_tax', props, client)
industries_slug = await fetchTaxRepeaterSlug('industries', 'industry_tax', props, client)
products_slug = await fetchTaxRepeaterSlug('products', 'products_tax', props, client)
technology_slug = await fetchTaxRepeaterSlug('technology', 'technology_tax', props, client)
compliance_slug = await fetchTaxRepeaterSlug('compliance', 'compliance_tax', props, client)
// Regions (not for podcasts or events — they handle regions differently)
if (type != 'podcasts' && type != 'events') {
regions_slug = await fetchTaxRepeaterSlug('region', 'events_regions_tax', props, client)
}
// Countries and event types
countries_slug = await fetchTaxonomiesSlug('country', 'countries', props, client)
taxonomy_slug = await fetchTaxRepeaterSlug('reference', 'event_types', props, client)
main_topic = await fetchMainTopic('main_topic', 'topics', props, client)
// Events use a different fetch method for taxonomy
if (type == 'events') {
taxonomy_slug = await fetchTaxonomiesSlug('reference', 'event_types', props, client)
}
}

  • Podcasts and Events handle regions_slug separately in their own type-specific logic.
  • Events override the taxonomy_slug with a different fetch method (fetchTaxonomiesSlug instead of fetchTaxRepeaterSlug).
  • Each content type adds type-specific fields on top of these general variables. See the individual content type pages for details.