Collapsible accordion in form-list? - accordion

I have successfully implemented a collapsible accordion on fields inside a form-single tag, however I am unable to do so on fields in a form-list tag. The "Making Apps with Moqui" documentation covers accordion implementation only within form-single, so i checked the xml-form-2.0.xsd file and nowhere does it say that field-accordion (and by extension field-group, field-layout). Is it possible to have a collapsible form-list, or is it indeed only reserved for single forms? I should also add that my form-list resides inside a container tag.

Related

ZK framework - no content in include

We have a tabbox whose tabpanels use include to include content:
<tabpanels height="100%">
<tabpanel>
<include src="#load(vm.myTabUrl)" />
</tabpanel>
...
</tabpanels>
Once in a while in production, the content of the include is not displayed. This behavior seems to be random and we don't know how to replicate it.
When it happens, the generated html contains a <div> for the include which only contains another empty <div> with class z-tmp:
ZK doesn't show any errors while rendering and neither does the javascript console. Also there are no failed http (zkau) requests. Any ideas?
ZK Client Engine is responsible for conversion of ZUL to HTML at client side.
ZK has a huge in-built component support compared to HTML. But the things that are displayed on Client side will be HTML itself.
We design a page in ZUL and it is converted into HTML in action. ZUL Components are larger than HTML components in number but in the end we get HTML components only with some changes in their structure.
How the ZUL page reconstructed to HTML page ?
ZUL page are converted to Div, input, anchor mostly.
ex: Groupbox
(ZUL) --> Multiple Div (HTML)
The ID of the DOM components are dynamically generated after conversion like z_p5,z_g3 and the ID
i.e given in ZUL page can be added at AID of the Component.
The DOM component can be allowed to have multiple styles separated
by spaces.
The Widget name is added to the component style as z-widget along
with our regular styles mentioned in ZUL page. The ZK Component name is added as z-widget in the style attribute of generated HTML DOM Component. As you have already seen that z-include is added in the style attribute of Div element in the above screenshot after generation
of page.
Coming to the Actual problem,
Open the AfterCompose method of the ViewModel of this page.
Assign myTabUrl directly with another ZUL page path and Notify it with
postNotifyChange method from below.
BindUtils.postNotifyChange(null, null, ClassName.this, "myTabUrl");
May be Variable is not properly assigned or Notifying the variable may be missed which caused this problem. If possible post the ZUL and VM code here if problem still not resolved after this trial.

TYPO3 How to create a custom "infobox"?

I am trying to make an "Infobox" with TYPO3.
In my HTML Template i have the Infobox:
<div id="infobox">
<!-- ###infobox### start -->
CONTENT from the backend
<!-- ###infobox### start -->
</div>
...
Now in my Backend, i have a content element, that keeps the content for my Infobox in the Frontend:
What i want to do is: If i disable the content element via the "disable button" in the backend, i want to change the CSS of my #infobox (adding display:none) or if I re-enable it I want to remove the display:none.
I hope I could explain my issue and hope someone can help me.
As far as I understand, you want the disabled flag of the content element to only influence the rendered output, not switch off the rendering.
I fear that this is not easily possible. The disabled column is part of TYPO3’s so-called enable fields, for which checks are added all over the place by the TYPO3 API. Due to this, "hidden" records are usually not even selected from the database, so they are also never fed to the rendering engine.
An alternative would be to use a custom content type with a custom field for your purpose, hide the "hidden" field in the form for that type and put the custom field in its place. This can all be done with standard TYPO3 core mechanisms.
What you cannot avoid however is that somebody will be able to hide/disable the content element from the page or list module. This cannot be prevented as your content needs to live in the same table (tt_content) as the rest of the content—and the settings for enable fields are global per table.
You can use an custom fluid content element
see: http://www.creativeworkspace.de/blog/artikel/eigene-inhaltselemente-im-typo3-cms-62x-und-7x/
or: https://docs.typo3.org/typo3cms/extensions/fluid_styled_content/7.6/AddingYourOwnContentElements/Index.html
or you use a custom layout
TCEFORM.tt_content {
layout {
addItems {
item1 = Name of Layout
}
}
}
after this you can get it with {data.layout} in your template
{f:if(contition:'{data.layout} == item1',then:'display:none')}

Is it possible to create your own drag and drop Mailchimp template?

