I've some troubles printing custom made widgets on top of icCube. Is there a special way to make custom widgets, created with e.g. D3, printable?
There is isRendered() method in every widget, it should return true only after widget is actually rendered otherwise it is possible that it won't be rendered in pdf.
Related
Currently, I have a dynamically created custom pie chart located at mywebsite.com/customchart that is created through a module I made using Highcharts.
I have view, that is listed in the views module shown in mywebsite.com/admin/structure/views/view/ which I would like to embed the custom chart into but I cannot find it through Add Header>Global: View area.
How exactly would one be able to achieve this? Programatically? How?
You can do it programmatically.
First you have to find out what template file is used for rendering the header. Easiest way: go editing your view, select proper display and then unfold "Advanced" options block on the right column and click "Theme: information". Here you can see what templates files are used (assuming you are using Drupal 7). The used ones are in bold. You can collect actual template code there so you don't have to find template file at all if you want to override it. And you can see file naming suggestions, so there you have everything you need to override template file.
If your theme is not overriding standard templates then you should do that - it's not good idea to change directly templates provided by Views module.
So, the first part would be finding out where would you like to embed the view, at what template and at what position. Second part is using function views_embed_view() for doing that:
https://api.drupal.org/api/views/views.module/function/views_embed_view/7.x-3.x
As you can see there, first parameter is machine name of the view, second of display and then you can pass parameters if your view accepts them. So call that function from proper place and you'll have your view embedded.
Also, there is display type "embed" which you can use for embedding views like this. It will provide those "edit view" links when you hover your view content while logged in as admin...
I have a library page with some taxonomy topics(resource types) that are currently being filtered by some really hacky tabs that I would like to replace to do two things:
1) get new, more user friendly tabs, with the capability to be placed outside of the view yet change content inside the said view.
2) be able to have the tabs grouped together in a way I can manipulate them with css.
I am fairly new to the drupal world. What would you suggest? Thanks!
Do you use exposed filter options?
If so in the advanced tab of the view you have a option 'Exposed form in block' this way your exposed filters will be placed in a seperate block.
After saving the view you have to enable the block
Is there some way in creating widgets dynamically (sitefinity)?
For example:
I have some html data in DB, so i want to get that data, create a widget and place the data in widget as html content.
Any idee or info will be helpful.
You can use the built-in Content Block widget for this. See how to add it programmatically to a page here.
I have created a page template for my custom dexterity type.
The default view automatically shows all the fields, rather than my custom template which shows no fields.
I'd like to start my template by copying the default template. I have tried pasting in a copy of plone.app.dexterity.browser/item.pt however that gives me
LocationError: (<my.types.resource.ResourceView object at 0xb4d18bcc>, 'widgets')
I am not sure why.
I guess that using this template might not even be the best solution, if I need to change the way individual fields render. In that case I am wondering how I can start with a template which contains the fields in my type (in the past I used ArchGenXML). Is there an equivalent process for dexterity?
Derive your view class from dexterity.DisplayForm.
This may make your copy/pasted template work immediately by giving it the view methods and properties it needs. It will also make available variable like view.widgets, which contains a list of display widgets in schema order.
See http://developer.plone.org/reference_manuals/external/plone.app.dexterity/custom-views.html#display-forms for details.
how could I concatenate 3 views in one page ?
Should I use blocks ?
You can use blocks, but Views provides an attachment display as well. Attachment displays can be attached other other displays within the view. So, you could create your base view, then create an attachment display that attaches to the base view, and then create a second attachment display which attaches to the first attachment display.
Attachment displays are good if each view is really just another way to view the same query (like, a summary view and a detail view). But if you wanted to combine three disparate views, blocks would be the way to go. Either create a block display for each view and add them to the same region in Site Building -> Blocks, or create a page display for one of the views and block displays for the other two.
A third option would be to use View Reference, which lets you reference views as CCK fields, if you needed the views to part of a node.
It probably depends on your layout.
if you want to embed a view in somewhere else besides your block regions, you could try the embed views module I also believe the the panels module has a much more dynamic way of rendering multiple views on the page (but flexibility also adds some to the complexity)