umbraco7 - Proprieties added at run time but when i add Content and publish it shows at the front end only after i rebuild -


i'm using umbraco 7 , dynamically add proprieties tab called

master & detail last section

using logic var x = 0; foreach (var item in multiurlpickerdyn) { var tab = dt.propertytypegroups.lastordefault(t => t.name == "master & detail last section"); var pt = dt.getpropertytype(item.name + "m" + x) ?? dt.addpropertytype(sidebar, item.name + "m" + x, item.name + " 'master'"); pt.propertytypegroup = tab.id; pt.save(); pt = dt.getpropertytype(item.name + "d" + x) ?? dt.addpropertytype(sidebar, item.name + "d" + x, item.name + " 'details'"); pt.propertytypegroup = tab.id; pt.save(); x++; }

the proprieties added , can see them in office , cool when content in them , publish not show in front end shows after rebuild project the list item shows before build content not

after rebuild every thing shows know why ? please me i'm stuck

i searching @ wrong direction error getting data office using

@umbraco.field(item.name + "m" + x) wont work on run time

use var currentnode = umbraco.presentation.nodefactory.node.getcurrent(); @currentnode.getproperty(item.name + "m" + x).value;

update answer , approach wrong don't add dynamic @ run time bad practice yo can make user add documents type umbraco office , using currentpage.child list them in view umbraco newbie im sorry asking , answering while im not good.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -