Skip to content

<xmod:LoadFeed>

<xmod:LoadFeed> fires an AJAX request when the page loads, fetching an XMP feed and dropping the rendered content into a target HTML element. Use it to populate parts of a page after the rest has rendered (so the user sees the page faster), or to lazy-load expensive content.

For user-triggered loading (a "Load More" button or link), see <xmod:LoadFeedButton>, <xmod:LoadFeedImage>, and <xmod:LoadFeedLink>.

Requires jQuery

The hosting page must include jQuery. Default DNN skins do; verify a custom skin does too.

Place after the target

The tag fires its AJAX call as soon as it renders. If the target HTML element appears later in the page than the <xmod:LoadFeed> tag, the script may run before the target exists. Place the <xmod:LoadFeed> after the target element to be safe.

Example

html
<!-- Top Authors goes here -->
<div id="TopAuthors"></div>

<!-- Top Crime Books goes here -->
<div id="TopCrime"></div>

<!-- Trigger the loads -->
<xmod:LoadFeed FeedName="Top20Authors" Target="#TopAuthors" LoadingImageUrl="~/images/loading.gif" />
<xmod:LoadFeed FeedName="Top20CrimeBooks" Target="#TopCrime">
  <Field Name="GenreId" Value="20" />
</xmod:LoadFeed>

The targeted feeds (defined separately on the Manage Feeds page) need ContentType="text/html" so the result is HTML the page can drop in directly:

html
<xmod:Feed ContentType="text/html">
  <ListDataSource CommandText="SELECT FirstName, LastName FROM Authors WHERE SalesRank <= 20" />
  <HeaderTemplate><table><thead><tr><th>Author</th></tr></thead><tbody></HeaderTemplate>
  <ItemTemplate><tr><td>[[FirstName]] [[LastName]]</td></tr></ItemTemplate>
  <FooterTemplate></tbody></table></FooterTemplate>
</xmod:Feed>

Properties

PropertyValuesDefaultDescription
FeedName *stringName of the feed (as defined on the Manage Feeds page)
Target *jQuery selectorThe element whose content is replaced or appended
InsertModeReplace Append PrependReplaceHow the loaded content is placed into the target
LoadingImageUrlURLImage shown in the target while the feed is loading. Tilde paths supported
LoadingCssClassstringCSS class(es) applied to the loading image
InfinitePagingTrue FalseFalseEnable infinite-scroll plumbing — adds the JavaScript helper used by Load Feed buttons in infinite-paging mode
IDSelectorjQuery selectorWhen InfinitePaging="True", selects the element holding the last record's ID — sent as LastId to the feed

* Required property

Child Tags

TagRequiredDescription
<Field>optionalPass extra parameters to the feed (e.g. filter values). Add as many as needed

<Field>

AttributeValuesDefaultDescription
Name *stringParameter name as expected by the feed's <ListDataSource> parameter
Valuestring | tokenParameter value

Property Details

  • FeedName: The exact feed name from the Manage Feeds page (case-sensitive). The feed should set ContentType="text/html" so that what gets dropped into the page is renderable HTML, not RSS or JSON wrapped in markup.

  • Target: A jQuery selector — typically an #id selector for the placeholder element. The loaded content replaces (or extends) this element's contents.

  • InsertMode: How the loaded content is placed.

    ValueBehavior
    Replace (default)Replaces the target's existing content
    AppendAdds the loaded content at the end of the target
    PrependAdds the loaded content at the start of the target
  • LoadingImageUrl: An image (typically an animated GIF) shown in the target while the AJAX request is in flight. The image is removed when the feed responds. The XMP-managed wrapper image picks up the class xmp-loading-image automatically; any classes you set in LoadingCssClass are added alongside it.

  • InfinitePaging: When True, registers an additional JavaScript helper (xmp_InfinitePaging) that Load Feed buttons can call to fetch the next page using the last record's ID as a cursor. Pair with IDSelector so the helper knows where to find the cursor value, and use a <Field> named to match your feed's pagination parameter.