The Item publisher app is a paragraph app which is used to publish items to frontend, whatever those items may be. It is typically used on older designs which does not use the content grid content model to organize and publish content.
When added to a paragraph, you will see a list of app settings which are used to control how the app instance works - these settings are described below.
Data
The Data settings are used to control which items and item fields you want to publish. To use these settings:
- Select an item type to publish
- Select a place to retrieve items from:
- Named item list (deprecated)
- Select items from the current language / area
- Select items from this language / area
- Select items under the current page
- Select items under the following pages
- Select specific items
- Specify which fields you want to include - All or Selected
- If Selected; select the fields to include for the list and details templates
List
The List setttings are used to control how the list of items is rendered - if relevant. To use these settings:
- Select a list template - this is a .cshtml template which controls the content and layout of the list of items you're publishing
- Select an order by value (a field) and a direction an optionally a second order by and direction. You will typically use e.g. the file name or a datetime field like Created date
- Select a list view type:
- Normal - provides you with ordinary paging. Write the number of items you want on a page in the Page Size field.
- Partial - provides you with the option of selecting a partial list of items to show – enter the item to start from in the item from and the item to end with in item to field (Currently not working)
Details
The Details settings are used to control how a list item details page will work. To use these settings:
- Select a details template - this is a .cshtml template which controls contents and look of the details page
- Optionally specify a show on paragraph vallue to select a different paragraph to show the details view on. The selected paragraph needs to also have the item publisher app attached, with the same item type selected.
Filtering
The filtering section is used to set up filter rules which limit the subset of items being published. To create a filter rule:
- Click Add new item to list
- Select a field and operator and a value
- Click OK
You can use values from the context to control which items are published:
| Value | Used for | Example |
|---|---|---|
@Request() |
Get values from the current HTTP request (System.Web.HttpContext.Current.Request) |
|
@Session() |
Get values from the current session (System.Web.HttpContext.Current.Session) |
|
@Page() |
Get values from the current Page object (requires a valid PageID in the query string) |
@Page(MenuText) – Get title of page |
@User() |
Get values from the current User object | @User(Name) – get name of user |
@Code() |
Evaluate C# code | @Code(System.DateTime.Now.AddDays(1)) – get tomorrow’s date |
@Paragraph() |
Get values from the current Paragraph object (requires a valid ParagraphID in the query string) |
|
@ProductID() |
Get values from the current Product object (requires a valid ProductID in the query string) |
Query string parameters
The Item Publisher supports query string filtering.
System Type: String Fields
System type string fields can be filtered using the following operators:
| Example | Filtering effect |
|---|---|
Name=Razor |
Exact match |
Name=t* |
Starts with |
Name=*t* |
Contains |
Name=*t |
Ends with |
System Type: Numeric Fields
System type numeric fields can be filtered using the following operators:
| Example | Filtering effect |
|---|---|
Number=10 |
Equals |
Number=10&Number.op== |
Equals (operator specified) |
Number=10&Number.op==eq |
Equals (operator specified) |
Number=10&Number.op=!= |
Not equal to |
Number=10&Number.op=<> |
Not equal to |
Number=10&Number.op=< |
Less than |
Number=10&Number.op=<= |
Less than or equal to |
Number=10&Number.op=> |
Greater than |
Number=10&Number.op=>= |
Greater than or equal to |
Number.from=10&Number.to=20 |
Range (explicit) |
Number=10-20 |
Range (implicit) |
System Type: Double Fields
System type double fields can be filtered using the following operators:
| Example | Filtering effect |
|---|---|
Double=0&Double.op=lt |
Less than |
Double=0&Double.op=gt |
Greater than |
System Type: Date Fields
System type date fields can be filtered using the following operators:
| Example | Filtering effect |
|---|---|
DateAndTime=2014-08-01 |
Equal |
DateAndTime=2014-08-01&DateAndTime.op=< |
Before |
DateAndTime=2014-08-01&DateAndTime.op=lt |
Before |
DateAndTime=2014-08-01&DateAndTime.op=> |
After |
DateAndTime=2014-08-01&DateAndTime.op=gt |
After |
DateAndTime.from=2014-08-01&DateAndTime.to=2015-08-01 |
Range (explicit) |
Other Useful Parameters
| Parameter | Effect |
|---|---|
PageSize |
Forces a page size. Overrides the page size defined in the Item Publisher settings |
orderby=[field] |
Selects a field to sort by |
orderby2=[field] |
Selects an additional field to sort by |
direction=[ASC/DESC] |
Selects a sort direction |
direction2=[ASC/DESC] |
Selects an additional sort direction |
Overriding App Settings via Query String
You can override (or set) most of the app settings directly from the query string:
ItemTypeIncludeParagraphItemsIncludeAllChildItemsIncludeInheritedItemssourceAreasourcePageSourceItemEntrySourceItemEntriessourceTypeListTemplateDetailsTemplate