So this may be silly but I want to ask anyway, if I am using the text file approach (markup and javascript within text files that a CEWP references), is it possible to add mark up or script that would allow me to get a webpart back this way. I realize this is a littl backwards, but I am using jQuery/js for UI elements, functions and logic, SPServices, and most everything I want to accomplish works this way, and great. But there is one spot where I would actually like to have a webpart within a tab in a certain section.

Just wondering if the content created for the webpart, when you create a new page and add one is portable, or is it possible with adjust to get that idea??

EDIT: just a to add a bit more about what I specifically have and am trying to do.

I am using jquery, SPServices and jquery UI on a page. I have a ui tab control, and for each tab I am referencing a text file that contains that tabs content (mark up, js/jquery). This helps me in two ways: with performance since each tab has a lot of content, and its not loaded until the tab is clicked, and also just keeps the relative elements with functionality and styling, etc. Might not be the best way but it was the way I learned and it works. So the above occurred to me when there is just one little place inside a single tab full of other content as well, where I would like to place a webpart (just a list view) and that is really the only spot where I need a webpart.

So this idea is probably backwards of the normal approach, but I need 97% of the content on this page to use jquery and UI, with SPS, etc. This is a jquery ui approach that works for me, but not really a SharePoint approach because I am not sure if you go down this route you cannot then all things like webparts to the mix? I dunno, perhaps the question is just silly?

thanks as always!

  • If you want to reference JavaScript/CSS files then there are other more global ways to do this, if that would solve your problem. Such as adding a user control to AdditionalPageHead (can do this with a Module (Elements.xml)).
    – eirikb
    Commented Sep 12, 2012 at 14:54

1 Answer 1


You can't add a web part inside a CEWP. You could probably fake it by adding the web part to the page and then moving in into one of your tab containers via jQuery. But this would involve some complex code and you'd likely see that 'flicker' effect when the ready() function executes the move.

I think it would be easiest to edit the page in SharePoint Designer and forget the CEWP. This will allow you more control over the layout of your page, and allow you to place your web parts where you need them.

  • appreciate the answer. so placing the UI tab control in the pages content (embedded) is not a problem at all, however I still need to have the content (markup, script and styles) for each of the tabs dynamically loaded when the tab is clicked. for this reason I have been keeping all that in text files, and I am wondering if I can manually write a webpart into that? that is more of what I was wondering. thanks for the advice!
    – Justin
    Commented Sep 15, 2012 at 11:07
  • for the tabs that load via javascript, all you have to do is delay the loading until the user clicks the tab - i.e., capture the tab's click event and load your content in the handler. The XSLT web part will load when the page loads, though. Commented Sep 17, 2012 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.