Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
This is awesome! Should be part of the core offering. Very nice work Morten!
Looks great, but maybe better name for package was "default Values".
also should be great if you can use xslt to create value - for example you need parent name, or create it only under some parent or you vant use directory.
I agree with Petr, using an xslt value would make it invaluable!
I source available?
Ops! Should have been:
Is source available?
@Marco: I will upload the source code shortly. I just wanted to wait and see if any bugs arose after release before I put it up for grabs :)
@Petr: You might be right about the name, but I guess I'm just used to calling it standard values.About the xslt stuff, I'm not sure I understand your suggestion correct. To me it seems a bit overcomplicated to use xslt to add standard/default values to a new document. Do you have any other examples then using Parent node name (which I could easily add a key for, i.e. $parent$)?Maybe a couple of usecases?
Hi Morten, some use cases, which come to my mind:
- Auto Counting - you can automatically count your nodes based on no of childs of parent
- Simulate owerride - copy property from parent and user then can change it.
- It allow using dictionary
- it allow use umbraco.library and custom xslt extensions.
Some valid points indeed. I'll try and implement as much as possible.
Yeah, dictionary items sound like a great idea, thumbs up.
@Petr I have tried to find a solution for using xslt, but I don't believe it will be possible because of the simple fact that a standard xslt renders content based on currentpage. The currentpage variable can only be a published page, so when creating a new page the page is off course not published.I tried any different things, but everything seems to come down to the currentpage starting point which I don't have.
If you have some concret ideas or suggestions I'm open to try it out. But untill then I will add some specific library methods that can be used by creating your own custom keys and specifying a type in a .config-file. Aside from that I have Xpath working in an instance of the cached content (data.config), and the dictionary is working when specifying a culture (en-US, da-DK etc.).
Morten Christensen this is an amazing package! Thanks for sharing!
In the newly released version 1.1 it is now possible to use dictionary items, and to use XPath to select published nodes.With regards to XPath you should be aware that you have no currentPage variable, as the document that you are creating when using the standard values features hasn't been published yet. - And it didn't seem like a good solution to create a new/temp xml with all nodes (published and unpublished) to be able to use XPath like you normally do in an xslt.
But any way, go check out the updated version, read the description on the package page and let me know if you have any questions.
@Marco Source code is now also available for download.
Should be core functions!
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted