Cannot get a Sitecore form to display in a placeho

2019-09-13 13:37发布

问题:

I'm busy writing a sitecore solution to manage a news site. I have a NewsArticleLayout (used to display a NewsArticle item), with a NewsArticleMailPlaceholder which I want to use to display a form where a user can enter a name and email address where a news article link must be mailed to.

On the NewsArticleLayout page is already a NewsArticleSublayout with a phNewsArticle placeholder, which is currently correctly displaying data related to a news article.

When I try to link the form to this placeholder, I only seem to be able to link to placeholders in sublayouts, not in layouts, so I created a MailNewsArticleSublayout, and placed a phMailNewsArticle placeholder on it. Then I told the form to display on the NewsArticleLayout, using the MailNewsArticleSublayout, and the phMailNewsArticle placeholder.

However, when I view the page, my form doesn't display. I've done a full publish of my entire Sitecore content tree, nothing seems to fix it.

I've even added a phEmail placeholder to the NewsArticleSublayout, and linked this to the form layout details, but this also doesn't display anything.

Have I correctly setup my form's layout? Is there something I'm missing here?

回答1:

After speaking to sitecore support, I was able to resolve the issue. What I was missing was adding "Form" to the layout details on the standard values for my template. Then in this Form element, fill in the actual Form's location in the "FormID" field. After adding this, it worked perfectly.