How can I create a 2sxc app that has a listing and details that open in a modal? - dotnetnuke

I want to create a 2sxc app that has a listing of items. When a user clicks on an item, it should open the details view in a modal window.
However, I don't want to simply load all items into the page and have a JS open the modal. Ideally, I would want the modal to load the content only when it's called. Also, ideally the URL would still in place similar to how there's a listing and details templates in an app.
Is this possible?

Yes, this can be done :)
It basically needs 3, optionally 5 steps
Open a DNN page without a layout
(optional) make sure only your module will be on the popup using mid=... parameter
Make sure you add the id/name-id/guid of the details in the link such as post=...
Create the razor view which shows the details, ensure it appears when the parameter is added
(optional) Create different urls for google / user so user sees the popup, google indexes a real page with the details view
1. Empty Skin / Layout
The trick is to open the page using the DNN parameter to either switch to the layout-free skin (print), or to another custom skin. This allows you to start with an "empty" page without stuff around it. Either use popUp=true in the url (the Up must have an upper case U) or a skin parameter to choose another skin
2. - 4 MID, url-parameter, name in url to select view
This MID is common - if you have mid=... DNN will not load any other modules on the page.
Same with the named url parameter for the details-id and view switching, so I won't document this in detail.
5. Different details for Google vs. Interactive
In case you want google to index the details view, that would probably want the indexed page to have a layout. So create a link to the details without the special popup, and on-click only change it to open the link with the popup feature.

Related

Django CMS only one entry in model

I want to make a persistent floating(using CSS) contact button on every page in Django CMS.
I need to get the first item in DB and construct the URL according to it in the template.
Also, the place holder should display first item and allow editing it everywhere if possible.
Or maybe not have an input at all and allow editing the contact info in the admin.
Or have an option to use the first one which is default or a different number for a particular page.
I have currently made my plugin but it creates a new entry every time.
If you want something to appear on every page you need to make use of static_placeholder (docs) which acts like a normal placeholder but you only need to add plugins to it on one page for them to appear in every page which you include the static_placeholder of the same name.
For example I often have a footer which includes a menu & allows a client to add their own content like contact address, phone number etc. The easiest example of how you could do this would be to include the following template tag in your base.html so that it gets included in all pages inheriting your base template.
{% static_placeholder "footer" site %}
Also the standard placeholder tag doesn't work in apps, so if you include apps in your CMS site via app hooks you can also include the static_placeholder in the app templates to add plugins.

How do I modify Drupal's Admin Screens?

