PartialWidgetPage.Kentico.MVC 12.29.4

Allows you to render another Page's content (including widgets)

Install-Package PartialWidgetPage.Kentico.MVC -Version 12.29.4
dotnet add package PartialWidgetPage.Kentico.MVC --version 12.29.4
<PackageReference Include="PartialWidgetPage.Kentico.MVC" Version="12.29.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PartialWidgetPage.Kentico.MVC --version 12.29.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Partial Widget Page

This tool allows you to render out a Widget (Page Builder) Page as a Partial.

Installation

Install the Nuget Package on the MVC Site

Usage

Setup Partial-Viewable Content

On a Page with Kentico's Page Builder Enabled and an Editable Area existing, set the Layout from

Layout = "~/Views/Shared/_Layout.cshtml";

to

Layout = Html.LayoutIfEditMode("~/Views/Shared/_layout.cshtml");

This will enable the normal view to be resolved as a partial view, depending on the context. When visiting through Kentico, EditMode is enabled and the full layout will render, allowing you to add Widgets.

WARNING: INFINITE LOOPS

Do not use a Layout that renders the page you are editing in itself. This will cause an infinite loop when editing the page. If you editing a page that will be used in the Header and Footer, for example, please make a different Layout view that does not have the PartialWidgetPage Html Helpers.

Allow page to render as normal page AND Partial View

If you wish for a page to render as a full page on Live, but also still want to pull this in as a Partial in certain cases, use the following in the View:

Layout = Html.LayoutIfEditMode("~/Views/Shared/_layout.cshtml", "RenderAsPartial");

and call it using

@Html.PartialWidgetPage("/Route/To/Page", "RenderAsPartial")

(or add RenderAsPartial as the Render as Parital Url Parameter on the Partial Widget Page widget). The system will now pass this Url Parameter in it's Render Partial requests.

Showing Partial Widget Pages

On your other pages, you can either use the
@Html.PartialWidgetPage / @Html.PartialWidgetPageAjax Html Helpers to pull in the content, or use the Partial Widget Page widget in a widget zone.

You can pass either a custom Path, or a NodeAliasPath.

The normal method will perform a client side DownloadString(Url) on the page and return the content, this is done syncly so the content is there upon page load.

The ajax method is also available which will pull in the content through an ajax call client side.

Partial Widget Page

This tool allows you to render out a Widget (Page Builder) Page as a Partial.

Installation

Install the Nuget Package on the MVC Site

Usage

Setup Partial-Viewable Content

On a Page with Kentico's Page Builder Enabled and an Editable Area existing, set the Layout from

Layout = "~/Views/Shared/_Layout.cshtml";

to

Layout = Html.LayoutIfEditMode("~/Views/Shared/_layout.cshtml");

This will enable the normal view to be resolved as a partial view, depending on the context. When visiting through Kentico, EditMode is enabled and the full layout will render, allowing you to add Widgets.

WARNING: INFINITE LOOPS

Do not use a Layout that renders the page you are editing in itself. This will cause an infinite loop when editing the page. If you editing a page that will be used in the Header and Footer, for example, please make a different Layout view that does not have the PartialWidgetPage Html Helpers.

Allow page to render as normal page AND Partial View

If you wish for a page to render as a full page on Live, but also still want to pull this in as a Partial in certain cases, use the following in the View:

Layout = Html.LayoutIfEditMode("~/Views/Shared/_layout.cshtml", "RenderAsPartial");

and call it using

@Html.PartialWidgetPage("/Route/To/Page", "RenderAsPartial")

(or add RenderAsPartial as the Render as Parital Url Parameter on the Partial Widget Page widget). The system will now pass this Url Parameter in it's Render Partial requests.

Showing Partial Widget Pages

On your other pages, you can either use the
@Html.PartialWidgetPage / @Html.PartialWidgetPageAjax Html Helpers to pull in the content, or use the Partial Widget Page widget in a widget zone.

You can pass either a custom Path, or a NodeAliasPath.

The normal method will perform a client side DownloadString(Url) on the page and return the content, this is done syncly so the content is there upon page load.

The ajax method is also available which will pull in the content through an ajax call client side.

Release Notes

Add property to Strip Session Cookie from Client-side call, since requests will (unless specified) create a read/write lock on the Session, thus causing timeouts.  It can be overwritten if desired.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
12.29.4 108 10/10/2019
12.29.3 72 9/20/2019
12.29.2 108 8/9/2019
12.29.1 68 8/8/2019
12.0.0.1 64 7/15/2019
12.0.0 59 7/15/2019