SharePoint - List of Folders - list

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.

Related

Create Type of Region Plug-In based on "List" Type of Region

I need to create a Type of Region Plug-In based on List Type of Region.
Standard List gets a List Navigation Shared Component and creates, for example, Card elements as a HTML tags with some href defined in the chosen Shared Component: List. But I need the ability to redefine all a elements as button elements and give them custom CSS classes and HTML attributes for each child element of a List region (for each button), not the List region itself. For example, to create a Menu Popup Card in the similar way as for a button (as described in this tutorial).
But I could not find any way to create a Plug-In with List settings by default but with ability to edit and add custom settings for my plug-in. Neither I found any existing plug-ins in community.
How to do it? Am I missing something?
No need to create a plug-in. If you need a custom Cards template for a region with List type, then go to Shared Components > User Interface > Templates and create it there as copy of Cards, then edit.
Damn it, why APEX is so hard to google? :D

Copy List Item to Folder in Seperate List

I have two lists, List A and List B. I have folders in List B. Can I set up a workflow that copies list items from List A to a specific folder in List B?
Yes but it does'nt seem the most appropriate.
You could use a custom action available in the ribbon or in the edit control block.
When you select a folder, you click on this custom action and launch a javascript function or a postback. And then, you program your copy.
Custom action :
http://www.c-sharpcorner.com/article/adding-custom-action-to-the-ribbon-of-view-in-sharepoint-list-library/
Code example to move folder:
Moving a SharePoint folder and contents to different location in same Document Library

Item to be bucketed according to a date field when created

I have created a content item at /sitecore/Home/FootballFever/Articles and have given insert option so that we can add only items of templates "Article".As of now,these article items are bucketable according to a field created date.
Now, i have insert option "Add Article" and "Insert from Template" buttons in the Home ribbon "Insert" block. When i create an item through "Insert from Template", the item automatically gets added in respective bucket with path as created date. for example if the item has created date is "7/21/2014" then path will be "/Articles/2014/7/21/ ".
But when i click on "Add Article", the item gets added in /Articles and i have to Sync everytime to get it to correct path.
How can I have the same behavior as that of "Insert from Template" but with path having Release date which is a field of template "Article"?
Please make sure that Article template has Bucketable field checked in its Standard values (for Article template).
If not, when you add a new item into buckets folder, newly added item itself is not bucketable, unlike the rest already existing items from the same bucket folder.
I have just made a proof of concept on my sandbox environment and can confirm that in case you add a new item with Bucketable checked by Standard values - it comes into a bucket straight away and you do not need to perform Sync.
Hope this helps.
UPDATE: I have written a blog post specially to cover your question,with comprehensive description.
http://blog.martinmiles.net/post/understanding-buckets-adding-new-items-to-buckets-correctly
By default, items will be structured in bucket folders, five levels deep based on the date and time the item was created. There are a couple of other built in rules you can use like using part of the Guid or part of the name. The thing to note here is that these are all things that are available on item creation. If you want to structure your articles based on a custom 'Release Date' then you will need to write a custom rule and you will also have to implement an OnItemSaved event handler. Here is a article on how to write the custom rule.
Generally you don't have to worry about how the items are structured in your bucket. Editors should be using the search tab to find the items they need.
Having said that, this SO post discusses how to structure your bucket items based on a custom field. Some things to note here is that this is generally a global change. There are ways around it that enables you to have different strategies for different buckets but you'll then have to do additional work to override the LinkProvider and potentially other things.

playing with SharePoint 2013 Lists Views and Schema

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

How do I write a Sitecore query from media item template to correct Home item with multiple sites?

I have a custom media item template that allows users to add category filters to the uploaded file. The media item is kept in the media library. The filters are to be selected from a folder underneath the Home item of relevant site in the content tree. They are selected using a treelist control. We have multiple sites, each will have their own Home item and filter folder. I need to set the source of the treelist control to point to the relative filter folder for each site.
If the media item were under the Hoe item I could use this:
query:ancestor-or-self::*[##templatename='Home']/item[#key='filters']
But of course the media item won't find ancestor-or-self::*[##templatename='Home'] as it isn't on that branch, it's parallel.
I doubt our naming standard will be robust enough to ensure any relative path based entirely on item names, and I'd rather avoid having to concatenate a name of a media folder to find the correct name of the Home item.
Is there any way of solving this elegantly?
I could of course put the filters folder elsewhere, either in the Media library (would rather avoid this as it will not be intuitive to our business users) or in a global section (where they would have to find their own specific site folder below - or add another security configuration to the content tree).
The getLookupSourceItems pipeline would allow you to add custom tokens/syntax to the Source field, e.g. a lookup to the correct site's home item.
http://www.sitecore.net/Community/Technical-Blogs/John-West-Sitecore-Blog/Posts/2011/05/Reference-the-Context-Item-and-System-Date-in-the-Source-Property-of-Sitecore-ASPNET-CMS-Fields.aspx
However from what I can gather, TreeList does not use this pipeline. Thus another option might be to create a custom TeeList field type.
http://www.cmssource.co.uk/blog/custom-tree-list
Answering my own question:
This isn't possible to do without employing some form of naming standard. If the branches within the media library mirror the branches within the content tree (Site1, Site2, Site3 etc) then a naming standard could enforce the correct relation between a media library branch and a content tree branch. If no such naming standard and branch mirroring is in place then there is no way of connecting a media folder with a specific site without adding a configuration item of some sort to contain the reference.