Custom Forms Remove Common Part

Topics: Customizing Orchard
Mar 11, 2013 at 6:45 PM
Hi,

I am trying to create a web application in Orchard. I am playing with the Custom Forms module. Is there any way to hide following fields
  1. Permalink
  2. Set as home page
  3. Owner
in custom forms ?

Regards,
Hayri
Coordinator
Mar 11, 2013 at 7:37 PM
Mar 11, 2013 at 8:11 PM
Hi Bertrand,

In this case I have to deal whith placement.info file for each of the contents. Is there any way to remove it permanently/optional in Custom Forms module driver ?

Regards,
Hayri



From: [email removed]
To: [email removed]
Date: Mon, 11 Mar 2013 11:37:25 -0700
Subject: Re: Custom Forms Remove Common Part [orchard:436188]

From: BertrandLeRoy
Read the full discussion online.
To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)
To start a new discussion for this project, email orchard@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com
Developer
Mar 11, 2013 at 8:27 PM
Do you mean you want to remove those fields from the editor? If so, then you will have to remove the content parts whose drivers are responsible for emitting those editor shapes. For example, to remove the Permalink and Set as homepage fields, remove the AutoroutePart.
Mar 11, 2013 at 8:32 PM
Hi Bertrand,

I tried to remove this section in ItemController.cs

if (!contentItem.Has<ICommonPart>())
{
throw new OrchardException(T("The content type must have CommonPart attached"));
}

It did not work. What I am trying to do is to hide "permalink" and "set as home page" fields in the front-end.

What would be the best practice if I want to build an application in Orchard?

Regards,
Hayri



From: [email removed]
To: [email removed]
Subject: RE: Custom Forms Remove Common Part [orchard:436188]
Date: Mon, 11 Mar 2013 21:11:32 +0200

From: BertrandLeRoy
Read the full discussion online.
To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)
To start a new discussion for this project, email orchard@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com
Mar 11, 2013 at 8:45 PM
Hi Sipke,

What I am trying to do is to create a custom web application in Orchard by using Orchard infrastructure. What would be the best practice?

I don't want to dump controllers and views directly to the my orchard module. Is there any way to create entry forms and display in the front-page rather than admin page?

Regards,
Hayri




From: [email removed]
To: [email removed]
Subject: RE: Custom Forms Remove Common Part [orchard:436188]
Date: Mon, 11 Mar 2013 21:32:30 +0200

From: BertrandLeRoy
Read the full discussion online.
To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)
To start a new discussion for this project, email orchard@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com
Coordinator
Mar 11, 2013 at 8:46 PM
Edited Mar 11, 2013 at 8:48 PM
What do you mean "I have to deal whith placement.info file for each of the contents"?

"Is there any way to create entry forms and display in the front-page rather than admin page?"

That's exactly what custom forms are doing, so now I'm really confused.
Mar 11, 2013 at 8:55 PM
Hi Bertrand,

I have created my content-type and content part. (Just a basic contact application), then I used Custom-Forms module to display it in the front-end. I was able to remove "owner" field, but "permalink" and "set as home page". Imagine you have hundreds of content types. Each time you have to go placement.info file and hide the "common-part" there manually. Is there any easy approach to build an application in Orchard by using its infrastructure?

Regards,
Hayri



From: [email removed]
To: [email removed]
Date: Mon, 11 Mar 2013 12:46:25 -0700
Subject: Re: Custom Forms Remove Common Part [orchard:436188]

From: BertrandLeRoy
What do you mean "I have to deal whith placement.info file for each of the contents"?
Read the full discussion online.
To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)
To start a new discussion for this project, email orchard@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com
Coordinator
Mar 11, 2013 at 9:14 PM
You have hundreds of content types? Why?
Mar 11, 2013 at 9:18 PM
Hi Bertrand,

Because the application will have accounting, manufacturing, finance, marketing, dashboards.. modules.

Regards,
Hayri



From: [email removed]
To: [email removed]
Date: Mon, 11 Mar 2013 13:14:45 -0700
Subject: Re: Custom Forms Remove Common Part [orchard:436188]

From: BertrandLeRoy
You have hundreds of content types? Why?
Read the full discussion online.
To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)
To start a new discussion for this project, email orchard@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com
Coordinator
Mar 11, 2013 at 9:23 PM
I don't see how that justifies hundreds of content types.
Mar 11, 2013 at 9:26 PM
Hi Bertrand,

So what would be the best practice to build an application in the orchard?

Regards,
Hayri



From: [email removed]
To: [email removed]
Date: Mon, 11 Mar 2013 13:23:38 -0700
Subject: Re: Custom Forms Remove Common Part [orchard:436188]

From: BertrandLeRoy
I don't see how that justifies hundreds of content types.
Read the full discussion online.
To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)
To start a new discussion for this project, email orchard@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com
Coordinator
Mar 11, 2013 at 9:32 PM
That's an overly broad question that's impossible to answer. Not having hundreds of content types would apply to any application however.
Mar 12, 2013 at 12:19 AM
Hi Bertrand,

