Grouping Wagtail CMS streamfield fields? - wagtail

First of all, I wish everyone a good day.
I want to group blocks that I created with StreamField.
I am attaching an example video and image below.
New image
https://youtu.be/VMfxVCGarf4
Thank you for your help, best regards.
What do I want to do?
All component list
Sub column (Component #1)
Sub column (Component #2)
Sub column (Component #3)
All html blocks
Sub column (HTML block #1)
Sub column (Component #2)
Sub column (Component #3)

Maybe the group option on the block definition is what you're looking for?
body = StreamField([
('title', CharBlock(group='text blocks')),
('paragraph', RichTextBlock(group='text blocks')),
('image', ImageChooserBlock(group='media blocks')),
('video', EmbedBlock(group='media blocks')),
])

Related

Connect multiple tables in Access

I want to connect multiple tables in Access. I have a main table and then multiple smaller tables that I would like to connect. Each row in the main table belongs to one entire sub-table. I would like to have small + appear next to each row in the main table and showing the sub-tables upon clicking on the +.
I tried this via relationships but it only works for the first row (perfectly) but not for any other rows. When clicking on the other rows, they are empty and no sub-table is opening up.
Any ideas?
Per the comments if you must do this here is an example:
example main table and sub tables
example form created from the main table using the create form wizard and selecting tabular to get a better looking starting form:
note I added an unbound button to the details section and that button gets replicated for each row of data. I will show two ways of setting up the button to open the correct form.
put the form in design mode open the button's properties and open the onclick event. you can do this with the macro language but I show the code:
Private Sub openButton_Click()
'each button the detail section creates has access to the data or controls in the buttons row
DoCmd.OpenTable Me.subTableName 'if form use .OpenForm
'DoCmd.Close acForm, "mainForm" 'if want to close main form
'OpenTable (MainID)
End Sub
if the logic behind opening the form gets complicated I suggest abstracting the logic to a function. here use OpenTable instead and add the Public OpenTable function inside a code module.
Public Function OpenTable(tableID As Long) As Boolean 'function allows the option checking the return value to test if OpenTable worked
Select Case tableID
Case 1
DoCmd.OpenTable "subTable1"
Case 2
DoCmd.OpenTable "subTable2"
Case 3
DoCmd.OpenTable "subTable3"
End Select
OpenTable = True
End Function
Note: you could expand the form's header and show the mainTable as a subform in that header. Then you could add a button next to each row in that subform but outside the subform. The approach I show is easier to maintain.

Order sub to click userform commandbutton from sub

I am writing here because I cannot seem to find the answer on the internet.
Context of my sub and userform : I have several pivottables in the same sheet in a workbook.
These pivottables may have random names given by other users changing them unintentionally or not knowing the names are essential to the rest of the code. This is why i created a userform which has on one side the ideal name of each pivottable, and on the other side, comboboxes with the current names, like so:
pivottable dealing with x // combobox with all current names (user has to choose which one of the current names corresponds to the this pivottable)
pivottable dealing with y // combobox with all current names (user has to choose which one of the current names corresponds to the this pivottable)
pivottable dealing with z // combobox with all current names (user has to choose which one of the current names corresponds to the this pivottable)
and finally a button "VALIDATE"
here is a screenshot of my userform : enter image description here
WHAT I AM TRYING TO DO :
since the user has to inform the userform which pvttable corresponds to which title, i have written :
userform1.show vbmodeless
so that the user can go check the current titles of the pivottables and associate them with the correct one. Because I have put the vbModeless, the sub does not wait for the user to validate and thus fills the title with nothing or blank as nothing from the combbox has been chosen since the user hasn't had the time yet. Therefore, I want to signal that once and only once i clicked on "valider", then the sub changes the current titles to the ideal titles (can only do in the sub and not in the userform because i actually use an array that is subject to changes in the ideal names, and I can't put it in the userform because it is defined above in the sub, ican't pass it over to the userform). I am triyng to use something like :
if userform1.commandbutton1.click = true then
'and put pvtnames = userform1.combobox1.value
(but i am alright with the pvtname part). IS THERE A WAY TO CODE THE BUTTON.CLICK PART ? thank you ever so much for your help, i am sorry for the long message

Inseting table inside table in angularjs

With reference to this code,if I am having three columcolumns (eg: including mrks after sub and the mrkd also have different number of rows like subjects.What change should I do now?
add multiple rows in one column using angular ng-repeat
I have updated the fiddle mentioned in the answer of mentioned question.
I have just added below code in html :
<td>{{subject.mark}}</td>
And added the mark in users object.
Please refer UpdatedFiddle

VB2010 reading menu items in tool strip sub menu

SQL Server/VB2010 newbie. Fighting the learning curve on two fronts.
I am creating a UI in VB2010 to a SQL Server database that will allow users to edit tables in the database. Since the tables in the database may change (new ones added, or obsolete ones deleted) as the project develops, the table names are dynamically added to the sub menu, as shown in the screen cap below:
Then I use the AddHandler function to run the click event sub. That works fine, but what I need to do is grab the actual text of the submenu item ("VehicleList", "Maintenance", etc.) to use in the SQL SELECT string to open the selected table in the database, like so:
"SELECT * from [selected_menu_item] WHERE yada, yada"
I've scoured the internet looking for this, but if it's there, I can't find it. Tried many ways, but I either get the top menu item ("Table") or the last item on the list, or sometimes just a blank line.
Preferable would be to get the actual names, but even if there was an index value, I could use that to reference an array of the table names.
Can anyone help?
Thanks!
The answer is to use the "ByVal e As ToolStripItemClickedArgs" argument in the handler, like this:
Private Sub MenuItem_click(ByVal sender As System.Object, ByVal e As ToolStripItemClickedEventArgs)
Debug.WriteLine(e.ClickedItem.Text)
End Sub
Found this at http://msdn.microsoft.com/en-us/library/system.windows.forms.toolstripitemclickedeventargs.clickeditem.aspx
It works exactly as I need it to!

Create views from field values Drupal-7

So if I understand correctly I have will a few content types "Category", "Sub Category", "Product", "Images" I am just not sure how I will associate the content types with each other to build views. So based on my structure below: I would create a Category name "Home" with the "Category" type. The category would have a view that shows all Sub Categories that are associated with this view "Category". This is my question: When I go to create my new Sub Category "Furniture" how do I associate it with the view that is on my "Home" Category page? And so on with the Products which will all belong to sub category and the images will all belong to a product. Can I use a custom field that the user adds a string?
Home (category)
-Furniture (sub category)
-Sofa(product)
-images
-Lamp(product)
-images
Outdoors(category)
-Deck Furniture(sub category)
-Table(product)
-images
-Fire-pit(product)
-images
I am sure this was confusing so if anyone has questions please ask. Any help would be amazing. Thanks in advance.
Your question is a little confusing because it seems that there are two parts to it that aren't clearly defined.
If you're looking to relate content to each other, check out the References module.
As for creating the display you're looking for, the Views module is likely what you're looking for. There is also a Views Hierarchy module which you may need but is currently unavailable for Drupal 7.

Resources