playing with SharePoint 2013 Lists Views and Schema - list

need to know how to get SharePoint List specific View among my Custom List Views or to modify a SharePoint List Schema... I explain :
Before i start i need to tell you that my need here is to have a list exactly like Discussion Board List just i need to modify its New/Edit forms. So i have 2 important creterias that i need to have :
1/Ii need to be able to acess the schema.xml file to add my custom New/edit forms to the list
2/ Or i need to be able to get the default View of Discussion Board List (the one with reply button and like etc...)
So, here are my Problems:
If i create a custom list (from Visual Studio) and i make it based on Discussion Content Type, Condition 1 is satisfied e.g. i can have a schema.xml File in where i can modify to put my Custom Edit/New forms BUT my list is being displayed not the way i want to (like described in Point 2) it is diplayed in rows and columns (no reply button etc...)
If i create a custom list (from Visual Studio again) based on Discussion Board list template, it is displayed (its Default View) just like i want to (as described in point 2) but in Visual Studio i only have a list instance, i don't have access to its Schema.xml where i can put links to my custom New/Edit forms.
I tried too many things; I tried to provision the Views programmatically just like in this : Thread but none helped me.
The last thing i tried is to take the desired view from SharePoint Discussion Lists (found its schema.xml in 15 hive) and i tried to integrate in my custom List, but i No relevant results...
So, in summary i need either to be able to import View from List to List or to be able to modify Schema.xml of SharePoint Lists that are based on specific list template (in my case Discussion Board template)
Any help will be welcome

Related

Kentico 10 - Use a repeater to display multiple page types

We are currently use the oob page types for Blog, News and Event. We have one page for each of these types that includes a repeater to show a list of the pages of that type. We would also like to have a page that includes a repeater that shows all blog, news and event pages in one spot, sorted by their created date.
I have seen some old comments (here, here) on devnet saying that although a repeater can render multiple page types, the fields rendered must be identical across each of those page types. The workarounds suggested are either to create the same fields in each page type, or to create a custom SQL query and use a query repeater to render the data. I've done this and it works just fine, but it was pretty cumbersome to create and will be difficult to maintain. (If we want to add other page types, for example.) Can anyone suggest a more out-of-the-box method available in Kentico 10?
Update:
I'm trying to accomplish this as Brenden described, but am running into trouble.
My page structure is as follows:
Root
.RollupPage (CMS.MenuItem)
..BlogPosts (CMS.Blog)
...January 2017 (CMS.BlogMonth)
....blog post 1 (CMS.BlogPost)
...February 2017 (CMS.BlogMonth)
....blog post 2 (CMS.BlogPost)
..Events (CMS.MenuItem)
...Event1 (CMS.BookingEvent)
...Event2 (CMS.BookingEvent)
I've attempted to use a universal viewer, but failed to get it to return any data.
I configured it with:
Path: /RollupPage/%
Page types: CMS.BlogPost;CMS.BookingEvent
Hierarchical Transformation: CMS.MenuItem.HierTrans1
HierTrans1 has the following transformations:
CMS.BlogPost.Default (Item transformation for type CMS.BlogPost)
CMS.BookingEvent.EventCalendarItem (Item transformation for type CMS.BookingEvent)
These aren't customized at all; they are standard OOB transformations just so I can see it work.
When I view the RollupPage, the universal viewer displays nothing.
I attempted to use a Hierarchical Viewer with the same settings as I did with the Universal Viewer. It kind-of worked. It displayed my booking events but did not display any blog posts. Yet using the same blog post transformation (CMS.BlogPost.default) with hierarchical viewer whose Path was set to /RollupPage/BlogPosts/% displayed my blog posts correctly but, obviously, did not display my booking events.
The results I've gotten so far makes me think a) something about the way I've created my pages is stopping the universal viewer from traversing the whole tree and/or b) the hierarchical viewer either only goes a couple of levels deep, or maybe it is being blocked from traversing the tree too... No events are recorded when I edit or view these web parts.
Any idea what I may be doing wrong?
For this scenario use a universal viewer. Reason being is you can create a hierarchical transformation which will have different transformations for each of your unique page types. You most likely won't use the hierarchy at all but you can simply add 3 different item transformations for the different page types.
You can use the Hierarchical viewer or the Universal viewer, as Brenden Kehren mentioned, to achieve the goal you are describing.
When configuring the web part you must select all the Page types that are included in the hierarchy, in your case: CMS.MenuItem, CMS.Blog, CMS.BlogMonth, CMS.BlogPost and CMSBookingEvent.
Create a Hierarchical transformation to be used with your viewer and add an Item transformation for each of the items you wish to display. Also make sure the Level setting for each transformation is configured properly (-1 applies the transformation to all levels).
For Universal viewer it is necessary to check the property Load hierarchical data in the section Extended settings of the configuration.
As an additional note, you can leave the path property empty in case you are viewing the child documents of the current page.
For reference there is also an example on the Corporate Site example site in the content tree path Examples > Web Parts > Listings and viewers > Pages > Hierarchical viewer (or Universal viewer).
Hope this helps!
The other ways are this
Evaluate right fieldname by check object classname inside the transformation and assign appropriate value.
Dynamically assign transformation by checking the object classname

