Orchard custom forms override Create.cshtml for one content type only - orchardcms

I have created a custom content type ContactForm and I'm using the Custom Forms module.
Is there a way to override the Create.cshtml file only for the ContactForm?
I tried Create-ContactForm.cshtml but it's not working.

If you want alternate view to be displayed follow the steps.
1. Enable Designer tools module.
2. View the page where create.cshtml is displayed.
3. You will see see small minus sign in right bottom corner, click it to enable shape tracing.
4. Trace the shape for which you want alternate view.
5. check shapes tab, there will be multiple alternate options availbale. click on create for appropriate one.
6. find and edit that template in visual studio.
first of all read about alternates and shape tracing.
some reference for you.
http://devhammer.net/blog/Customize-Orchard-CMS-with-Designer-Tools
http://docs.orchardproject.net/Documentation/Alternates

Related

Extending the "Files" menu

I have a process that involves extending the "Files" menu that is located on (most) acumatica pages (next to notes and activities in the top right)
I would like to add two columns to the table that appears in the smartpanel.
I have been looking for the source code/data behind this smart panel and I cant seem to find it, is it tied into SM202520 (search in files)? Can it be extended?
Am I better off just adding a PXAction button to the 3 or 4 pages I want my extended "files" menu to be?
Thanks
There's no DataView bound to that dialog, you can verify that by using inspect element shortcut key CTL+ALT+CLICK on a grid column header:
In order to be customized the grid needs to be bound to a DataView which inspect element reveals it is not. The lack of DataView binding is by design and therefore that dialog can't be customized.
A grid that can be customized will show the View Name property:

How to hide URL Selector content tab?

I am creating a custom webpart using the Url Selector from kentico. I want the user to select content just from the Media Library. I went to form controls -> Url Selector -> Properties -> Dialogs_Content_Hide -> Default Value -> Yes and it still showing it in the Web Part. If I select the Dialogs_Web_Hide, Dialogs_Libraries_Hide and select the yes option in the default values, they hide, all except the Content_Dialogs.
Is this a bug? Or its something wrong?
Here is an example of the tabs
First set the form controls properties back to the way they were. If you don't, it will cause all kinds of problems later on.
Secondly, when you create the property in the webpart in the UI, select the URL selector form control for your text fields control. The scroll down just a bit and under the Editing Control Settings you'll see an "Configure" link. Click it. In there you will be able to tell the form control what tabs you want to enable and disable.
To add to Brenden's answer; if this is something you need to do a lot for your current build, then I'd also suggest making a copy of the Url selector form control and customize the properties as you originally mentioned. This way, you leave the default control in place for the system and have a control tailored to your needs. I've done this just now to check with a new form control that I called Media URL selector. Do make sure that you select the same source file as the original control in the Cloned form control file name property - Kentico by default will try to locate a new file called <original filename>_1.ascx. The reason for this is that admin section of your site also makes use of this control, so you may cause a nasty side effect somewhere else in the system.
As for why the settings had no effect; these are the default values you are setting. If you already have the form control in use, then the default setting would have been applied as they originally were. If you find one of the fields in question, you can change the control type to Text box, click Save, and then reassign it to Media URL selector.

Drupal 8 Twig Template - Show menu if node has a menu item

I am creating custom twig templates for a Drupal 8 theme. I want to render a menu in a region only if the node has a menu link (i.e. when editing the node the menu settings on the right has been configured so the “provide a menu link” box has been checked).
Ideally I would like to create this in the twig template so I can change the layout accordingly, but any pointers greatly appreciated!
Usually this issue is handled differently(by creating a separate content type and set visibility) but for the sake of the question I'll give some solutions.
Solution 1: Block Visibility Groups.
If that is not enough.
Solution 2: hook_block_view_alter(or any other hook_ENTITY_TYPE_view_alter) where you can deactivate the access to menu block after you check if condition is met with Drupal::routeMatch() to check what node is displayed.

OrchardCMS - Can't find correct alternative to render widget

I'm trying to add a image carousel to my CMS site and in the process learn about Alternatives.
I've go the following content types
BannerImage (TextField and a MediaPicker field)
ImageGallery (Container)
I've created a bunch of images, added them as 'Containables' to a new ImageGallery and
I then create a widget, put it in BeforeContent and it renders as an ugly list (default rendering)
I have been able to customize the images by using the alternative Content-BannerImage.Summary.cshtml, sweet.. so far so good.
BUT I'm not able to customize the rendering of the ImageGallery at all. The alternative
Content-ImageGallery.Summary.cshtml or .Detail or even Widget-Container.cshtml do not work at all.
The alternative that IS being used is Widget.Wrapper.cshtml which came with the theme I'm using. I'm not able to find the correct alternative so I can prevent the ImageGallery from rendering it's name/title (which it does by default from the Widget.Wrapper.cshtml alternative.
Any help is greatly appreciated and before it's mentioned... I've read http://docs.orchardproject.net/Documentation/Accessing-and-rendering-shapes which is a great doco, but I'm too dumb to figure it out :)
Ta
To create an alternate (not alternative) for a widget, you first have to activate the Widget Alternates module.
Once you have done so, create your widget, and activate the Shape Tracing module. Go to the page where the widget appears, click on the shape tracing button on the bottom right corner to show the shape tracing and select your widget.
You should now see a list of possible alternates for your widget. Select one and click the link to create it. Now you just have to edit it to your taste.
Depending on how the image gallery module you're using is working, the shape that you need to override to render the list of images. It is probably the List shape that you need to change. This article should give you a good starting point: http://weblogs.asp.net/bleroy/archive/2011/03/27/taking-over-list-rendering-in-orchard.aspx

Default content editor in list form doesn't allow image alignment

I need to be able to adjust the alignment of an image in an "Enhanced Rich Text Field" in an announcements list in MOSS 2007. However, the default content editor in the edit form for the list doesn't provide a way to do that. What's the fastest way for me to make sure users can align images? My first thought was to customize the DispForm.aspx and EditForm.aspx pages, but they just have the ListForm web part in the content region and as far as I know, you can't customize the ListForm web part from the designer.
You can't customize the LisForm web part, but you can add a "custom list form" to create a custom edit form. Maybe you haven't seen this article: http://weblogs.asp.net/jan/archive/2006/11/06/Custom-Edit-Forms-for-SharePoint-2007-Lists.aspx
Then you could do some javascript hackery to insert your own button which then calls something similar to existing RTE_InsertImage function to call a pop-up window and do whatever you need (you'll find this function in 12\template\layouts\1033\form.js)
I fail to see (or understand) your issue. I created a new announcements list, created a new item, inserted an image, aligned it to the right, viewed the item and it worked.
Then I proceeded to create a new custom column, choose multiple lines,enhanced rich text field, edited my list item, added an image, centered it, viewed and it was also working.
The only thing I noticed is that the "rich" control does not appears on non-IE browsers.

Resources