Can't figure out how to use custom layout element

Topics: General
Jul 9, 2015 at 1:42 PM
Edited Jul 9, 2015 at 1:48 PM
Using Orchard 1.9.1, I've created a new Element (via the UI) based on the paragraph element. When I go to create a new layout, I can't seem to find it in the toolbox. Is there something I need to do to get it to show up in the toolbox or is there some other process for adding my custom element to a layout?

Image

Image
Developer
Jul 9, 2015 at 2:04 PM
Did you specify a category? If not, I believe the default category would be either Blueprint or Snippet. Just check all of the categories in the toolbox, you should be able to find it. If not, please check your error logs. Perhaps an error occurred. In that case, please file a bug on GitHub. Thanks!
Jul 9, 2015 at 2:44 PM
I've tried it with and without a category and it's nowhere to be found in the toolbox. There are no exceptions being thrown when I create the element or when I access the layout editor. However, I am consistently seeing the following exception in the error logs when I startup the site. Could that be the cause?
015-07-09 08:40:26,869 [6] Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator - Default - NullReferenceException thrown from IContentPartDriver by Orchard.Layouts.Drivers.LayoutPartDriver
 http://localhost:30321/OrchardLocal/
System.NullReferenceException: Object reference not set to an instance of an object.
   at Orchard.Layouts.Services.ElementFactory.Activate(ElementDescriptor descriptor, Action`1 initialize)
   at Orchard.Layouts.Services.ElementManager.ActivateElement(ElementDescriptor descriptor, Action`1 initialize)
   at Orchard.Layouts.Providers.BlueprintElementHarvester.<HarvestElements>b__8(<>f__AnonymousType7`2 <>h__TransparentIdentifier1)
   at System.Linq.Enumerable.<>c__DisplayClass2`3.<CombineSelectors>b__3(TSource x)
   at System.Linq.Enumerable.<>c__DisplayClass2`3.<CombineSelectors>b__3(TSource x)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Orchard.Layouts.Providers.BlueprintElementHarvester.HarvestElements(HarvestElementsContext context)
   at Orchard.Layouts.Services.ElementManager.<>c__DisplayClass7.<>c__DisplayClassc.<DescribeElements>b__3(ElementHarvester harvester)
   at System.Linq.Enumerable.<SelectManyIterator>d__4`3.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__1.MoveNext()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Orchard.Layouts.Services.ElementManager.<>c__DisplayClass7.<DescribeElements>b__2(AcquireContext`1 acquireContext)
   at Orchard.Caching.Cache`2.CreateEntry(TKey k, Func`2 acquire) in c:\Users\josh\Documents\Projects\orchard_1.9.1\src\Orchard\Caching\Cache.cs:line 57
   at Orchard.Caching.Cache`2.AddEntry(TKey k, Func`2 acquire) in c:\Users\josh\Documents\Projects\orchard_1.9.1\src\Orchard\Caching\Cache.cs:line 27
   at Orchard.Caching.Cache`2.<>c__DisplayClass2.<Get>b__0(TKey k) in c:\Users\josh\Documents\Projects\orchard_1.9.1\src\Orchard\Caching\Cache.cs:line 19
   at System.Collections.Concurrent.ConcurrentDictionary`2.AddOrUpdate(TKey key, Func`2 addValueFactory, Func`3 updateValueFactory)
   at Orchard.Caching.Cache`2.Get(TKey key, Func`2 acquire) in c:\Users\josh\Documents\Projects\orchard_1.9.1\src\Orchard\Caching\Cache.cs:line 17
   at Orchard.Caching.DefaultCacheManager.Get[TKey,TResult](TKey key, Func`2 acquire) in c:\Users\josh\Documents\Projects\orchard_1.9.1\src\Orchard\Caching\DefaultCacheManager.cs:line 33
   at Orchard.Layouts.Services.ElementManager.DescribeElements(DescribeElementsContext context)
   at Orchard.Layouts.Services.ElementManager.GetElementDescriptorByTypeName(DescribeElementsContext context, String typeName)
   at Orchard.Layouts.Services.ElementSerializer.ParseNode(JToken node, Container parent, Int32 index, DescribeElementsContext describeContext)
   at Orchard.Layouts.Services.LayoutSerializer.<>c__DisplayClass3.<Deserialize>b__0(JToken x, Int32 i)
   at System.Linq.Enumerable.<SelectIterator>d__1`2.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Orchard.Layouts.Services.LayoutSerializer.Deserialize(String data, DescribeElementsContext describeContext)
   at Orchard.Layouts.Services.LayoutManager.LoadElements(ILayoutAspect layout)
   at Orchard.Layouts.Drivers.LayoutPartDriver.<>c__DisplayClass8.<Display>b__6()
   at Orchard.ContentManagement.Drivers.ContentPartDriver`1.<>c__DisplayClass15.<ContentShape>b__14(BuildShapeContext ctx) in c:\Users\josh\Documents\Projects\orchard_1.9.1\src\Orchard\ContentManagement\Drivers\ContentPartDriver.cs:line 196
   at Orchard.ContentManagement.Drivers.ContentPartDriver`1.<>c__DisplayClass1b.<ContentShapeImplementation>b__1a(BuildShapeContext ctx) in c:\Users\josh\Documents\Projects\orchard_1.9.1\src\Orchard\ContentManagement\Drivers\ContentPartDriver.cs:line 205
   at Orchard.ContentManagement.Drivers.ContentShapeResult.ApplyImplementation(BuildShapeContext context, String displayType) in c:\Users\josh\Documents\Projects\orchard_1.9.1\src\Orchard\ContentManagement\Drivers\ContentShapeResult.cs:line 45
   at Orchard.ContentManagement.Drivers.ContentShapeResult.Apply(BuildDisplayContext context) in c:\Users\josh\Documents\Projects\orchard_1.9.1\src\Orchard\ContentManagement\Drivers\ContentShapeResult.cs:line 21
   at Orchard.ContentManagement.Drivers.CombinedResult.Apply(BuildDisplayContext context) in c:\Users\josh\Documents\Projects\orchard_1.9.1\src\Orchard\ContentManagement\Drivers\CombinedResult.cs:line 28
   at Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator.<>c__DisplayClassa.<BuildDisplay>b__9(IContentPartDriver driver) in c:\Users\josh\Documents\Projects\orchard_1.9.1\src\Orchard\ContentManagement\Drivers\Coordinators\ContentPartDriverCoordinator.cs:line 49
   at Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable`1 events, Action`1 dispatch, ILogger logger) in c:\Users\josh\Documents\Projects\orchard_1.9.1\src\Orchard\InvokeExtensions.cs:line 17
Developer
Jul 9, 2015 at 4:04 PM
Yes, that's it. Which Orchard version (or branch) is this?
Are you able to reproduce this issue with a clean installation?
If so, can you please create an issue for this on GitHub? Thanks!
Jul 12, 2015 at 3:29 PM
It was 1.9.1, but I can't repro on a clean install so it must have been something on my end. Thanks for your help!