List of News Articles In Sitecore (Best Approach?)

I am creating a Sitecore MVC site for a client and I need to create page that will list news articles for the company.
So far, I have created items that use a shared data template called “Article,” and I also have a sublayout (a view rendering) called “Article” that will display these items.
For the list itself, my plan was to create another component (a sublayout) call “News_List”, and to put a placeholder in it called “List”.
My question is this: can I allow the author to insert articles (e.g., N items of type “Article”) into this placeholder via the page editor?
Will SC allow you to insert multiple instances of the same component into a placeholder? Will this break anything?
I believe this is a pretty common question but I have not found a definitive answer. Thanks in advance…!
You can insert as many components (of the same type) in your placeholder as you want.. Just make sure to put the placeholder settings correctly and give it a decent name (not just "list" ;))
But are you sure you want to do this? Your editors will manually need to create a list of components for each article they want to add on the page. Doesn't sound to be very user (editor) friendly.. Maybe you should consider creating a list component that can get a list of articles as a datasource and show those. Or even select them automatically (but that might be not according to your business case)..
Yes, authors can add multiple instances of the same component into a single placeholder.
Assuming that the code of the component doesn't do any stupid things it's absolutely ok to do this.

Create Word document of complete list (multiple list items)

I have a Sharepoint 2010 Custom List. I have created a Nintex Workflow to get all the data from the list i need and wrote it into a variable that contains a HTML table. Unfortunatelly Word only sees the code and not the table when i use this variable in a Content field in Word.
What i need is a way to get the filtered items of the list into a Word document (template) as a table.
I know how to do it with a single List Item but not for the complete list. With the Single item it works great with Content Controls but not for multiple items.
We use Sharepoint 2010 and Nintex. My knowledge of JS is zero and we are not allowed to use SPD.
This is not possible with nintex workflow. You need to create a custom workflow using visual studio to achieve this kind of behavior.
You could build an HTML file via a Build String and Web Request (w/ PUT) actions. Then use the Convert Document action to convert it into a Word doc.

SharePoint - List of Folders

I'm trying to implement a list where the only item type is a folder. If someone click "New" they are brought to a form that allows them to enter a folder name, description, and select either "Active" or "Inactive" from a drop-down menu. Inside the folder I want a simple list with only 2 columns.
I tried making a custom Folder content type with the columns I needed and making it the default content type. This seems to work to make the list of folders. Once I go inside the folder and try to change the internal view/list setting (I don't want to use the custom folder content type inside the folder...i just need 2 simple columns) it changes the settings for the list of folders as well. Is there any way for the internal list to have different settings than its parent?
I don't know if this issue is still relevant, but maybe someone else will find my answer useful.
I used to implement a list that contains only folders in the root, which in order can contain few item based content types.
There was two event receivers for FeatureActivated and ItemAdded events, which changes UniqueContentTypeOrder property (the list of content types available for user to create) of the lists root folder and a folder being created respectively. Like this:
List<SPContentType> ctl = new List<SPContentType>();
foreach (SPContentType ct in lst.ContentTypes) if (ct.Id.IsChildOf(SPBuiltInContentTypeId.Folder)) ctl.Add(ct);
lst.RootFolder.UniqueContentTypeOrder = ctl;
lst.RootFolder.Update();
Also, I designated different available list views for root folder and the folders it contains, by specifying ContentTypeID attribute for a View definition.
Unfortunately, no. Since SharePoint is Lists are not relational data, the only options to you are allowing several Content Types. If a content type is available to the list, it's available to the entire list (root, and sub-folders).
One possibility to model what you are trying to accomplish relies on SharePoint 2010 Enterprise. Infopath allows you to customize the New Item Form for a List. It might be possible to edit the form such that it only allows Folders on the Top Level, and List Items within a folder, but I don't know for sure - it's been a while since I customized a List Form with Infopath.

Word templates populated automatically from list fields from a SharePoint custom list?

Is it possible to automatically create Word documents which include list fields from a custom SharePoint list?
here is the scenario: - custom list (over 100 columns) - Word templates (not sure where is best to store them yet) - Entry Form will provide data for the templates (or partial data, ie Client name, Sales Rep) - a form that will have buttons (ie 'Create Order Form', 'Create PO')
the idea is to be able to generate partial populated templates from a custom list with a puch of a button.
Sorry to sound like a commercial :) but the company I work for has a product that allows you to do that: OfficeWriter SharePoint integration and in specific the SharePoint developers section. You can see some samples in there of similar things.
Good luck!
sure you want it in Word?, Excel is more often misused for this (make some connection i tihnk odbc or so).