Carma retrieve sections

From TMMwiki
Jump to: navigation, search
CARMA
  Template Functions
CARMA Template Functions
carma_actor_photo_name
carma_comments_display
carma_comments_form
carma_count
carma_favorite
carma_gal_custom
carma_get_extended
carma_list
carma_list_favorites
carma_list_gals
carma_list_third_party_content
carma_list_videos
carma_login_log
carma_most_viewed
carma_newest
carma_news
carma_poll
carma_retrieve_sections
carma_search
carma_actors_search
carma_show_gal
carma_show_video
carma_top_actors
carma_top_rated
carma_upcoming
print_page_numbers
Template Function Aliases
carma_comment_display
carma_display_comment
carma_display_comments
carma_extended
carma_extended_data
carma_get_extended_data
carma_list_all
Common Parameters
assign
assign_prefix
count
data_only
display_on_assign
start
tpl

carma_retrieve_sections

  • Purpose: Retrieve section data for linking.
  • Usage: {carma_retrieve_sections type="child"}
  • Required: none
  • Optional: start, type, assign
  • Templates Used: none

Parameters

(Required parameters in bold)

Parameter Description Possible Values Default Value Example
start Start at this section ID Any valid section I.D. Current section start="123"
type What info to retrieve child, children, same, parent, path (see Notes section below) None. type="child"
order Put the returned sections in this order (Only for child, children, same, parent) active, caption, name name order="active"
assign Name of the Smarty variable that stores the output Any valid Smarty variable name carma_retrieve_sections assign="my_var"
live_content Only display sections with live content 1 None. Displays all sections live_content="1"

Description

This function retrieves the requested sections and stores them into the variable set in assign. The structure of the data retrieved depends on the type setting:

  • current / child / same / parent: simply an array. key secid, value is all the section data.
  • children: 2-dimensional array. First key is the parentid, second key is the actual secid, value is the section data. Value also has a special entry called children which is a 1-dimensional array with all children under this parent, key is secid, value is section data (which will have children too!)

There are 2 logical orders you might want to use: name - ordering by the name of the section, ascending; last_update DESC - ordering by when the section was last updated, descending order.

Notes

The following list describes options for the type parameter:

  • current: retrieves only the current section or the section referenced by the start parameter
  • child: retrieves only the sections below start
  • children: retrieves the sections below start and all the sections below those
  • same: retrieves only sections with the same parent as start
  • parent: retrieves only sections on start's parent level
  • path: retrieves the path from 0 to start