Ajax Content Blog
This article covers the methods provided for 'Blog' type Content by the Aurora Ajax Library.
These methods currently provide access to Content Blog features.
Ajax Method Group: Ajax_Frontend_Content_Blog
find
Overview
Permission Required: None
Method Call: /ajax/Ajax_Frontend_Content_Blog/find
Aurora Demo Example: https://demo.auroracommerce.com/example-sub-blog
This method returns a recordset containing any matching Content Items based on a range of conditions.
Method Description
Method specific parameters
Parameter | Values | Default | Description | Required |
---|---|---|---|---|
language_iso | String | Defaults to Aurora Default Language | The Language ISO as configured in the Aurora Back-end under Store > Configure > Languages. | No |
return_format | HTML or JSON | HTML | The format this method should return it's data in. When 'JSON' is selected, the return data is provided in the items return variable as a JSON array of record data. When 'HTML' is selected, the return data is provided in the content return variable as a free-form string (merged from the template selected). | No |
return_template | String | 'blog/list.tpl.html' | The name of the template to be used when merging the response data for return as HTML. This parameter is only used when the return_format is "HTML" and allows you to specify which template should be used to produce the return HTML. | No |
type | String: content | blog | all | blog | This parameter controls what type of page you are searching for. It must be one of: content blog * all | No |
page | Non-negative Integer | 1 | The number of the page of results you would like to have returned. The number of items returned per page defaults to the value specified in the "Posts per page" setting located under Store > Settings > Blog, but can be overridden using the "items_per_page" parameter if desired. | No |
items_per_page | Positive Integer | "Posts per page" setting located under Store > Settings > Blog | The number of content items to return per page. This should be used to retrieve a particular number of items instead of any 'limit' variable. So if you require a list of 50 Content Items, then simply set this to 50 and do not provide a 'page' value (or do provide a 'page' value but set it to 1). | No |
limit | Positive Integer | "Posts per page" setting located under Store > Settings > Blog | The number of content items to return in this request. The limit parameter has been made available for use along side the start parameter only, but it is recommended that the built-in paging (items_per_page and page) combination be used instead, as this is far simpler in nature and provides better support for the automated paging values. | No |
start | Positive Integer | 1 | The number of the content item to start returning in this request. e.g. If 3 is provided, then the 3rd item in the result set will be the first to be returned. The start parameter has been made available for use alongside the limit parameter only, but it is recommended that the built-in paging (items_per_page and page) combination be used instead, as this is far simpler in nature and provides better support for the automated paging values. | No |
search | String | The search term or phrase by which to search the Content items for by title, content and keywords. | No | |
search_field_called | String | The case-insensitive name of the Content Field to search. Aurora Content can be assigned any number of custom Fields in the Aurora Back-end. These fields can be used for filtering by this method. | No | |
search_field_for | String | The case-insensitive value to search for in the field described by the search_field_called parameter. This search will only search for an exact match. This means that it will search for "X" equals "Y", but will not for "X" begins "Y". | No | |
category_id | Positive Integer | The Internal ID Aurora uses to identify a Content Category. | No | |
parent_content_id | Positive Integer | The Internal ID Aurora uses to identify a Content Item (Blog Post/Content Page). This ID is used to find any 'child' content items that are configured to 'belong to' said 'parent' content item. This will only return the very next level of content items (children), e.g. if you have content pages set-up as follows, but provide the Parent ID for "Content 1" then you will only receive "Content 2" and not "Content 3": Content 1 -> Content 2 -> Content 3 To receive "Content 3" you would provide the ID of "Content 2". | No | |
exclude_content_id | Positive Integer | The Internal ID Aurora uses to identify a Content Item (Blog Post/Content Page). This ID is used to avoid returning the Content Item with the specified ID. This is most often useful when returning a list of articles that are 'related' to the current article being viewed, whereby you wish not to include the item already loaded in said results. | No | |
tags | Comma-delimited String | This comma-delimited string of tags will have Aurora return only content that have any one of the provided tags attached to it. Only Blogs currently have tags and so if this is provided for a request for a Content Page and not a Content Blog, then it will be ignored. | No | |
date_start | String | The date and time you would like the result to begin being returned. | No | |
date_end | String | The date and time you would like the result to stop being returned. | No | |
author_id | Integer | The Internal ID Aurora uses to identify a User. | No | |
order_by | date_created or title or views | date_created | The name of the field by which the Content should be ordered when returning the recordset. | No |
order_by_ascending | Boolean | false | If set to 'true', then the content items are returned in Ascending order, otherwise they are return in Descending order. In combination with the default value set for the "order_by" parameter, this method will return content items in descending date order, delivering the most recently created items first by default. | No |
Data Returned
The data returned by this method is delivered as a Json encoded array of values, as described below.
Method specific fields
Variable | Values | Description |
---|---|---|
items | Array ( content_item ) | This is an indexed array of content_item records. For more details regarding the fields available here, please see the content_item variable in the Blog Functions article. If the return_format is set the "HTML", this field will be empty. |
content | String | The merged template content produced as a result of the request data. If the return_format is set the "JSON", this field will be empty. |
Common fields
Variable | Values | Description |
---|---|---|
more_available | Boolean | If there are more Content Items to be returned after the current record set that were not return due to paging or some other limit, then this will be true. Otherwise it is false. This is commonly used for deciding whether or not to show the "Next Page" link when listing Content Items. |
total_items | Non-negative Integer | The total number of Content Items that matched the request made, regardless of any paging or limits in force. This is commonly used for showing how many results there are matching a particular query/search when paging, e.g. "1-20 of 650" where 650 is the value returned within the total_items variable. |
number_of_pages | Non-negative Integer | The total number of pages of results based on the current settings used for the original request. This is most useful when simply using the default value for items_per_page, so that your calling script(s) can generate their paging as needed, without the need to know the specifics about the limits in play. |
Related Aurora Demo Example Files
example.com/blog/single.tpl.html
example.com/_js/blog.js
Updated over 2 years ago