Question

I am creating a custom newsletter subscription module in Orchard CMS v1.6.1

I am at the stage of trying to display the front-end view in a specific zone.

so far all i can see to do is get the placement to move the module to various locations within the Content zone.

Perhaps someone can help point me in the right direction.

The placement.info file in my theme now has this, to override whatever I have in my module:

    <Match DisplayType="Detail">
        <Place Parts_SubscribersForm="Content:1"/>
    </Match>

I have also tried with "Footer:1" and also, for the sake of testing, tried "Header:1" - none of these seem to place it where i want it.

My shape tracing is as below - "DisplayTemplate" is the shape of this soon-to-be control - i also can't seem to change this name...another question.....

My shape-tracing showing DisplayTemplate (my custom module)

Ultimately I want to move this module to the Zone [Footer]

Footer is being added in the layout.cshtml that came with the standard theme (i duplicated this for my own theme)

Here is where the footer and header are added:

    WorkContext.Layout.Header.Add(New.Branding(), "5"); // Site name and link to the home page
    WorkContext.Layout.Footer.Add(New.FooterContent(), "5"); // Footer Content
    WorkContext.Layout.Footer.Add(New.User(), "10"); // Login and dashboard links

I would be grateful if someone could help me out...

Thanks in advance.

Was it helpful?

Solution

There are two types of zones when placing shapes in Orchard - Layout Zones (defined in the Layout.cshtml) and Local Zones (Content item local zones such as Header, Meta, Content, Footer defined by Content.cshtml). The local zones are all rendered within the main Layout's 'Content' zone. The following placement would push your shape to the Footer local zone:

<Match DisplayType="Detail">
    <Place Parts_SubscribersForm="Footer:1"/>
</Match>

That is why your form did not seem to move into the footer as you expected. It was in the local Footer zone, but still rendered within the layout's Content zone. Instead you can move your shape to e.g. the Footer Layout Zone by placing a forward slash:

<Match DisplayType="Detail">
    <Place Parts_SubscribersForm="/Footer:1"/>
</Match>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top