Sharepoint2010 custom list view, changing setuppath post production to new AllItems.aspx - sharepoint-2010

I have a custom list definition in production environment with list instances created with the following definition:
<View BaseViewID="0" Type="HTML" WebPartZoneID="Main" DisplayName="All Items" DefaultView="TRUE" MobileView="True" MobileDefaultView="False" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/issues.png" Url="Forms/AllItems.aspx">
I need to changing the setup path in some way so the AllItems.aspx view of the document library displays documents from it's parent site document library by e.g. CQWP. I've attempted this by using SPView.SetViewXml() but this has no affect.
I have attempted to follow Stefan Stanev's SharePoint blog
I've successfully changed the setup path in development with Unghost a custom SPView but I really do not want to go down this path.
I have customized the viewpage.aspx by mapping to templates\pages and editting / adding the required web part and adding feature upgrading to create a new view set it as default, change the ViewXml by calling SPView.SetViewXml but this does not work.
Is there a way of updating the content database post production to change and customise AllItems.aspx of a custom document library without directly querying content database?

Related

Vue - Switch between two different templates

I've been developing a new Vue project to control the connected devices from one point, I've been working on an admin template and it's all good but there is something that I want to learn and implement to this application.
Let's say I want to change the whole frontend template (the admin template that I'm using now) and use a new design, how can I implement the whole existing application to a new template? For example, when you start creating a Wordpress page, it gives you different templates and you choose some of them and start designing the website... Maybe after six months you want to change that design and you simply click and switch to a new template and all the existing content will be migrated to the new template. That is exactly what I want to do with Vuejs.
I have to do this project, which I prepared with the existing theme, dynamically, as if I will pass it to another theme in the future. When switching my existing project to a new theme, instead of copying all the components and their related scripts, I want to be able to switch just like in Wordpress by simply throwing the theme file into the project. How can I add this functionality to the project?

How do I create a Robots.txt editor in Sitefinity mvc?

I want to create an editor for the Robots.txt file in Sitefinity. I want to give the user ability to edit this. How do I do this? I am using the latest version of Sitefinity and MVC. Any examples or related articles, etc. will be useful.
If the user has access to Administration > File Manager, then he can go there, download the file, edit it and upload it again. That's the easiest option and does not require custom code.
If that's not an option, then you can create an MVC widget which reads the file and displays it in a textarea for instance.
User can then make changes and submit them to the controller which will save them to the file.
Then you can place this widget on a custom backend page.

Sensenet: Pagination on Document Library

It is possible to define pagination on document library?
I have a document library with more that 10000 documents... when I open the library occurs an timeout.
Actually SenseNet already does this! They just don't deliver it in the standard list control. If you open up the PRC and navigate to /Root/IMS/BuiltIn/Portal you'll see a list control with paging. The code can be found at /Root/Global/renderers/UserExploreGrid.ascx as User Control portlet. You can copy the code and change it to meet your needs.
Our company prefers to create User Control portlets and use Datatables with calls to the SenseNet OData API using skip and top to deliver pages.
Finally, given that SenseNet Content is stored as a tree structure (in SQL!), you can move the Content after creation so that data is organized hierarchically. A common solution is to take the first letter of the DisplayName and create a sub-folder from that letter, thereby reducing the number of items at a single node.
Here's what the paging looks like:
The short answer is no. Right now there isn't a built in functionality for that.
The long answer is that you can make a pagination yourself. One of the core member of sensenet made a grid where you can use pagination. It won't work with the current free to use releases because they lack the js files she used. But the idea behind it, is using a custom view. Which you can achieve by adding a system folder named Views under a the Document library and adding your custom view there.
You can use this grid for Explore, just follow these steps:
Go to the Explore action page, and switch editor mode on the PRC.
Place a ClientContext portlet (this can find under the Portlets->Application section in the portlet picker dialog) to the Wide column. Set portlet (client context porlet) properties, Apparance to None. It is a technical portlet, which allow get the CurrentContext in javascript. This is a very important element to work with this grid. The Grid use the client context.
Place a UserControlPortlet (In the portlet picker, Portlets->Application section) to the Wide Column.
Set portlet properties:
4.1. Portlet title: <%$ Resources: PortletTitles, Items%>
4.2. User Control path: /Root/Global/renderers/UserExploreGrid.ascx
Checkin Page modification on the PRC.
Enjoy your pageable explore portlet.
Keep in mind that this grid is specifically designed for users, so they will miss actions in the top menu. These must be handwritten. Then I suggest you copy the UserControl ( /Root/Global/renderers/UserExploreGrid.ascx)
and then put the action list on it . You can read more info about action list here: http://wiki.sensenet.com/ActionList
Br,
maros

Piranha CMS customisation

A few questions on customisation with Piranha CMS.
Is there a way to create additional custom site-wide items similar to those from the site helper? http://piranhacms.org/docs/api-reference/site-helper
e.g. to be able to set a phone number used throughout the site but still editable in the settings section of the manager.
Is is possible to create additional custom items for a page, e.g. page subtitle, and for those to appear in the Information section of page editing? Creating a region for say a page subtitle seems overkill.
Is it possible to create a custom page type with a region that is a collection of HtmlRegions or similar? e.g. for the purpose of managing a set of FAQs or similar enumerated content?
Is is possible to define custom settings properties for a page type?
Yes, you can add regions to your site in the same way as with page types under Settings > Sites. You then add content for them under Content > Pages > Edit Site.
You can add simple text properties on the page type. They will be shown as single line text inputs under Properties when editing the page.
No native support, however the region body can be anything that can be serialized to JSON so you have to handle this in the edit view for your region.
There is no support for injecting fields into the page settings, however if it's important you can override the whole edit view for pages and do anything you like by placing a copy of the view in the manager area in your local project. You can find the views in the github repo in the 2.2.5 branch.
Regards
Håkan

SharePoint 2010: custom masterpage for programmatically created subsites

What’s the best way to add a custom masterpage to a subsite that is being created programmatically in a feature event receiver? Each of these 50 subsites gets its own “_catalogs/masterpage”, so I have a feeling that Elements.xml for the root-site’s Module/Elements.xml is out. More feature receiver code? PowerShell post-deployment processing?
Is this going to be 50 copies of the same Master Page?
If not, I can't really picture how the Master Page will be specially made using code, but also a Feature Module element is certainly out.
But if it is 50 copies of the same file, you could deploy the Master Page to the Gallery one time using a Feature Module element. Then in your Feature Receiver, make a copy of that file with a new name in the Master Page Gallery and attach it to your website:
web.MasterUrl = "_catalogs/masterpage/custom_v4.master";
web.CustomMasterUrl = "_catalogs/masterpage/custom_v4.master";
web.Update();
You might want to think about creating
custom site definition.
You have following choices to set master page for the site:
1) Using Sharepoint Browser UI (from Site Settings page)
2) Using Custom site definitions
3) Programmatically
4) Using SharePoint Designer
Looking at your scenario, no 3 is an option. You may want to do it in the Feature Receiver itself.