#cb#
cb
object contains a variety of common methods for retrieving ContentBox content and settings. Below are some common methods used to retrieve and create HTML content:cb.siteName()
: retrieves the configured name of Contentbox installationcb.siteTagline()
: retrieves the configured tagline for the ContentBox installationcb.siteDescription()
: retrieves the configured description for the Contentbox installationcb.siteKeywords()
: retrieves the configured global keywordscb.siteEmail()
: retrieves the default site emailcb.siteOutgoingEmail()
: retreives the configured email used in outbound deliveriescb.quickView( viewTemplate )
: Renders a view partial located in the [theme home]/views
directory. A .cfm
file extension is not required.cb.mainView( args )
: Renders the main view for the handler action. A struct containing the args necessary for view rendering should be passed in. By default, this struct is available in your layout and is also named args
.cb.getCurrentEntries()
:cb.getCurrentEntriesCount()
:cb.getCurrentCategories()
:cb.getCurrentPage()
:cb.getCurrentComments()
: Returns the published comments for the current entrycb.getCurrentCommentsCount()
: Returns the count of published comments for the current entrycb.getCurrentRelatedContent()
: Returns an array of content related to the active post or entrycb.getCurrentCustomFields()
: Returns a structure of custom fields for the active post or entrycb.getCustomField( string fieldName, any defaultValue )
: Returns the value of a custom field for the active post or entrycb.widget( string widgetName, struct args )
: executes a named widget's renderit
method and returns the HTML. A structure of arguments may be passed.cb.getWidget( string widgetName )
: retreives the associated [widget][2] objectcb.themeSetting( string settingName, any defaultValue )
: retrieves a theme setting by name. A default value may be specifiedcb.isCommentsEnabled()
: returns a true|false value of whether site comments are enabled and if the current entry accepts commentscb.quickSearchForm()
: returns the HTML of a standard ContentBox Search Form according to the SearchForm widgetcb.getSearchResults()
: returns an array of results for an active searchcb.linkAdmin()
: creates a link to the ContentBox admincb.linkAdminLogin()
: creates a link to the ContentBox administration login formcb.linkAdminLogout()
: creates a link to logout of ContentBox administrationcb.linkBlog()
: creates a link to the site's blogcb.linksSelf()
: creates a link to the current pagecb.linkPageRSS( any categoryFilter)
: creates a link to the RSS feed applicable to the active requestcb.linkSiteRSS( any categoryFilter )
: creates a link to the site's RSS feedcb.linkCategory( string categorySlug )
: creates a link to a specific category pagecb.quickCategoryLinks( string categorySlug )
: creates an HTML unordered list of category linkscb.themeRoot()
: returns the location of your currently defined theme in the application, great for assets, cfincludes, etccb.siteRoot()
: returns the site root location using your configured module's entry pointcb.siteBaseURL()
: returns the site's SES base URLcb.adminRoot()
: returns the root location of the admin using your configured module's entry pointwidgetRoot()
: returns the location of your widgets, great for assets and includescb.event()
method. For examples of how these are used, see the default theme layout files. Examples include:cb.event( "cbui_beforeHeadEnd" )
cb.event( "cbui_afterBodyStart" )
cb.event( "cbui_afterContent" )
cb.event( "cbui_beforeBodyEnd" )
cb.themeName()
: returns the currently active theme namecb.layoutName()
: returns the currently active layout name cb.isPrintFormat()
: returns true if you are in printing or exporting formatcb.renderCaptcha()
method.