You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But in the newer 2sxc with CmsContext, these @Dnn.Tab.Whatever don't work anymore. I try using @CmsContext.Site.PortalName but there isn't a clear mapping from the old ones to the new ones.
I found that HtmlPage.AddOpenGraph("site_name", @CmsContext.Page.Url); works as expected but very few others that I'm trying to convert work.
When I use the Snippets in the sidebar, it's still adding old code like Dnn.Tab.Url which is outdated.
Expected behavior
The snippets needs to be updated so we know how to get those values.
Instructions to Reproduce the Problem
Use the new 2sxc 12.5 and try to use the snippets to display the DNN Site Portal Name.
Why change the behavior?
Out of date / I don't know how to get these things via Razor anymore.
Your environment
2sxc version(s): 12.50
Browser: [all ]
DNN: [all ]
Language: [any/all ]
Anything you would like to add
The text was updated successfully, but these errors were encountered:
BTW: the old behavior will still work of course if you use an old base-class for the razor files.
If you use newer base classes then you can always use @inherits Custom.Dnn.Razor12 in which case the Dnn object will still be available. In that case you can use the new IPageService and still use the @Dnn... variables.
@iJungleboy Ahh, that makes sense. Since originally posting, I realized afterwards that I did have the old things working in other templates and was so confused. Appreciate the help, thanks again!
I'm submitting a ...
[x] bug report
...about
[x] Razor templating
Current behavior
I have an app that uses the OpenGraph code. It looks like this:
But in the newer 2sxc with CmsContext, these @Dnn.Tab.Whatever don't work anymore. I try using @CmsContext.Site.PortalName but there isn't a clear mapping from the old ones to the new ones.
I found that HtmlPage.AddOpenGraph("site_name", @CmsContext.Page.Url); works as expected but very few others that I'm trying to convert work.
When I use the Snippets in the sidebar, it's still adding old code like Dnn.Tab.Url which is outdated.
Expected behavior
The snippets needs to be updated so we know how to get those values.
Instructions to Reproduce the Problem
Use the new 2sxc 12.5 and try to use the snippets to display the DNN Site Portal Name.
Why change the behavior?
Out of date / I don't know how to get these things via Razor anymore.
Your environment
Anything you would like to add
The text was updated successfully, but these errors were encountered: