Thursday, September 17, 2009

Custom Content Type, Visible on New Button

I was adding a custom content type to a form library and I was using the same code mentioned in the following link:
http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/13333670-d1ea-41ec-8ebc-4ad9ecb04927

But my custom content type was not set as "Visible on New Button", after that I created a new form library and tried to run the same code which I was using before and it worked for newly created form library.

I started comparing the difference between 2 form libraries because same code was working for one form library but not working for other one, after digging into further I realized whenever you change the order of content type through UI while using the "Change new button order and default content type" option under the settings of form library, code does not work.

So consequently I can say in order to code get working don't change the form library content type order through UI, there can be any other reason for which code was not working but I could find only this reason, it may help someone in future.

Wednesday, September 9, 2009

Top Row / Custom Heading in CQWP

If you are wondering how to add a custom heading or image as a heading of CQWP or custom top row in your CQWP then don't worry, this is something very simple and easy to accomplish.

Open ItemStyle.xslt in SharePoint Designer and write down the following code withing your template



As you can see above mentioned code will put myImage.gif at the top of CQWP detail, which appears as heading of CQWP.

I hope this will save someone time in future.