get 2sxc app data from different portal DNN - dotnetnuke

We are setting up different sites as portals in DNN. Some content will be shared across the different portals.
I'm using the following method to render 2sxc data in a page
http://2sxc.org/en/blog/post/using-2sxc-in-webforms-custom-webapi-or-other-razor-hosts-300
However, now i want get the same data in another page of a different portal.
Can any one help with the code so i just put in the source portal id and it can be rendered in a different portal?

Yes, this can be done :)
There's an App Data DataSource, where you can specifiy the portal and app-id (in 2sxc 8.5+). Use this in a visual query or in your code.
http://2sxc.org/en/Docs-Manuals/Feature/feature/9266

Related

Is it possible to share 2SXC Content modules between portals on the same DNN instance?

2sxc 11.x / DNN 9.x
I have a DNN instance with a portal with lots of Content modules with different Content Types and Templates. I'm going to be making a second portal that is related to the first portal and there is some shared content. Is it possible to allow the first portal to share it's 2SXC content types and templates with the second, new portal? If so, how?
There are a LOT of ways to do this, and unfortunately there is no good guidance document 😟.
Your scenario sounds like what you would need Ghost-types for: one app creates the real type, the other app just has a ghost-reference for the original type. This is a common way to solve this - and yes, it's a very well kept secret 😉.
But I went ahead and created a checklist, just for you 🚀 https://azing.org/2sxc/r/Pj4GMYY5

DotNetNuke (DNN) and Hyperlink Manager "Track the number of times this link is clicked"

I have clients using the DNN CMS (Evoq Content 7.3.2) system and are questioning a specific area in the "Hyperlink Manager". There are two checkboxes (View image):
Track the number of times this link is clicked
Log the user, date and time for each click
If checked, where do we go to view these analytics?
I found resources online that mention we have to create an API for it, but are there any out-of-the-box solutions for this?
After some more researching, I solved my own problem and I wanted to share this with anyone who was looking for an answer to this.
For versions DNN 7.3.2 and lower, the Telerik RadTextEditor includes the feature as mentioned above. To view the analytics with an out-of-the-box method, simply return back to the link and open the "Hyperlink Manager" then navigate to the new tab called "Tracking".
Alternatively, I found developers can implement a control in a custom module called UrlControl. Refer to this link for more information: Link tracking information in html editor (DNN 7.1.2)
In DNN 8+, this feature no longer exists on the front-end UI. I'm not 100% sure if it's still usable or if this information gets migrated when upgrading from 7 to 8, though.

Referencing Another App

What is the best way to reference another app in the visual query designer?
I am using the blog app and I created a second app to list the tags that are used in the main blog app. This way when the app goes to a detail page of a post, I can still have the tags listed on the website without the view changing automatically. I set up my blog tags app with a visual query that list all of the tags used in the main app. Everything was working fine in development.
The problem that I have run into is that when I move the app to a production site the AppId was different than the one I was currently using and development. Now, the tags app is showing an error and I am not able to get into the settings to change the app ID of the visual query to the proper one in order to get the information needed. Is there a better way that I should be handling this?
This sounds like the right way to do it - your main issues is getting into the admin-ui when the template you have shows an error.
I suggest that you quickly rename your current template (so it's not used till you fix the bug) and create an empty template with the original name. This way you can go to the normal settings.
Another option is to switch into dnn-edit-mode, and use the black-dnn buttons to get to app-admin.

Deployment of new pages from Local to Production

I've a copy of DotNetNuke website on my local machine in which I've added few pages and created new modules.
I've to move these new pages to production so have copied the pages to respective folders. I know there are few database entries that are also to be made on production database to recognize these pages and modules on production.
Please tell me how I can register these pages on production website
I searched on Google but may be I'm not getting the right keywords to search. Currently I've to restore my local db to production to run those pages. I'm using version 7 of DNN
This isn't something that DNN handles very well, publishing from a local environment to production.
The most common way (Besides backup/restore of the database) is to use page Templates. You can "Export" a page in DNN, that will generate an XML document with the modules and content referenced into the portals/#/ folder (where # is the portal id)
You can upload that file to your production site (same path) and then create a new page based on that page template.
Your question implies that you are creating .aspx files and copying those to the production server. That really isn't the way that DNN works, and you probably are creating a real mess.
How did you create the pages on your local site? Did you use the DNN functionality to create new pages, add modules to those pages, etc.? Or, did you do something else?
Use the built-in funtionality to create pages on your local installation and, as Chris
To add modules - Go to your web site in production, login as super user, and install the module, then go to the page in the web site and add it. The same as you would do with 3rd party module. This will properly add the info to db.
To add pages - You could do it within the code, using the
To create DNN page (the tab):
TabController tbc = new TabController();
//...populating the page's info
tbc.AddTab(destinationTabInfo);
To create ascx control as global (meaning doesn't belong to any module) ModuleControl.
var moduleControl = new ModuleControlInfo
{
... populate the fields
};
ModuleControlController.AddModuleControl(moduleControl);

Use the plugins layout instead of the apps layout if it is available CakePHP

We have developed a CakePHP (1.3) application which works fine. Before usage users have to login. Nothing new there.
We also created a plugin containing a "sales website". It's styling is completely different from the applications design. The sales website works ok, but the loginpage is now based upon the applications layout (path: /users/login). We would like to apply the sales websites layout. But only when the plugin is available.
Is this possible? And if so, is it possible without the need to add a login method and/or users controller to the plugin?
You can use App::objects('plugin') to get a list of available plugins in your app. just do an array_search fro your plugin name and switch the layout accordingly

Resources