Adding a panel to a theme region - drupal

Below is my theme layout :
What I would like to do is to use the panels module to add
a 4 column block at the region labeled 'content'. I have
already tried adding a node to the content region and creating
a variant using the panels module for the particular node.
But this didn't work. I tried switching the selection rules
from "Node:Type" to "Front-page" but still no luck with this.
Suggestions appreciated!!

I think you are misunderstanding the use of the panels module. Panels makes panel pages, in which you place panes in whatever arrangement you want. The panel needs a url to control, and that url can have variables in it like Node ID.
So, here is a walk through of how to use the panels in the way I think you want from the selection rules you mention:
The panel should have a path assigned, like "welcome" or "welcome/%nid"
If you have used the %nid path, set up the context to use that argument for the node id.
You only need a selection rule if you have more than one variant, as that is how the panel selects which one to use. Example, selection rule on variantA says use it when %nid validates to a node of node:typeA. Selection rule on variantB ... etc.
In the content section of you panel control, upper left point, is a button or link that says "show layout designer", click that. http://expressmagazine.net/sites/default/files/imagesArticle/panels_drupal_8.png
That will let you change how many rows and columns and regions you have on the panel. If I recall correctly a row can hold columns or regions, a column can hold rows, and content in the same region gets stacked vertically.
Since panels layouts are inside the "content" of a page, the 3-segment header and 4-segment footer of your theme will stay. You will probably want two rows, one of which with the 4 regions to make the columns in your question, and one of which with a single region to hold the full-width content. If you have the %nid setup, you can use pieces of the node (specific fields) in the regions.
Then in your site information page set "welcome" as your homepage.

Related

Edit static grouped table view with multiple sections in Xcode Storyboard

In XCode storyboard, it is possible to Edit the cells in table view if it's static. Is it possible to enter multiple section of data (that is in group view multiple groups) right under Storyboard, or do I need to use the data source delegate instead?
I'm not sure if I quite understand the question, but if you're asking if you can do everything in Interface Builder, the answer is yes. After you've set the table content to 'static cells' in the Attribute Inspector, set the number of sections to the number of data sections you want, then modify each section by selecting the section, changing the header, footer, and number of rows. You can also quickly edit the header by double-clicking on it.
Each row in the section can be modified in the same way.

Drupal defining node grid data

I need to define a 10*10 grid of nodes. Each cell in the grid has to contain exactly one node.
A newly created node gets inserted into the next available cell and a new node can not be step to occupy an occupied cell.
That's the scenario I am trying to accomplish but I need suggestions how I do it.
How are your nodes currently being displayed? What version of Drupal are you using?
If you are using Views 7.x-3.x, there's a style plugin called "Grid" bundled with the module. When editing your view, click on Format and select Grid. Click "Apply", and on the following page set the number of columns to 10.
Finally, you probably want to disable the Views pager, but limit the results to 100.

how to divide QGridLayout into rows and columns at Design Time in QT?

how to divide QGridLayout into rows and columns at Design Time in QT ?
I want to design one form where i want to have 2 columns and 7 rows .
I am designing using QTCreator but i am not getting any option of giving rows/columns.
It shows only these properties
See Using Layouts in Qt Designer. For you the most important paragraph is this:
The simplest way to manage objects is
to apply a layout to a group of
existing objects. This is achieved by
selecting the objects that you need to
manage and applying one of the
standard layouts using the main
toolbar, the Form menu, or the form's
context menu.
place your widgets on the form
arrange them into 2 columns and 7 rows
select all of them
right click on the selected widgets
select Lay Out in a Grid on the context menu.
You can often drag a new UI element to a position between two existing columns to create a new column - the GUI indicates that it's ready to create a new column by showing a blue vertical line to the user (same thing for creation of a new row with a horizontal blue line).
If instead it is showing a red line or outline, that's indicating that it will fit the element currently being dragged into the existing row/column grid at the indicated position, without creating a new row or column.
It can sometimes be quite difficult to get the GUI to play nice - I've have a number of occasions where I can follow this process to create a new column - but not if I try to place the UI element on the row I actually want it on - so instead I end up dropping it on another row to create the column, dropping another of the same UI element where I actually want it, and deleting the first (superfluous) UI element.
Alternatively, it can quite often be easier to simply right click the element with the layout set, select "break layout" from the layout menu, move things about manually and then go back and select "layout in grid" (or whichever other option) from that layout menu - hoping that it will correctly guess where you want things to go in terms of rows and columns. It's usually pretty good at that.
But yes, it probably would be nice to be able to force create a new column/row in a grid layout (perhaps with some default UI element - a label, maybe - inserted as a placeholder to keep the new row/column open) at a predefined position within the grid for those times when the GUI just does not want to play nice.
QLayout structure is created dynamically as you add widgets to it, there's no way to predefine how many rows/cols a layout have.
Maybe you are using the wrong approach to achieve your goal.

Drupal: Views: how to group fields

I've created a views of node and I've selected the "fields" option in order to select which fields to display and in which order.
Is there a way to group such fields ? It would be very useful to have parent divs in my html code.
thanks
There's a simpler way to do it: http://www.arsnova.cc/web-development-articles/2012-07-27/grouping-fields-together-drupal-views
Let's say you want to group fields 1-3 together within a div.
First, exclude fields 1 and 2 from display. (By "exclude", I do not mean to delete them from the views display; rather, click on the "exclude from display" button within each field's options.) The fields you exclude from display must come before the other field for this to work. If they don't, rearrange them so they do.
Go to field 3, and rewrite the results, inserting the token for each of fields 1-3.
That's all you need to do. Fields 1, 2, and 3 will now appear within field 3's div. If you want, you can also add additional markup within the "rewrite results" area.
Recently found the best way for my needs and apparently for the needs of many people:
Use views_fieldsets module https://drupal.org/project/views_fieldsets, it allows yo to create a grouping div to put fields inside.
Grouping is built into Drupal 8 Views. So no need for any extra modules. Here's how:
Edit your view (be sure it has fields)
Click Format's Settings
A box will pop up with all your selected fields
Look right underneath all the field names, there should be "Grouping field Nr.1"
Select the field you'd like to group by
Click Apply
If you want to subgroup with a second field, just go back to 2 then you'll see "Grouping field Nr.2"
That's it.
Yes, click on the gear next to the Style option (under Basic Settings) and set the Grouping field. Keep in mind, the grouping field needs to be added to the view, but you can check the Exclude from display option to hide it, if needed.
I'm pretty sure that would give you a parent div. If not, you could add the parent div, by overriding the default templates (look to the Theme: Information section, under Basic Settings, for more information).

Use Site Map for Two Levels of Horizontal Navigation

How do I use the ASP.NET sitemap control to render stacked horizontal css menus with styled UL/LIs? It seems to only want to do trees or flyouts.
Set up a SiteMapDataSource and point it at your configured SiteMap Provider. Then bind a repeater (or whatever) to the data source. Use the repeater to emit your UL/LI sturcture.
If you need 2 levels (like nested tabs, where the second level tabs are children of the selected tab at the top) then you will need 2 SiteMapDataSources and set the starting node of the second to the selected node of the first.
This is all from memory of when I did this a couple years ago - so it may not be 100% exact.
If you have specific problems after trying it out, post and I will work out more details if needed.
I googled and found this thread:
http://blogs.sqlxml.org/bryantlikes/archive/2006/02/17/4839.aspx
It seems you have to build your own control. I hope it will move you in the right direction.

Resources