How to export\import unused shared blocks and folders from global library?

Vote:
 

Dear EpiServer Team,

 

1) I have a shared block (I implemented special type for this block (NewsBlock) and then created it in CMS):
    - the shared block "My News" is in folder  Global Library -> MyBlocks;
    - the shared block wasn't used anywhere;

Why it wasn't imported?

I selected next items to export data:
1) Export content items;
Select part of structure -> Start Page
Export files that the pages link to
Automatically export dependent content types
2) Export content types:  all 'Export content types' (SysRoot, SysRecycleBin, SysContentFolder were included)
3) Export categories


I created new empty database ans used it for my mvc site. I selected next options to import data:
1) the file to import;
2) the Root page as destination
3) checked 'Update existing content items with matching ID'
After import I found shared blocks in Global library, which were placed on page context area. But shared block  "My News" and  folder  Global Library -> MyBlocks were not found.

Does Import support only pages, related content, page types and block types?
How to import unused shared blocks and folders from Global library?

 

 

#71985
Jun 04, 2013 11:40
Vote:
 

Shared blocks and files are only included if they are referenced. API wise it is though possible to export/import those resources standalone as well even if the UI is not possible.

What you can do is to add an eventhandler to the exporter and in the eventHandler add the blocks. Something like:

[InitializableModule]
public class SharedBlocksExporter : IInitializableModule
{
public void Initialize(Framework.Initialization.InitializationEngine context)
{
DataExporter.Exporting += delegate(object sender, EventArgs args)
{
DataExporter dataExporter = sender as DataExporter;
dataExporter.SourceRoots.Add(new ExportSource(ContentReference.GlobalBlockFolder, ExportSource.RecursiveLevelInfinity));
};
}

 

}

#72008
Jun 05, 2013 9:52
Vote:
 

Thank you for answer, it works perfectly.

#72046
Jun 06, 2013 14:24
Vote:
 

Johan: Why haven't you just added the tree in the same manor as on "/cms/Admin/security.aspx" so that we can pick a reference from the block/media folder as well?

#85437
Edited, Apr 25, 2014 9:22
Vote:
 

I agree that it would be useful to have a general content picker. I am not sure how the backlog looks for the UI team, but post this as a suggestion in the feature request forum and then it might get higher priority.

#85481
Apr 28, 2014 9:34
Vote:
 
#85484
Apr 28, 2014 10:30
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.