Copying Page with 2sxc content doesn't copy the modules

*爱你&永不变心* 提交于 2019-12-25 07:17:29

问题


I have a page with several 2sxc content modules. After copying the entire page (using the Page menu in DNN), the new page loses all of the content and even the module assignment (Data and View). This seems like a bug.

Using the Export Page/Import Page method, the resulting page retains the module data/view assignment. However(!), the data referenced by these modules is pointing to the same data from the original page. You edit the data on the new page, the data on the old page changes.

Can someone tell me what the proper way to copy a page is?


回答1:


The first thing - page not copying modules - is strange and sounds like a dnn bug. Could you post more about what versions of dnn/2sxc you were using?

The export-import behavior you describe is technically correct. There's extensive documentation on export import - check it out here: http://2sxc.org/en/Learn/Import-Export

Now exactly your use case is one which doesn't "just work" because dnn-export-import or copy-page don't provide enough options or code-events for 2sxc to ensure doing what you need. Basically there are two challenges

  1. pre-populating the already entered content...
  2. but possibly (very likely) not by pointing to any original material - it the most extreme case it would have to copy all the elements, images, etc.

At the moment this is simply not implemented, but could be if needed, it's just 2-3 days of coding/testing to get it to work.

What you probably need though is something simpler: usually people want a template-page which can be re-used for new pages. This can be done fairly well because every 2sxc-module can show demo-data (so not have own data yet), and if it's copied in this mode, then later adding of data will have it's own copy and not link to existing. So what you would do is

  1. create a template page with all modules, but make sure you always only close the view-picker, but don't add data yet
  2. export it, so it's ready for import

that's it :) hope it helps.



来源:https://stackoverflow.com/questions/39988175/copying-page-with-2sxc-content-doesnt-copy-the-modules

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!