accessing form fields in html module in dnn - dotnetnuke

in my dotnetnuke site, i have added a form and list module. And added the form containing fields name, occupation..., and records are added. will i able to get the values in another html module(row wise or column wise)

I'm not sure what exactly you want to do. What I understand is, you have listing of some object in one module and insert/update/delete in another module and you've installed both of them in same tab and now you wan to update listing module when edit module changes.
you can use IMC for implementing such kind of functionality.

No, you can't access the data from an HTML Module. But, you can certainly display the data in a variety of ways. If you want the same people who enter the data to view the data, just go into module settings and for "Appearance", select "Form Above List" or "Form Below List". That will cause the module to display both the Form and the List.
If you need more advanced control, you could also use the Reports module or a module like Efficion's Advanced Data Grid to display the data but you'll need to understand SQL pretty well to make those work.

Related

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.

Database search field database

I'm looking for a way to create a search box in wordpress, where visitors can search a number from the database. Is this possible? I have several package numbers in my database. I want to give my visitors the ability to search for their package number and request the information that comes with the number.
What you want to do can be done.
I suggest a different approach than using wp-exec. (I just looked at wp-exec website, and that plugin was created for WordPress 1.5, which means it hasn't been updated in about 5 years).
The content you want to display exists entirely outside of WordPress. I suggest you use a custom page template - see
http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates
In this case you would not use WordPress posts or pages or custom post types. On the custom page template you would write (or have written if you don't have the knowhow to do it yourself) PHP code to extract the info from the database and display it on a page.
For pages like that you would be using WordPress only as a container within which to display the results - they custom page would appear in the site Nav, The page of results would use the site's theme to display so it looks like the rest of the site.
But the code to display from the database would not use the WordPress loop. It would be PHP / MySQL data retrieval and display code.
I really doubt you will find a plugin that lets you display results from an external database, formatted the way you want them to appear. The reason is every external database is different, has different tables and table structures. And no two sites will want the external data visually displayed in the same way. So there is little generalization to encapsulate in a plugin as everyone wants it different.
I've created pages on some sites along the lines of what you want to do thus I know it can be done. But it requires writing custom code.

Creating an index page automatically

I'd like to have dotnetnuke build an index page based on pages that have a particular tabid. Are there any modules that do this already?
e.g. we create multiple pages under /News and then the index page lists links to all the news articles. Would be handy if we could also enter our own HTML text (maybe on the News article page itself) that is then displayed next to each link on the index page.
Thanks!
By default, there are no 'real' pages in DNN. Everything is served up in the Default.aspx from content that is stored in the database.
What you could do is create a module that populates data based on the TabId or Path. Then, there is a setting in DNN to make a module appear on EVERY page. Since the module is on every page, it could populate its data based on the TabId or the path, or just not show anything if it doesn't match your criteria.
For something like that, I used a module called SQLGridSelectedView from www.tressleworks.ca (I have no affiliation) and I wrote my own SQL to fill in the fields, and I defined a custom layout (instead of the default data grid) so I was able to do something like what you are asking without code.
There is a module from Ventrian called Child Links that does what you are talking about. You can use it to grab title & description from the pages below a relative to a specific page to build out menus etc.
It allows for formatting however you want as well.

Drupal 7: Add duplicates for form fields on the fly

I've got a form that's being generated using the Form API. There is a fieldset that contains several text fields. What I need to do is have a link or button that a user clicks if they want to add a duplicate of that fieldset to the form so they can add another set of similar information to the form. This is to essentially allow them to add multiple records without having to add each record individually. Is there a good way to go about adding this kind of functionality using the Forms API in Drupal 7?
There's a good example of this in the examples module package:
http://api.drupal.org/api/examples/ajax_example%21ajax_example_graceful_degradation.inc/function/ajax_example_add_more/7
It's a little complex, but that is very well documented, so you should be able to follow along.
You'll want to look at the entire ajax_example module (part of http://drupal.org/project/examples) for the relevant menu callbacks as well.

dotnetnuke clicking left bar opening page on the content pane(BEST PRACTISE)

ok i have created a picture gallery module in the left bar , there is a page viewpicturegallery.ascs . on clicking any image i want it details to open in the content pane in the middle . how would i do it.
can some tell me the process? i would made a new page or new module or what? for the details in the middle
here are some steps you can achive it:
create two controls in a single module for showing images and showing details for a single image and create two different definitions, each having a default view control as the one you want to show.
when you install the module in the page, it will show both definition controls in content page, you can re-arrange them in whatever panes you want.
search for inter module communication in dotnetnuke and grab a sample from net
you will find that there are two module definitions participating in the communication. Your list control will be the IModuleCommunication and your details view will be your IModuleListner
That's how you can achieve the things you want.
Please tell me if you have any other questions.
Short answer: use multiple DNN modules and communicate between them via querystring parameters, postbacks or IModuleCommunicator. Depending on your requirements, the details view may be possible to implement using a Text/HTML module and client-side tools like jQuery and plugins only?
More details on using multiple interconnected DNN modules:
You can define multiple modules in the .dnn manifest section.
This way, each interconnected submodule is part of the same install package, but you'll only have one visible module in the in the control panel's "Modules" dropdownlist. Adding this composite module to a page will add all the submodules, but you can remove any one of them independently of the others.
You should be aware that each submodule that directly inherits PortalModuleBase will have its own Settings object. If you want to share settings, you'll have to inherit from a shared parent ascx that inherits PortalModuleBase or write a function to read settings from another module in the same page (having the same ModuleID helps here).
Communication between modules can be based on querystring parameters, which is recommendable for opening a details view so that you can open it even if the gallery module weren't present. PostBacks let you use UpdatePanel, though. Modules in the same page can also use IModuleCommunicator interface for event-based communication. For example, I use an event calendar module with a "month view datepicker" module and a "list view of events" module. List view module communicates active days to the monthview via IModuleCommunicator. This way I can emphasize the active days with a boldface font in the datepicker. For more details on IModuleCommunicator, see Rafe Kemmis's blog post.

Resources