Sharepoint - Custom ItemStyle in a new file - sharepoint

how can I customize the presentation of a Content Query Web Part by modyfing the xsl it uses without touching ItemStyle.xsl but using a brand new .xsl file?
I'm using MOSS 2007.
Thanks

There are lots of Articles on Customising the CQWP,
Healther Soloman's being one of my faves
here
But this
is a succint article doing exactly what you describe
using your own xsl by changing the Settings in the DWP (export/edit/import)
You could get really fancy and create your own version of the CQWP by inheriting from ContentByQueryWebPart and setting all the attributes you want in that code and including the files in you new feature to house said webpart and new files.

Related

Is there a way to read a word document section by section with c#

I have a word template which has multiple sections( tables, parragraphs, lists, etc.. ). The idea is that users fill the template and upload it to a asp.net application. I need the application to read the information section by section. So, is there a way to name the section of a word document and identify it by using c#?
I think it is much better to create a custom web page for filling fields there and constructing a Word document on the server-side using the Open XML SDK, see Welcome to the Open XML SDK 2.5 for Office for more information.
However, you may consider using bookmarks or content controls as a marker for sections.
Otherwise, you'll need to parse the uploaded document by searching for keywords presented in the template.

How to export content items from Orchard CMS to CSV?

I have a requirement to export every record from a content type in Orchard CMS to a CSV file that can be opened in Microsoft Excel.
I was surprised to see that this feature is not available out of the box or available as a module from the gallery. The built in export functionality in Orchard provides a custom xml format, great for moving content between Orchard sites but doesn't help me get the content in front of users that want to see it in excel.
A very simple link in the back end of Orchard that allows me to download a CSV file for a particular content type would suffice.
Does anyone know how easiest to achieve this in Orchard?
As far as I know there is nothing like that in Orchard. But it's easy to do, you could do it and share it as a module. The "only" thing that you have to do is serialize the ContentItems and its ContentParts/Fields to that format. If you look at the source, you will see a lot of examples for serializing content items (e.g. json/xml)
With a quick search I found this CSV serializer: http://simplecsv.codeplex.com

How to configure multicolumn header in sharepoint list?

I am having a sharepoint list. I want to group the columns.
For a clear understanding of my requirement, please see the image below:
Is this possible in sharepoint list? I am using version 2010.
It is possible to render List View for XSLTListViewWebPart (XLV) with custom columns header layout including the specified grouping. It is XSLT based solution that does not requires any custom coding.
This could be accomplished with SharePoint Designer, see for example Create a custom list view using SharePoint Designer
Below is described similar solution, but instead of modifying XSLT inside List View page, we will create separate XSLT file for it.
Steps
Create Custom View for List.
Create custom XSLT style sheet for rendering custom header layout in that view. Source code for this example is located here.
Save it for convenience in the same location where List pages are resides as shown on picture below
Open Custom View page in SPD and specify in XLV properties XSLink property as shown below on picture
Save changes.
List with custom View is shown below

Moving SubSites by preserving GUID's

I'm trying to move a Sharepoint Subsite into another one using the stsadm export and then import.
After the import, the site is working, except that I'm using some XSLT on some pages. The XSLT datasources are bounded to the lists GUIDs. And when importing it re-generates a new GUID for everything.
Is there a way to preserve the GUIDs when importing a site? Or is there any method out there instead of using stsadm export/import?
Any help appreciated, Thanks!
Convert listview web parts to xslt based webparts in place of using DVWP.
I finally found a solution... I used the Gary Lapointe extensions for stsadm.
In the function "gl-import2" function there is a "retainobjectidentity" parameter to persist the GUIDs through the import process.
Here's the link to the function :
http://stsadm.blogspot.com/2007/10/better-import.html

Custom SharePoint List View - can I put it in a feature (WSP)?

Here's my situation:
I'm working in SharePoint 2007 Enterprise, I have a feature that creates a list for me when I deploy and activate it. My usual workflow thus far has been to deploy the solution, activate it, then open up SharePoint Designer to customize the list.
My customizations are typically pretty complex, but I'll keep things simple. In this case, let's just say that I edit AllItems.aspx, convert the data view to an XSLT data view, then I add one column with static text.
I've used a few different tools (SPSource, VSeWSS, SharePoint Manager, OCDExportList, etc) to extract my custom schema.xml and all the default views, but I have yet to have any luck figuring out where the the code for AllItems.aspx is now that it's been customized.
When I extract (using any of the tools above) AllItems.aspx is no different than the default. The <View> element in schema.xml is reduced to one line, for example:
<View DefaultView="TRUE"
MobileView="TRUE"
MobileDefaultView="TRUE"
Type="HTML"
FPModified="TRUE"
DisplayName="All Documents"
Url="Forms/AllItems.aspx"
Level="1"
ContentTypeID="0x" />
I'm really stuck here... I've got no clue what to do. Is it even possible? It would save me a great amount of time (and documentation) if I could include my customizations in my feature.
If there's any other info I'm missing that would help, let me know... thanks!
Latest findings:
I've found out a bit more in the past couple hours. If I save the list as a List Template, then save the .stp file locally as a .cab file I can extract its contents. One of the files is manifest.xml which contains the schema.xml as well as a few other sections.
One of those sections is a <webparts> section that has a <webpart> for each view. Each of those <webpart> elements contains a really long string of characters... no clue what those characters actually represent.
The important thing is that I think any custom views have to actually be Web Parts if deployed as part of a solution... but I'm not positive.
I have faced a similar issue a while ago. I had to create a very customized view and I had to give up the ListFormWebPart completely, and have created my own webpart to render the data.
Generally, when you customize the aspx file in SPDesigner, all your changes will be in the aspx file itself. Open it in SPDesigner and you will see there all the changes you have made. After you have converted to the XSL Data View, the standard ListFormWebPart is replaced by a DataFormWebPart, which doesn't care about the <View> tags specified in the schema.xml; Look in the aspx file itself for the ListFormWebPart.
Why not do all the customizations you want on a list, save the list as a template (it will include the associated AllItems.aspx) and then use that template in your feature to create your list? You could add the extracolumn from code (if it's dynamic and cannot be included in the template), and so on.
Yes you can. Get the Sharepoint manager tool from Codeplex
http://spm.codeplex.com/
Install it on a machine in your farm, it will allow you to browse the farm via a tree view that shows all objects.
Make the list via the Sharepoint GUI, then browse to it w/ SPM.
SPM will allow you to extract the MOSS/WSS created xml that describes the list view (it shows up in the left hand property grid), which you can then plop into your manifest.xml
I have a similar issue and have been doing a lot of research into this. The dataview web part to me is one of the most powerful components in Sharepoint. Unfortunately I have to provide my solution as a .wsp package and that means that I can not just make the site and use Designer on that site. I have taken a 2 step approach in that I used designer to create my dataview and I also edited the code of that dataview to replace the ListID and Guids to ListName and the actual list name. This allows it to be exported and used in any page/site as long as the list name is the same. I am creating a webpart page document library also in my solution and I believe I can add the pages that have the webparts to this library using the onet.xml file. I will try to get the results of that test in as soon as I can do it.

Resources