CalRecycle News Room Listing Documentation

CalRecycle displays departmental press releases and links to relevant news entries from various media outlets on its public webpages. Examples of this content can be found on the CalRecycle website and the DORIIS home page. This content is managed using the CalRecycle NewsRoom application. Use the documentation below to display News Entries and/or Press Releases from NewsRoom on your webpage.

Please contact the CalRecycle Webmaster if you have any questions.

 

News Entries

Instructions

The following parameters can be added to the querystring of the base URL to customize the News Entries output.

Base URL: https://www2.calrecycle.ca.gov/NewsRoom/Listing/NewsEntry

displayCount (integer)
Default: All News Entries
The number of News Entries to display.

displayWithBullets (boolean)
Default: true
Display the New Entries in a bulleted list.

displayMediaOutlet (boolean)
Default: true
Display the name of the Media Outlet that published the News Entry.

displayPublishedDate (boolean)
Default: true
Display the date the News Entry was published by the Media Outlet.

openLinkInNewWindow (boolean)
Default: false
Open the News Entry in a new window when selecting the link.

dateDisplayType (boolean)
Default: LongDate
Format of the published date using one of the options listed below.
  • LongDate (e.g. January 1, 2017)
  • ShortDate (e.g. 1/1/2017)
  • LongDateAbbreviatedMonth (e.g. Jan 1, 2017)

Note: Any combination of parameters can be added to the querystring to achieve the desired results.

Example URLs

Code

Note: Do not copy the code below from Microsoft Edge

To ensure jQuery is accessible on your page, add the following script to the <head> section of your page:

<script src="https://code.jquery.com/jquery-3.1.1.js" integrity="sha256-16cdPddA6VdVInumRGo6IbivbERE8p7CQR3HzTBuELA=" crossorigin="anonymous"></script>

Add the following <span> tag and javascript on your page where you want the News Entries displayed:

<span id="NewsEntryListing"></span>

<script language="javascript"  type="text/javascript">
    $(function  ()  {
        $.ajax({
            url:  "https://www2.calrecycle.ca.gov/NewsRoom/Listing/NewsEntry",
            dataType:  "html",
            cache:  false,
            method:  "GET"
        }).done(function  (html)  {
            $("#NewsEntryListing").html(html);
        });
    })
</script>

Data Preview

 

Press Releases

Instructions

The following parameters can be added to the querystring of the base URL to customize the Press Releases output.

Base URL: https://www2.calrecycle.ca.gov/NewsRoom/Listing/PressRelease

displayCount (integer)
Default: All Press Releases
The number of Press Releases to display.

displayWithBullets (boolean)
Default: true
Display the Press Releases in a bulleted list.

category (string)
Default: All categories
The list will be filtered on one of the categorites listed below.
  • BeverageContainerFraud
displayPublishedDate (boolean)
Default: true
Display the date the Press Release was published.

dateDisplayType (boolean)
Default: LongDate
Format of the published date using one of the options listed below.
  • LongDate (e.g. January 1, 2017)
  • ShortDate (e.g. 1/1/2017)
  • LongDateAbbreviatedMonth (e.g. Jan 1, 2017)
displayOrder (string)
Default: Desc
Option to display the press releases in order of ascending (Asc) or descending (Desc) published dates.
  • Asc
  • Desc
displayDatePosition (string)
Default: After
Option to display the published date before or after the press release title.
  • Before
  • After
titleCharacterCount (integer)
Default: null (No truncation - entire title)
Option to truncate the title to a certain number of characters.

openLinkInNewWindow (boolean)
Default: false
Open the Press Release in a new window when selecting the link.

Note: Any combination of parameters can be added to the querystring to achieve the desired results.

Example URLs

Code

Note: Do not copy the code below from Microsoft Edge

To ensure jQuery is accessible on your page, add the following script to the <head> section of your page:

<script src="https://code.jquery.com/jquery-3.1.1.js" integrity="sha256-16cdPddA6VdVInumRGo6IbivbERE8p7CQR3HzTBuELA=" crossorigin="anonymous"></script>

Add the following <span> tag and javascript on your page where you want the Press Releases displayed:

<span id="PressReleaseListing"></span>

<script language="javascript"  type="text/javascript">
    $(function  ()  {
        $.ajax({
            url:  "https://www2.calrecycle.ca.gov/NewsRoom/Listing/PressRelease",
            dataType:  "html",
            cache:  false,
            method:  "GET"
        }).done(function  (html)  {
            $("#PressReleaseListing").html(html);
        });
    })
</script>

Data Preview