I'm looking to edit Drupal's admin pages.
Some of the things I'm trying to achieve:
Remove is the the filter setting on the Content page/node/view. In other words, if I go to to the Content page and I filter by a certain type of node, then I leave that page, then come back, the filter setting is saved, I'd like it to reset each time I visit the Content page.
I would like to modify some of links associated with these pages, as an example on that Same Content page, the titles of the pages are linked to their 'front-end' views, I'd rather have them link to their 'edit' screens.
While I have been successful in modifying the front-end theme of Drupal, by editing the actual php files. I can't find the the same php files for the Admin theme. In our case we are using Seven (7.21). I've read something about views, and thought maybe the entire Admin theme is built as views, aka there no php files involved like the front-end theme has, but under the Views section I did not find any either. I'm still pretty new at this and coming from the Wordpress world, this is a Drupal is a lot different.
The logic for that section of the admin area is at (from the public root):
/modules/node
Specifically "node.admin.inc"
That being said, I don't recommend editing core scripts, as they will be overwritten when you update the core.
You could explore making your own module to supplement that page, or your own view or explore some pre-made modules, such as "Admin Views"
Find de view displayed and go to its configuration :
1 - Edit configuration view like suggested here : https://drupal.stackexchange.com/questions/44440/how-to-remember-exposed-filter-choices
2 - Rewrite output views to rewrite link : field https://www.drupal.org/node/1578524
Another option is to create and use your own dashboard/views to achive like you want http://definitivedrupal.org/suggestions/creating-custom-administrator-view-content
also you can see contrib module : https://www.drupal.org/project/admin_views
You don't have to use that default content overview page at all. Make your own instead:
Make a page view (you have to install views module if you already did not: https://www.drupal.org/project/views) and use table layout. Make sure that page paths starts with "admin" so it will use admin theme. Also pay attention about permissions, so only specific set of users (admins) can use it.
For that view you can freely select what columns you what to show. You can also allow ordering by any column and action if you click on some field.
Use exposed filters to add filtering form, again add any filters you need. You can even set the form to use AJAX, to do auto-submit when some filter field is changed, include reset button and more. Also for every exposed filed you can select (at fields settings) should it remember it's value or not.
At end, edit admin menu and add your new page to it so it will look and act as default one but will offer much more functionality. You can even totally remove default one from the admin menu.
Views module is very powerful, not only for front-end but also for back-end content handling.

Display content from sub pages

I would like to make sub pages under and existing page. Lets say the page is "Success Stories" and under this page the user can enter in other pages and format them any way they want. What I need is a way to make a repeater of all these subpages with stuff like the page title, a little bit of the content, and a button that links to the actual page.
Is this possible out of the box? I am willing to buy a module if it is reasonable;however a Google search returned no results.
Thank you.
The best option I know is Child Links from Ventrian.
You can show all children with title and description & links. (NOTE: description is Page description NOT content from the page.)
what version of dotnetnuke are you using?
Two options:
ONE
There is a copy page function where you can choose what modules and setting to copy to the new page.
Under the pages menu - click copy page
then you can select what page to copy from, and then it will list all modules on that page. You can choose to copy the module with or without content or even reference the module on the source page.
TWO
Other than that you can create a page template that a user can select that is pre-designed by you. Create the base page the way you want it and then click export page under the page / edit page menu depending on your version. A template will be created in your portal template folder that can be used when creating new pages.
If you are looking to automate this process, then you will have to look into a custom module or design a sql script you can run yourself (but this is a lot more maintenance as it can change with every version.)

DotNetNuke 5: How do you edit module content in DotNetNuke 5?

How can I edit modules in DNN5? I have previously used DNN4. It is not obvious to me what to do now.
There isn't anything that has changed substantially between DNN 4 and DNN5 in terms of editing module content. First, make sure that you're logged in with a user who has edit permissions to the module. Then make sure that you're viewing the site in Edit mode (the radio buttons on the top left). Then, there will probably be an "action menu" in the top left corner of the module's container, from which you can access the module's edit page.
If you're still having trouble, it may be that you're using a container that doesn't have the standard action menu. You can try changing the container for the page or the site (in page or site settings) to see if that addresses the issue.
Finally, which module are you trying to edit content in? Is it an HTML module, or some other module?

dotnetnuke: can we create a master page?

Can we create a content managed master page in dotnetnuke?
eg. I want the right pane and bottom pane to be content managed, but to show the same thing across all pages.
Thanks
What you are describing is essentially what DNN calls a Skin.
A DNN skin is actually just an ASP.NET user control (ascx) that dictates page-wide or site-wide look and feel, which offers developers the same functionality as a Master page, except that it ties into DNN-specific elements and uses some DNN-specific user controls, such as menu/navigation, logo, breadcrumbs, login/user account links, etc.
Now, in order to add the ability to provide content management capabilities site-wide, you specify an area in your skin to place a module (let's say, a Text/HTML module). This area is called a pane. Once you add a module to this pane, in its settings you can tell it to appear on every page. This way, the module can be edited on any page, and its changes will be reflected on all pages automatically.
Check out DNN's site, as it contains a TON of documentation on how to do many common tasks: http://www.dotnetnuke.com/Support/Documentation/DownloadableFiles/tabid/478/Default.aspx. Under the Technical Documentation section, you'll want to grab the Skinning document (I believe it's a PDF).
DNN Modules can be set to appear on all pages by checking a checkbox in the module settings. However DNN does not use the concept of a Master Page. It injects modules (user controls) in containers on a single aspx page at runtime.
A Master Page would be a great addition to DotNetNuke you cannot replace content in a single area of the page. The whole page refreshes. For example if you have a menu and you only want the content of what you select to appear in a specific content area without refreshing the rest of the page you have to resort to third party modules that attempt to do that but usually fail. There are 'module wrappers' but all the ones I've tested have issues with modules that allow the user to edit content. Edit screens are usualy different user control files (ascx) that are launched when you edit the module content. Since the page refreshes with the new page you have lost your place. Those module wrappers work fine for static content and some other controls but not for all controls.
IFrames can be used (DNN has one) to trade out content but that doesn't get rid of the probelms mentione above. I'm heavily invested in DNN, running the UCanUse.com web site so this isn't a slam on DNN. I just thought I'd try to answer the quesiton with detail.

Resources