I'd like to create a custom drag and drop template so I can increase the design possibilities without losing the functionality. I can't find anything in their documentation.
I was hoping to create something like this, not sure if I'm missing something obvious but I can't find a drag and drop that allows for the different coloured background with columns too.
I could use a block of code but I can't edit the css styles so it wouldn't be responsive for mobile and also not very friendly for those who don't know html.
Rather old question, but to who it might be helpfull:
If you code your own template and upload it to Mailchimp you lose the 'drag & drop' system/UX interface with the different blocks. You are able to create repeatable blocks but then it works with a dropdown list. This is (in my humble opinion) not that user friendly and takes a while before you fully understand how to use the dropdown. I had to explain it to a client earlier today and took a while before they understood it, so I decided to write them a manual for it.
But the design you want to create should be possible to make with a standard MC template. In the 'design' tab you will find settings to control background colors etc.
Still not possible, answer from the Mailchimp support: "At the moment, it's not currently possible to code a drag and drop template completely--one of our drag and drop template layouts will need to be selected, but you can drop in Code blocks to get a little more control over the styling of certain sections."
Though, if it's any help, it is possible to fully custom code your own template, and then add in mailchimps special Template language to the template to open up sections as editable within the campaign builder--or even duplicate certain sections of content. It's not quite the same as the drag drop templates, but adds similar functionality. More info on working with template language can be found here: https://mailchimp.com/help/getting-started-with-mailchimps-template-language/
I know this is an old question, but while searching for this myself I stumbled upon a solution posted here.
Basically it is possible to code your own drag n' drop template, but the solution has not been documented.
Find one of the Mailchimp templates (either one of the basic templates or a custom template from the 'Themes' menu.
Use 'Inspect element' and copy the source code of the iFramed html-email.
Paste in your preferred HTML-editor and modify as intended
Create your own template from the 'Paste in code' mode
If you want custom modules to be added by default, edit using the menu 'Edit design' in the bottom of the screen.
Save and exit :)
I found part of the answer on another topic: [Is it possible to code drag&drop templates for mailchimp?
If you add the following code into your main content div or td it will enable the drag and drop block editor:
mc:container="body_container" mccontainer="body_container"
example:
<div mc:container="body_container" mccontainer="body_container"></div>
This code will add a block editor region to the preheader section:
mc:container="preheader_container" mccontainer="preheader_container"
For the header:
mc:container="header_container" mccontainer="header_container"
For the footer:
mc:container="footer_container" mccontainer="footer_container"
Note: It doesn't seem to matter what you call the mc:container. Creating a new container with a different name worked. Although using just mc:container tag seems to work at first by itself, the mccontainer (no colon) tag is required for it to save properly.
You can create your own drag and drop template you need to add the following into your html coded template where you want the 'drag and drop' feature to exist.
<div id="templateBody" mc:container="container_name" mccontainer="container_name" class="tpl-container">
<div mc:block="3502204" mc:blocktype="text" mcblock="3502204" mcblocktype="text" class="tpl-block"></div>
</div>
This can be repeated in your code multiple times for multiple insertions. I could not find documentation to indicate if the container name or block number needs to be unique, I did make it unique in my template.

symfony custom form type with assets

I've created a custom form type in symfony2. This formtype has it's own template and this is working fine.
The form type also needs some javascript on the clientside to work nicely.
I would like to add this javascript to the page using the same template I use to render the widget. It's a bit more of a hassle to do this manually.
I could add the javascript manually on each page, but it would be nice if that just happened automatically.
I can't add the javascript just before or after the element itself, as it has a dependency to jquery which is only loaded at the bottom of the body.
I tried using a block which is defined in the "main template" (it is named block_javascript) to add the custom javascripts to the footer of the page, but it seems the rendering of forms works a little different and the block is not available.
I'm using assetic to prepare and return assets.
Is there a way I can use blocks from the main template being rendered when rendering a form widget?
I don't think yet about all the consequences or if it's doable, but here an idea that can solve your problem: use the event dispatcher.
an event for assets addition
a service that hold a list of assets to use and subscribe to above event
a Twig extension that use above service to make assets accessible in the template
trigger the event in the buildView() function of your form type with right parameters
use the Twig extension in your layout template
It theorically should work.

Generic component in CQ5 page

My question is very basic . I am creating a new template and in that template, I will have a concrete structure using DIV elements. But in almost 7-8 if the DIV's, I need the data to be entered by the user.
What component/line of code I can use to have all those 7-8 DIV's editable and customizable by the page creator ?
I tried multiple paragraphs with :
<cq:include path="par" resourceType="foundation/components/parsys"/>
But only the top one appears on the page. !!
For having multiple paragraph just rename the path value in the cq:include tag. also check here