Hossein Panahloo
Hossein Panahloo

Reputation: 520

Target a specific Widget with Placement.info in Orchard

I use Orchard CMS 1.10.1. In a Page I have lets say four Html widget, I want to place one of these Html Widgets in a local zone.

I used Shape Tracing Tool to get the name of the shape of this specific Html widget But all of these four Widgets have Same the name in Shape Tracing Tool.

So how can I target only one of them?

Upvotes: 2

Views: 206

Answers (2)

mdameer
mdameer

Reputation: 1540

Firstly, you should add new zone to Theme.txt:

Zones: MyCustomZone, .., .., ..

then after adding your widget to this zone through Orchard dashboard, you can display this zone MyCustomZone, anywhere you want in your system, just using the following line:

@Display(WorkContext.Layout.MyCustomZone)

Note: you don't need to render it in your layout if this is not necessary.

Upvotes: 6

urbanit
urbanit

Reputation: 473

Enable "Widget Alternates" module and alternates with widget name will appear.

Upvotes: 0

Related Questions