Can't get Metatags on Custom Forms, part display driver not working

Topics: Troubleshooting, Writing modules
Sep 11, 2013 at 12:03 PM
  1. I've attached meta part to custom forms which normally adds meta tags on pages and other content types (based on Vandelay Metatags),
  2. Created new type for "Contact Form" with couple of fields.
  3. Added a new custom form with type "Contact Form" and filled in meta contents
  4. Meta tags save properly into database, but don't display at all on contact form like as if display driver for Meta part isn't called. Both IPageTitleBuilder and IResourceManager do nothing.
I managed to workaround this by creating blank page and adding custom form as a widget and set metas on page itself. But that is extra wrapper I'd like to avoid. Any idea or example how to add meta tags directly on custom forms? Thanks.
Coordinator
Sep 11, 2013 at 7:28 PM
Do you have an override of document.cshtml?
Sep 11, 2013 at 7:53 PM
I do, but if i remove it or even change to default "The Theme Machine" it makes no difference. Running on Orchard 1.7 ...
Sep 11, 2013 at 8:11 PM
Its very easy to reproduce
  1. Install 1.7 orchard with default recipe
  2. Enable Custom Forms
  3. Install Vandelay Industries - Version: 1.7 and enable Vandelay Meta
  4. Add meta part to custom forms type
  5. Go to Forms > Add a new custom form and type something into meta fields
  6. Publish the form and view it
    ... No meta is being added.
Coordinator
Sep 11, 2013 at 9:21 PM
Please file a bug against Vandelay then.
Sep 11, 2013 at 11:26 PM
I don't think problem is in Vandelay itself. I'm not using it just used it as reference because it does essentially same thing and doesn't work either. My module also modifies title using IPageTitleBuilder in Display Driver of the content part and can't get it to work either, works on every other content type just not the custom forms. I suspect problem in Custom Forms itself. But sure I can file a bug there.
Developer
Sep 14, 2013 at 1:04 PM
When a custom form is displayed in reality the editor of the item is built. This means that if a part id Display()-ing something it won't be run since it's not the display that's shown but the editor.
Sep 15, 2013 at 1:58 PM
Yeah, but it's editor for a different content type say "Survey Form", I'm not attaching part with display to that ... I'm attaching it to the wrapper "Custom Forms", Custom Forms should act as other content types, have their own display so i can attach existing parts with display and they will display it no matter what kind of content type editor they are rendering.. It looks like door for extending custom forms display is closed. Say I want to attach comments to my forms, I can set options for it when creating a form, but it won't display when viewing the form. It looks like a bug.
Developer
Sep 15, 2013 at 7:20 PM
Ah I see. This looks like an issue with the part because the Custom Form items are built exactly the same way as other items normally, like pages.