Ok let me make this more clear. Imagine you have a custom module with "Person" content type and "Address" content part

[PERSON]
FirstName
LastName


[ADDRESS]
AddressLine1
City
ZipCode

I want an application in the front-page publicly available for all authenticated users with following left side menu attached. (Without "Permalink" and "Set as home page" fields).

New Person
Edit Person
Delete Person

I don't want users to use admin menu because this is going to be a web application.

Regards,
Hayri






From: [email removed]
To: [email removed]
Date: Mon, 11 Mar 2013 13:32:45 -0700
Subject: Re: Custom Forms Remove Common Part [orchard:436188]

From: BertrandLeRoy
That's an overly broad question that's impossible to answer. Not having hundreds of content types would apply to any application however.
Read the full discussion online.
To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)
To start a new discussion for this project, email orchard@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com
Coordinator
Mar 12, 2013 at 2:29 AM
OK, so why don't you want to use placement in that case?
Mar 12, 2013 at 4:01 PM
Hi Bertrand,

Ok got it, but still having difficulties to hide. Following entry is not hiding. Also, as far as i checked forums, will following entry hide "Title Part" ?

<Match ContentType="MyContentType">
<Place Parts_Routable_Edit="-" />
</Match>

Regards,
Hayri



From: [email removed]
To: [email removed]
Date: Mon, 11 Mar 2013 18:29:55 -0700
Subject: Re: Custom Forms Remove Common Part [orchard:436188]

From: BertrandLeRoy
OK, so why don't you want to use placement in that case?
Read the full discussion online.
To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)
To start a new discussion for this project, email orchard@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com
Coordinator
Mar 13, 2013 at 12:06 AM
mmh, I'm confused. If you want to hide the title part, you need to use the shape name that the title part's driver create, i.e. Parts_Title
Coordinator
Mar 13, 2013 at 12:06 AM
mmh, I'm confused. If you want to hide the title part, you need to use the shape name that the title part's driver create, i.e. Parts_Title
Mar 13, 2013 at 2:21 PM
Hi Bertrand,

I am just trying to hide "Permalink" and "Set as home page" fields in the editor.

Regards,
Hayri



From: [email removed]
To: [email removed]
Date: Tue, 12 Mar 2013 16:06:55 -0700
Subject: Re: Custom Forms Remove Common Part [orchard:436188]

From: BertrandLeRoy
mmh, I'm confused. If you want to hide the title part, you need to use the shape name that the title part's driver create, i.e. Parts_Title
Read the full discussion online.
To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)
To start a new discussion for this project, email orchard@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com
Coordinator
Mar 14, 2013 at 5:15 AM
That is actually easy to do from the admin:
  • Edit your content type, expand the Autoroute settings, and uncheck "allow custom patterns".
  • Go to the role editor (under "users") and remove the "Set Home Page" permission from the relevant roles.
Mar 14, 2013 at 3:11 PM
Hi Bertrand,

It did not work, but Sipke solved my problem. Here are the steps he suggested:

1. Set "Orchard.Autoroute" module as a dependency in your module like below:

Name: MyModule
AntiForgery: enabled
Author: H.Calboru
Website: http://orchardproject.net
Version: 1.0
OrchardVersion: 1.4
Description: Description for the module
Dependencies: Orchard.Autoroute
Features:
MyModule:
Description: Description for feature MyModule.

2. Remove autoroute wrapper by adding it to placement.info file like below:

<Placement>
<Match ContentType="BusinessEntity">
<Place Parts_Autoroute_Edit="-" />
</Match>
</Placement>


---- God bless Sipke ----


From: [email removed]
To: [email removed]
Date: Wed, 13 Mar 2013 21:15:22 -0700
Subject: Re: Custom Forms Remove Common Part [orchard:436188]

From: BertrandLeRoy
That is actually easy to do from the admin:
  • Edit your content type, expand the Autoroute settings, and uncheck "allow custom patterns".
  • Go to the role editor (under "users") and remove the "Set Home Page" permission from the relevant roles.
Read the full discussion online.
To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)
To start a new discussion for this project, email orchard@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com
Coordinator
Mar 14, 2013 at 5:21 PM
It did not work? Then you should file a bug. How did it not work?
Mar 14, 2013 at 5:44 PM
Hi Bertrand,

Ok I will file a bug.

Regards,
Hayri



From: [email removed]
To: [email removed]
Date: Thu, 14 Mar 2013 09:21:22 -0700
Subject: Re: Custom Forms Remove Common Part [orchard:436188]

From: BertrandLeRoy
It did not work? Then you should file a bug. How did it not work?
Read the full discussion online.
To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)
To start a new discussion for this project, email orchard@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com