开发者

dynamic content on pages

I'm trying to migrate all "content" pages on a website to DNN5 Pro.

So I just created all the pages in DNN, added HTML module to the ContentPane and copied and pasted the HTML content from old pages.

The problem is that most of the pages have bits of classic asp code which do some minor server-side tasks - for example, populate tables with prices fetched from DB, pre-select user's country based on his IP address, do some basic dates calculations, etc.

Obviously, this code won't work in DNN.

If I had to migrate to PHP, I'd just rewrite these bits of code from classic ASP to PHP, then assign values from PHP to smarty and then would use them in templates.

But as DNN has a completely different architecture, I can't see how similar approach can be used.

Token replacement feature in HTML module looks like what I need, but it allows to "map" only tokens pro开发者_StackOverflow社区vided by DNN.

So, maybe anyone had similar issue with DNN and/or knows how this should be done.


It seems like you are attempting to subvert the entire point of DotNetNuke. While certainly there are a variety of hacky ways you could try to make this work just like the php site, it's a terrible idea to do so.

Instead, you need to evaluate each of the dynamic sections of the php site and find or create a DotNetNuke module that will replicate that functionality.

To make the initial conversion quicker, you can build modules you create using simple ASP style inline scripting but you should definitely use existing modules for things like displaying data in a grid.


You could write code directly in your skin file. Do some logic like:

<%If PortalSettings.ActiveTab.TabID = 33 Then

//code here of what you want

End If%>

Where 33 is the page id for the page you want to run custom code on. There are other ways to do this like creating skin objects, or creating custom modules, but this is probably the easiest thing to do. Just write code directly in you skin. Or make a copy of your skin for each page you need to do custom code for... again, more elegant ways but this will get'er done.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