Is it possible that i can i place a check in my module code seeing where my module is installed. (contentpane or rightpane or leftpane).
Basically if it is installed in the left or right pane i want to bring only 3 records to the display in my gridview and if it is installed in contentpane i want to bring all the records to the display in my gridview. is it possible? maybe can someone share any different technique by which i can achieve the above scenario in my module code.
2) how can i get the module id by only modulename in my c# code?
You have a variety of options that I think would be better than having the module try to figure out what pane it is in:
You add a setting where admins could specify the number of records to display
You could do the above and add a Pager to it so users could get to additional records
You could make your module a fixed height and set overflow:hidden or auto so users could scroll within the module.
You are looking for
PortalModuleBase.ModuleConfiguration.PaneName
Building a module in this way will couple it very tightly to a specific skin. ContentPane is the only pane name that is sure to exist. Skinners can make up any other pane names as they see fit.
[2] In your module, you can directly access ModuleID because the base class PortalModuleBase is already having that value.
and for 2 I am not sure but you can do me.parent.parent in debug mode because me.parent will be a container control and it's parent will be the pane. Casting it to pane may get it's name.
I don't know standard method to get that.
Related
I am developing a Drupal 7 site with a home page that consists of 5 regions. Each region will need to be editable within the Drupal admin system. Each region at a minimum will need to have an image upload and a text/body field. There may be other additional fields for certain regions. In other words not all of these regions will need the exact same fields.
I am not sure what the best way to set this up in Drupal is. I looked at Blocks but they don't have the ability to customize the fields. And I need my image field to be separate because it will be used as a background image for the region, not displayed inline.
I considered creating a custom content type but I wouldn't want the content editors to be able to create multiple nodes for a given region which would likely cause confusion.
I did see a module Node Limit that seems to limit the number of nodes that can exist for a user or content type but it is still listed as an alpha module.
What have you done to deal with a similar situation?
It sounds like creating a custom block would serve you well. It's very easy to do, you can add your own form/fields with hook_block_configure() and hook_block_save(). Here's one of my module files that includes custom block with a config form.
You could also possible use the Display Suite module to add fields into a region, as explained here.
Display Suite is good for configuring a node's fields in a presentation layer.
But your problem could be on the top of that... Maybe your problem is content building, and one of your most powerfull & flexible options is the paragraphs module.
With paragraphs you must create a content type, with the paragraphs bundles inside of it as a field, then create a page and set it to be your front page. Then customize these node types presentation with Display Suite as you need.
I know a content type for a page sounds too much, but depending on your situation this could be your best choice.
Paragraphs module and the Display Suite Module are very powerful together when you need powerful content creation and advanced theming.
If you have any doubt just ask.
Hope that helps.
I am trying to create a tree view in Drupal 7.2. I've scoured the internet and I found something about adding a view but I do not see anyway to create or add a view. When I go to add content there isn't an option to incorporate the tree view module. I have checked to make sure I have all the modules required installed and enabled. Any help would be much appreciated.
The views option is in the Structure menu, you can simply type "yourSite/admin/structure/views" . If even though you don't see it, double check that you have installed the Views module.
There is a views tree module for that
Please find below the project link
https://www.drupal.org/project/views_tree
I have been using DotNetNuke for a couple of weeks but there is one thing I can't figure out. How can I find out which pane a module currently resides in. I have used mostly version 7 but I have tried version 6 too. I can't find this information anywhere.
When a page is in Edit Mode in 7.x there is an option to move a module to a different pane by hovering over the Move Icon. DNN displays a list of panes where the module can be moved when the mouse is over the Move Icon. DNN knows what pane the module is currently in because the current pane is excluded from the list. However, under the Settings for a module there is no property to tell you in which pane the module resides.
This is really important because most skins have LOTS (20+) of different panes. Usually panes are collapsible it is quite hard to tell which pane a module is in based solely on the position of the module on the page. Knowing the current pane of one module is required to get the correct layout when you add new modules.
The only thing that works is to use process of elimination. I can figure out a module's current pane if I can find which pane is NOT in the list of panes where I can move that module. This method is tedious and un-usable if you are trying to work with modules via the Page Management admin screen. Am I missing where to find this property or is not available. If it is not available then is there are better way to position items that I am missing?
Layout Mode should show you the PANE names. If you don't have Pane Names then it is possible that the Skin you are using has hidden the the name of the pane, but why they would do that I don't know.
Here's an Example of one of the Panes in my MultiFunction skin (available on codeplex) when in Layout Mode
TopPane
I want to know about Drupal 7 module "Panels", and to know how to work on it, how it is useful in creating panes and customising it.
like the right top side in the below website. http://www.newsclick.in.
I would recommend you to look at this screencast:
http://dev.nodeone.se/node/770
Not just Panels but also how it works with page manager and views.
Kristoffer is correct. Looking at the right side of the website you linked, a lot of the functionality is found in views. You might use panels to handle appearance and views to address content. They work together very well. If your new to Drupal, I suggest you focus on the functionality and deal with the appearance after. Nodeone also has an excellent video series on Views called "Taming the Beast" which you will want to study before attempting to link views and panels.
Panels are mostly used to create customized layouts for multiple uses. You can create a page having different regions. It has a drag and drop content manager. Please read Panels module
I am considering building a application using PRISM (Composite WPF Guidance/Library). The application modules will be vertically partitioned (i.e. Customers, Suppliers, Sales Orders, etc). This is still all relatively easy... I also have a Shell with a main region were all the work will happen but now I need the following behavior: I need a menu on my main Shell and when each one of the options gets clicked (like customers, suppliers, etc) I need to find the module and load it into the region (Only 1 view at a time)?
Does anybody know of any sample applications with this type of behavior? All the samples are more focused on having all the modules loaded on the main shell? And should my menu bar also be a module?
[UPDATE] How do I inject a module into a region based on it being selected from a menu? All the examples show that the module injects the view into the region on initialize? I need to only inject the view if the module is selected on a menu?
Yes PRISM will help you out here.
A number of things here worth mentioning.
RE: Is Prism right for me?
You can load a Module on Demand. PRISM has the capabilities of loading a module at RunTime, so in your case if you bootup the said solution using Shell and ModuleA. Your user then triggers an event (ie Menu choice) it can then allow you to dynamically load ModuleB and then inject that into play. To be clear though, you really need to sit down and do your homework here as you need to ensure ModuleB doesn't have any of its own dependencies on other modules etc (typically its wise to use an Infrastructure Module. I've used techniques where i have a manifest of modules that i lookup in XML that lists its absolute dependencies and then I make sure they are loaded first, then I load ModuleB).
See Load Modules on Demand via PRISM help docs (Development Activities). Also lookup Prepare a Module for Remote Downloading
RE: Injecting a view at runtime
To inject a View into a Region via Menu is a simple case of accessing the IRegionManager and then adding it. To do this, make sure in your Constructor for the said ViewModel/Presenter/Controller you're using put:
MyConstructor(IRegionManager regionManager, IUnityContainer container)
As with PRISM you can pretty much add any object you want into your construct and PRISM will ensure it arrives there on time and on budget (hehe).
From there its the normal approach you'd take with adding a view... eg:
IMyViewInstance myViewInstance = this.container.Resolve<IMyViewInstance>();
IRegion myRegion = this.regionManager.Regions["YourRegion"];
myRegion.add(myViewInstance);
myRegion.Active(myViewInstance);
And all should come together! :)
Note:
Make sure you set a local reference to the container and regionManager at Construct (this.container = container etc).
If you're not sure where the above namespaces exist, right click on IUnityContainer for example and let Visual Studio RESOLVE it (right click menu)
Put the Add logic into your Menu Event that or use a central method - whichever blows your hair back :)
Scott Barnes - Rich Platforms Product Manager - Microsoft.
Just finished watching Brian Noyes on Prism at dnrTV. This answered all my question...
It's not clear what you mean saying "find the module and load it into the region". You can load module's view and add it to shell. Composite UI app block and CompositeWPF are built on top of the IoC pattern. It means that your modules should inject their menu items in shell's menu strip or subscribe to events generated by shell.
You could have your main region be a ContentControl, this way only 1 view will be active at a time.
You can also load your modules "On Demand". There is a Quickstart that shows you how to do this. You should also keep in mind that if the module was already initialized once, initializing it for a second time will not execute the Initialize() method on the module.
It might be useful that when you click on the menu, this will load the module on demand (which will not load the view yet) and then you can fire an event through EventAggregator, so the module can now add the view (use the named approach for not adding the view twrice) and the Activate the view (which will make sure the view is shwon in the region).
Hope this helps,
Julian
to save you time, check John Papa's Presentation Framework article. It will be more easy if you have 3rd object(Screen Conductor) to handle your screens in showing or hiding from regions.