{bb_doc} Print

  • Modules
  • 0

Use {bb_doc} to create XML Feed Templates or templates for other markup languages. This tag tells BlueberryCMS not to render any HTML declarations, DOCTYPES, or automatically inserted HEAD sections. This allows for users to render more than just HTML documents, such as XML instead. You can also build dynamic XML feeds that are driven off of Data Collections and Blog Posts.

This module DOES NOT support Liquid.

Syntax

{bb_doc}

Example using a Data Collection:

  1. First create a Page Template and name it "XML Feed Page".

    {bb_doc}
    <?xml version="1.0" encoding="UTF-8"?>
    <news>
    {bb_webpagecontent}
    </news>

  2. Next step is to create a Web Page for your feed with the appropriate Data Collections tag. Use the layout="XML Feed" attribute to specify the name of a Custom List View Layout which you will create after this step. Assign the "XML Feed Page" Page Template from Step 1 to this new Web Page.

    <!-- This is just a basic web page with nothing except a call to a data collection. -->
    {bb_datacollection source="My Data Collection" layout="XML Feed"}

  3. Now edit your Data Collection and access the Layouts tab to create a Custom List View Layout. Give it a name like XML Feed and be sure it matched the value used in the layout="" attribute above. In the contents of your new list view layout, feel free to add field name tags to your liking.

    <!-- Begin Data Collection Items Loop -->
    <post>
    <title>{{dataNameNoLink}}</title>
    <publishdate>{{PublishDate}}</publishdate>
    <content>{{Content}}</content>
    </post>

  4. The final rendered XML page will appear as such:

    XML rendered code

Parameters

None.

Areas Available

The {bb_doc} module tag can be placed within these areas.

  • Page Templates

Liquid Tags

None.


Was this answer helpful?

« Back

Powered by WHMCompleteSolution