umco / umbraco-nested-content Goto Github PK
View Code? Open in Web Editor NEWNested Content for Umbraco 7.1 to 7.6
Home Page: https://our.umbraco.org/projects/backoffice-extensions/nested-content
License: MIT License
Nested Content for Umbraco 7.1 to 7.6
Home Page: https://our.umbraco.org/projects/backoffice-extensions/nested-content
License: MIT License
When I try to use dropdown list as nameTemplate it shows Prevalue ID instead of property value
This isn't an issue, just an enhancement. I was thinking. like ArchType allows. You could choose multiple DocTypes within the Nested content. Then when you click the plus button it gives you the option to select which DocType to create (Inc showing the icon).
Then you could have a list of multiple different types....
Initially NC was built to store a doc types guid, which was as a means to prevent breakages should someone decide to rename a doc types alias. With the recent change to storing the alias instead, it's now a bit more prone to breakages.
Given we have made sure to prefix the fields that hold the doc type / tab aliases, I wonder if we shouldn't try and add some preventative measures to try and fix things as changes are made, ie, if someone changes the name of a doc type, do a quick search and replace in the database for "ncContentTypeAlias: 'OldAliasName'" and fix the changed entry doing something similar with the tab alias.
This could be done quite easily in the database, but I guess we also need to consider updating the lucene index, as well as the xml content cache.
There is also the question of how far we go, ie, do we also try and detect property alias changes as well?
Is there some way to programmatically add values to a Nested Content property type on a node?
I believe I am supposed to save JSON to the VALUE
variable, but I'm not sure out to do this:
var test = ContentService.CreateContent("Test", parentId, "testAlias");
test.SetValue("nestedContentProperty", VALUE);
ContentService.SaveAndPublishWithStatus(test);
Is there some namespace that I can access the DetachedPublishedContent
from? Maybe I could use that model to create the data. Thanks for any help.
If we have existing code using a nested content datatype such as Model.Content.GetPropertyValue<IEnumerable<IPublishedContent>>("PropertyName");
Then...down the road - someone changes the min/max from 0/3 to 1/1 - it seems the existing code breaks until someone change the above to
Model.Content.GetPropertyValue<IPublishedContent>("PropertyName");
Or am I missing something? This seems like a dangerous "feature". Can we fix this? Or am I just using this wrong?
Just starting a new project on Umbraco 7.4 and using the now built in ModelsBuilder. It seems to interact nicely with property value converters in most cases (some of my own and the Core Property Value Converters module) but after adding in a Nested content property the model builder only typed the property as "object" rather than expected "IEnumerable"
Not a show stopper but would be great if they worked together to build a strong typed model.
Thanks
Before i start - LOVE this package from what i've seen until it broke! Great job!!! :)
My issue is its stopped working...
What i did:
I added the package via NuGet and created a test doctype called InfoBlock containing:
Textstring
MultilineText
ImageCropper
ContentPicker
Then added the data type Info Blocks and linked to InfoBlock
Added a property to a page and set to InfoBlocks type
On going to the content node (was an existing page): All the properties rendered ok and allowed entering of content
When i output the content in a web page the ImageCropper didn't contain the src property but did have the coordinates for the focus point.
I wondered if an issue with 7.3 umbraco so I created an image cropper property on its own (rather than nested type ) and that renders out fine so appeared to be an issue with Nested Content.
I then went to create some new types for nested content and now nothing will display in the property pages for nested content when editing a content node.
I even started a fresh with a rollback of the db but im not getting anything. All i get is the add button and the label for Item 1 - and no properties.
Not sure whats gone wrong.
Any ideas?
Thanks
Damian
HI!
I have created different nested data types with different doc types (Banner, Links, on so on...). On the home doc type I want to have each on a separated tab BUT the first one is working as expected and all the others have only an empty "Item 1"... any idea what I do wrong?
ps:
I used the vorto package for the multilingual stuff, but I think this shold not be a problem...
Hi!
In UI Image Cropper works as it should, but selected value not saved after publishing
Once Umbraco releases with a native Nested Content, (currently scheduled for Umbraco v7.6.0), we will start to archive this project.
The source-code will still be available on GitHub, but there will be no new major/minor package releases. We will support the current package release with bug-fix patches (including community pull-requests).
For future feature-requests, these would need to be made on the Umbraco issue tracker for the Umbraco Core team to review.
This is an open issue, if you have a different viewpoint, we're happy to discuss further.
I have an Umbraco project in which i have installed NestedContent via NuGet.
When using a doctype that has been created using a composition, the composition values are not saved on publish. After looking through your closed issues i noticed that this has been fixed in the repo, but it appears that NuGet version does not include the change. I pulled down the repo and did a manual build, then switched out the dll and that solved the problem.
I'm not sure if you're waiting for your 0.3.0 release to amend this. If so, shall i create a PR to update the Known Issues part of your doc to include the problem, and temporary solution?
Cheers, and keep up the awesome work.
See this forum post where the issue was originally posted
If a value is set and subsequently removed when the node is then published it adds an empty cdata section in the cache file e.g.
<headerSlides><![CDATA[[]]]></headerSlides>
Unfortunately this means that recursive property lookups like this:
Model.GetPropertyValue<IEnumerable<IPublishedContent>>("headerSlides", true)
...result in the lookup stopping on the node with the now empty cdata section and not continuing up the tree until it really does find a node with a value on that property.
Pull request to follow.
Would love to see this on NuGet for the usual reasons. Well done fellas. #h5yr
Hello Lee,
I'm using Nested Content in Nested Content wich works awful! The only problem is the validation doesn't work in the Nested Content I use in another Nested Content.
I've got a property on a content doctype from datatype Nested Content (file nested_content_blocks.png and Nested_blocks_datatype.png) as blocks.
One of the blocks uses another Nested Content inside that item (nested_blocks_doctype_property.png) where the title, intro and url are checked as mandatory in the doctype (Nested_Content_mandatory_fields.png) but I can save it without any mandatory errors.
The main Nested Content validation works fine (Main_nested_content_validation.png), but the validation of the Nested Content in Nested Content wouldn't be shown (validation_of_nested_Content_in_nested_content).
Hopefully it's a little bit clear for you?
Do you have any idea why this won't work?
I've added some screenshots for explanation.
See the discussion here:
Ideally it would be great if we could pick from a list of media types to display in our content node. That way we can create simple objects that inherit from the built in media types Image etc for nested display.
No validation for any field. It would be nice to have the validation on the save event.
I added a document type with a Multiple Media Picker to Nested Content (for a gallery). Normally, you can drag images around in the Multiple Media Picker property editor to change the order. This works fine in Nested Content as well, but the sort order is never saved. Hit Save and Publish and then reload the page. The images are back in the order they started in.
It would be great to be able to specify a fallback for the label when the label template resolves to an empty (or whitespace-only) string.
(Or I may not be sufficiently Angular-skilled to have figured it out yet :-)
It can be very handful to have possibility in custom label templates by fields with complex type parse them to get applicable values. For example, Nupicker prefetch list picker stores values as something like [{key:"1234"},{label:"nanana"}]. Is it possible to have callback function in template? It seems like Archetype has something alike.
Hello,
Your package looks to be just what I need!
However, with a fresh install of Umbraco 7.2.8 (tried with built-in package installer and also with Nuget).
After the install, umbraco back office hangs. I can still navigate the website, but I cannot log into the back office. I think this is something in one of the Angular files that's causing the problem. The back office works again when I delete the NestedContent folder from the App_Plugins folder.
I've noticed...
the "nestedcontent.services.js" file is empty
in the "nestedcontent.resources.js" file specifies a url "/umbraco/backoffice/NestedContent/NestedContentApi/GetContentTypes" which does not exist. I've checked the file structure of umbraco and there is no "/umbraco/backoffice/" directory.
I'm running VS 2013 Web and have installed Umbraco through Nuget.
Sorry if this doesn't help. Please tell me what to check. Happy to help!
Kind regards,
Daniel
Was wondering if someone had added in a close link / button to the pop up after we've clicked on the (+) button.
As currently if i've accidently clicked on the (+) button. I need to select something to be rendered and then delete them after that.
Hi Lee,
I have found what I believe to be a bug in your package. The bug is in regards to Repeatable Textstrings. When using Repeatable Textstrings in Nested Content, it outputs line breaks as empty strings.
I had originally posted the issue on "Our" (https://our.umbraco.org/forum/using-umbraco-and-getting-started/76559-repeatable-textstrings-outputs-empty-strings).
Regards,
Allan @ Ecreo Denmark
From the forum...
I'm having an issue with Firefox where the nested content item's Textstring fields don't allow any focus or editing in the browser. I can use content or media pickers, but the textstrings are un-editable.
Anyone else experiencing this?
I can edit in Chrome just fine.
Add support for AppVeyor CI builds.
Currently DetachedPublishedContent is internal. I'm trying to see if I can register DetachedPublishedContent into the PublishedContentModelFactory for the Models Builder, but currently I can't do that.
Maybe use the same class for NestedContent and the Doc Type Grid Editor?
If i create a nested content doc type and can add it to a media type in a standard tab/property. No problem. However I have a nested content i want to include in 7 different media types - so i wanted to include it as a composition.
But if I include that composition with the same NC property which worked fine as a standard property, the media types do not display . The getchildren of the containing folder call returns:
)]}',
{"Message":"An error has occurred.","ExceptionMessage":"Object reference not set to an instance of an object.","ExceptionType":"System.NullReferenceException","StackTrace":" at Umbraco.Web.WebApi.Filters.DisableBrowserCacheAttribute.OnActionExecuted(HttpActionExecutedContext actionExecutedContext)\r\n at System.Web.Http.Filters.ActionFilterAttribute.OnActionExecutedAsync(HttpActionExecutedContext actionExecutedContext, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()"}
When ever I click the + button I get the following error.
:10002/umbraco/lib/angular/1.1.5/angular.min.js?cdv=1188176083:63 TypeError: Cannot set property 'id' of undefined
at initNode (:10002/App_Plugins/NestedContent/Js/nestedcontent.controllers.js?cdv=1188176083:286)
at Object.$scope.addNode (:10002/App_Plugins/NestedContent/Js/nestedcontent.controllers.js?cdv=1188176083:84)
at :10002/umbraco/lib/angular/1.1.5/angular.min.js?cdv=1188176083:74
at :10002/umbraco/lib/angular/1.1.5/angular-mobile.js?cdv=1188176083:270
at Object.e.$eval (:10002/umbraco/lib/angular/1.1.5/angular.min.js?cdv=1188176083:92)
at Object.e.$apply (:10002/umbraco/lib/angular/1.1.5/angular.min.js?cdv=1188176083:92)
at HTMLAnchorElement.<anonymous> (:10002/umbraco/lib/angular/1.1.5/angular-mobile.js?cdv=1188176083:269)
at HTMLAnchorElement.x.event.dispatch (:10002/umbraco/lib/jquery/jquery.min.js?cdv=1188176083:5)
at HTMLAnchorElement.y.handle (:10002/umbraco/lib/jquery/jquery.min.js?cdv=1188176083:5)
It was working with the Umbraco package but not when switched over to MyGet
Given you have an MNTP in a nested item.
Given you have previously selected one or more items in the MNTP.
When you open then close then open that nested item...
Then the +Add
disappears, and you cannot add more items to the MNTP
Scenario:
I have a Document Type with a Macro Container on it as well as a Textbox (for the title of the content) that I'm using as a Nested Content template. If I try to associate the macro and then enter a string in the textbox, the macro will be correctly captured as part of the data.
However, if I fill in all the other details and then select the macro right before saving, the macro is not saved, and if I don't touch any of the other fields the macro will never be captured.
Reason:
The MacroContainer does not assign the macro details back to the model.value until the formSubmitting event has been received:
https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/src/Umbraco.Web.UI.Client/src/views/propertyeditors/macrocontainer/macrocontainer.controller.js#L88-L95
var unsubscribe = $scope.$on("formSubmitting", function (ev, args) {
var syntax = [];
angular.forEach($scope.renderModel, function(value, key){
syntax.push(value.syntax);
});
$scope.model.value = syntax.join("");
});
This means that the macro isn't updated until after we've saved the NestedContent value
I also tried fixing this by adding in the same sort of unsubscribe handler to try and capture the macro value on formSubmit, but that didn't work because of the sequence the event handlers are triggered in.
In a nutshell: The only way that a macro container will save the macro in a NestedContent property is this:
I've spent 5 hours trying to get the NestedContent property to postpone the model.value building until after the MacroContainer has a change to save it's property values properly with no luck. I now know a lot more about $broadcast and $on than I did 6 hours ago.
Heya,
Lovely package. Would you consider having it support multiple doctypes? I have a working implementation of multiple doctypes that I can push as a PR if you want it.
Regards,
Kenn
Hey guys, Not sure if you want this, but in Merchello I've now "borrowed" your icon styles in an attempts to keep unified with the back office and with some of the great property editors (like NC) out there.
In Merchello, I needed to add a few more that were not as obvious as edit, move and delete so I added localized titles to the anchor surrounding the icon (i). I've updated my fork of Nested Content to include these for you to evaluate and decide whether or not you think it's a good idea.
Will submit a pull shortly.
Could your PropertyValueConverter be causing this problem?
To get an image from a Media Picker I use:
IPublishedContent image = Umbraco.TypedMedia(Model.Content.GetPropertyValue<int>("image"));
However, after installing NC v0.2 the inner statement:
Model.Content.GetPropertyValue<int>("image")
returns 0 and I must use:
IPublishedContent image = Model.Content.GetPropertyValue<IPublishedContent>("image");
or
Model.Content.GetPropertyValue("image")
I'm using Umb version 7.4.3 and I believe the native PropertyValueConverters were already installed by default and the change in behavior was not until I installed NC.
Hi
Great Package but Upload datatype is not working.
Thanks
Perhaps parent is not the correct term.
But I'd like to get a handle on the node in the tree where the content is edited.
I'm only nesting one level deep so that simplifies things.
I see this discussed in #7 and #8 and it looks like I should be able to find the value I want in the .Parent
property as of version 0.2.0, But that gives null.
Here's how I get my nested content:
public static IEnumerable<IPublishedContent> GetPropertyAsContentCollection(this IPublishedContent node, string alias)
{
var value = node.GetPropertyValue<IEnumerable<IPublishedContent>>(alias, null);
return value ?? Enumerable.Empty<IPublishedContent>();
}
It seems that the id's of the input fields not are unique enough.
E.g. I have a textbox with alias transportName
, therefore it use id="transportName"
and for="transportName"
on the label.
But because it is used for each item in the list, it will only focus on the first "transport name" input. Furthermore it might be an issue if there actually was added a property to the node with alias transportName
.
So make it more unique, e.g. something like:
nested-{{alias}}-{{$index}}
I upgraded a site from Umbraco 7.2.4 to 7.4.1 ... afterwards I upgraded Nested Content package from v. 0.1.1 to v. 0.2.0, but due new changes to support multiple doc types, Nested Content doesn't map the data for the existing content and therefore no items in the editor, although umbraco.config has the old json.
Is it possible to map the old values for doc type, tab and name template for the new multi-items config?
At the moment I have to manually select the doc type in dropdown, an enter the values for tab and name template.
Being able to identify the host (top / real) IPublishedContent and the index (which could be a tree!) would be really helpful
An issue was raised on the forum about NC not working with Umbraco 7.3
I am working with Nested Content, as per my requirement I need to have a dropdown list multiple , based on these values I have to populate the data. But for some reason, my dropdown list multiple in Nested Content is not holding the selected values. Could you please suggest me with regards to this issue.
@mattbrailsford An issue was raised on the forum - Rich Text Editor (TinyMce) in NestedContent.
I am able to reproduce the bug, which only happens in a specific scenario.
Steps to reproduce
The key part seems to be when the RTE is modified after the item has been moved. If I modified the RTE value, then move it, all the items persist correctly.
Any ideas?
Hi,
I have added a custom property on a document type and i need to load certain type of datas based on document type how can i achieve this on my custom property? its just a simple dropdown, i want to know what kind doctype alias and pass it to my web api Thanks
Hey guys. The editor works in Umbraco 7.4 however there have been some updates to the layout of the back office. When you have Nested content inside nested content it renders the add content button incorrectly. ;)
hello
First of all I wanna thank you for making this awesome package! At the moment iI am developing a lot of website in umbraco which consist of blocks. Your nested content plugin comes in very handy because the blocks can now be added/edited on the page itself instead of in Media or a child content page.
I know there is currently no support for the image cropper functionality but I think this will be a great functionality! Unfortunately because of my lack of Angular knowledge I can't try to add it myself.
Now my question is: Is there a chance this functionality will//can be added on the short term?
I hope you guys can answer my question!
If a new row is added to Nested Content it would be nice if an event is fired so we can modify it. For example set the current date on a date field. More info in this Twitter conversation: https://twitter.com/j_breuer/status/636470103610138624
An event after a row is removed is probably also nice.
I love Umbraco's support of Dynamic because it simplifies readability of code from this:
@foreach (var class in Model.Content.GetPropertyValue<IEnumerable<IPublishedContent>>("classes"))
{
<li>@class.name @class.code @class.location</li>
}
to this
@foreach (var class in CurrentPage.classes)
{
<li>@class.name @class.code @class.location</li>
}
It seems that if the tab-alias (entered in the DataType prevalues) is a different casing to the actual DocType's tab alias, then the DocType properties wont be loaded on the editor.
@bkclerke hit the issue when upgrading from v0.1.1 to v0.2.0 ...
https://our.umbraco.org/forum/umbraco-7/using-umbraco-7//68066-upgrading-nested-content-package-and-items-disappear-in-umbraco-content-tree
@mattbrailsford Is the tab-alias check done in the JS? I found it in 2 places: controller and directives.
Can't upload a screenshot due to doc type having sensitive content, but at a browser width of <~1210px down to ~1118px (when the left tree disappears) the nested items are being obscured and there is no horizontal scrollbar. The nest content type has two textstrings and a textarea (textstring multiple).
Same (less of an issue) with anything <~850px wide which makes it not tablet friendly (I think?).
It's nice that you can hide the label but then I also lose the helptext for the "parent property". Maybe have an option to stack the nested property under the label+helptext - understand that could make things a little cluttered though.
Awesome work.
I am trying to detect if any of the content has changed but it always responds "true" when I check using .IsPropertyDirty, even when none of the data within the nested content control has changed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.