I'm trying to develop my first module in Orchard and stuck with the following problem.
I have Box content type that contain Books. What I want to achieve is to allow user to add books from box edit screen in admin. The process is the following:
User selects a Box in admin and click edit.
In edit screen a list of books is displayed with buttons "Edit", "Delete" and "Add Book"
The user clicks "Add Book" button and add book screen appears.
The user enters required metadata and clicks "Save"
The user is redirected back to Box edit screen with new book added to the list.
I'm looking for advise on what is the best way to implement this.
There are several ways to do that, most of which don't require building a module.
You could use the updated list feature in the new Orchard 1.8. That does pretty much exactly what you describe.
You could use taxonomies, where the boxes are terms (terms have their own content type that you can extend). The workflow is kinda backwards with this, where you put books in boxes rather than picking from the box which books belong.
You could use a content picker field configured for multiple items, and constrained to the book content type.
You could build your own module, with a relationship between your types, as explained here: http://docs.orchardproject.net/Documentation/Creating-1-n-and-n-n-relations but except if this is a pure learning experience, there's little reason to go for that one, as the other three above are so much simpler, and don't require any coding.
Related
Need a tip for design. Now we have a one search field, with 2 actions - where you can search for a role or a user
If you search for a user you can copy his (role) assignments OR
If you search for a role you can add the selected role.
Generally, UI looks now like this:
Copy user's assignments
Add role
How can this UI be simplified for the user?
I think you should add a menu to the Appbar, similar to the Menus section of the Material Design standard for Layout Structure:
The images above are pulled from the standard, but could be used in your case.
Ditch the radio buttons and present the current search context with its default placeholder text in the search field. Offer a button in the Appbar that presents a modal Menu.
When the menu is presented, offer the available search contexts to the user, allowing them to switch. Upon selection, re-render the search field with new placeholder text. It should probably clear anything that was previously entered.
If for some reason the set of contexts is limited to one (permissions, security, or another reason), present that option in the placeholder text and hide the menu button.
I've just got stuck with the portal when it comes to editing the dockbar. What I need to do is to have the possibility to customize (in principle add new portlets to) the dockbar's user dropdown (the one most right hand side).
What I mean is that when you open the dropdown list you have these fancy buttons such as my account, my dashboard, my profile. And I'd like to add there links to my own portlets like 'SamplePortlet' 'Hello' etc.
Specifically I want to give user the possibility to manage that, and let him put the portlets he wants there to appear, but at first I'd like to know how to modify it in general.
I think I've tried some stuff from the internet, hooks or properties but none seemed to do anything at all. Have you got any ideas?
I have an extension pages dialog box that I placed in a custom control. The dialog box is used to search for cost centers and return information such as market, cost center number, cost center name etc.
A "Select" button is pressed and the dialog box appears. The user searches for and selects their cost center. The OK button is pressed and it closes the dialog box and updates the various fields on the xPage.
A couple of questions.
Currently the "Select" button on the CC needs to know and refer to the name of the dialog box control within the CC. Seems to me that this is not the best practice. My end user programmer needs to know the ID of that dialog box control within the CC. Is there any way for my "Select" button could "show" the CC and the CC would actually show the dialog box control?
My CC makes use of custom properties to store the various document fields from the selected cost center. The OK button then uses these properties to set the various fields on the xPage. This again does not seem to be a best practice. If I wanted to use that CC in another application then I might need to edit the code in the OK button. Is there a better way to deal with this? Like I can set properties for a CC when I drop it on my xPage, is there a way I can tell it the code that I want to execute when the OK button is pressed?
One thing I thought was to have properties for the fields that need to be updated by the OK button but that does not seem to be so flexible.
For the issue of needing to know the id not sure if theres a typo but I don't understand why its bad that a select button inside a cc needs to no the id of the dialog to open it? did you mean the select is outside the cc? either way have you tried anything like creating a property on the custom control so that from outside it you can set something maybe
<xc:mycustomControl showDialog="false">
and then when something outside it happens change showDialog and refresh the cc, then inside the cc you can have a before / after page load to determine what happens when showDialog is true / false.
For your second issue it sounds to me like this should be using a domino document structure. Rather than the dialog pulling out each piece and the ok button updating, what I would do is have a domino doc data source on the page. when something is selected through the dialog I would update the document this source is pointing to and have all the fields bound to what ever fields they need to be. This way after something is selected the fields will just update to what ever the document contains, and it will be much more re useable so long as the domino docs have the same field names
In the source code for a master page, there is a section that has the following ASP.NET item: . This contains the "Welcome (User Name)" and Site Actions menus.
How do I create an additional menu that is similar to the look and feel of the Welcome menu? I've tried to create Front End HTML that behaves similar to the out of the box SharePoint menus, but it isn't quite right. I would prefer to utilize an ASP.NET or SharePoint control that acts similar to the SharePoint menu if that is possible.
For example, is <SharePoint:AspMenu> the appropriate control to use?
Thanks,
Robert
i am sure you will get better answer than this but just wanted to point what i have done to do this
i have added javascript library (JQuery) (for some other reason ) and when time come to do this thing i just added a JQuery code that creates another item in the navigation list with appropriate style and css class with the needed link and caption.
You could try another instance of the PersonalActions control with a custom GroupId. But when the control is rendered, it might also say "Welcome, [User]" just like the original.
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.