How can i create reusable blocks in EasyAdmin Symfony - symfony

I have an entity page and i would like to add blocks of different types and display them in the form when i select one (Image, text and image or just text). All dynamically without being pre-defined in the administration (like a cms).
HomePage
title
description
blocks [text, text-image, image]
if text create new field text
if text-image create new field text and new field image
if text again create new field text
I dont know how to make a form to be like reapeater one with adding new block or removing existing one.

I can't comment so I will put an answer instead.
I am not sure I get your question. If you're trying to configure the fields, you need to configure them in your CrudController:
TextField
ImageField
etc. as per the documentation
If you're trying to have a more CMS like approach, where you can move things around, you may want to check SonataAdmin instead. It is much more complicated but provide CMS capabilities EasyAdmin does not.

Related

Change of module title

A customer of ours is using 2sxc and whenever they edit an item, the moduletitle is overwritten with the title from the content they just edited.
How can I prevent this from happening. They want to use the ´static´module title.
You will have to choose a skin container for the module that has no title. then insert a new html module above the 2sxc content/app to create your title. Otherwise the title is built into the template of the content in 2sxc which you should be able to easily modify to be a static string instead of a dynamic title.
The auto-update title cannot be modified. if it's really important you could suggest it as a sponsored feature.
You could also try to give the content two titles - one to show in the module, the other for whatever you need the non-module title.

How to "separate" image uploads while using multiupload image field

My client has a bizarre request which is making it difficult to build a slideshow on profile2 pages: The profile2 pages require 4 photos to be uploaded, and he does not believe that the users adding content to the site will "get" the multi-select method found in most file upload modules. The Field Slideshow module only works if you're using multiupload (which of course makes sense), and that's how I had it set up initially - which worked perfectly. I've tried using the field collection module, then creating a Slideshow view, but the image fields in the field collection field aren't being seen as a group. I think I had to select one of the 4 image fields to use instead of all 4. Any ideas?
he does not believe that the users adding content to the site will "get" the multi-select method found in most file upload modules
This hardly makes sense, I guess you tried to explain things to your client ?
Assuming you have several image fields on your content type, you could build a view which create a list (unformatted or HTML list) of these fields, maybe using a global field rewriting (you add all your image fields, exclude them from display, custom their display by removing field wrapper and field+label wrapper (in order to get only ), add a global text field in which you include image fields token), and then create your slideshow in a custom javascript file, using whatever library you like (Cycle2 is great).
Your global text field would look like :
<div class="wrapper cycle-slideshow">
[field_image]
[field_image_1]
...
</div>
(with cycle2 adding a cycle-slideshow class will initialize your slideshow)
...but you need token to do so.
I often find it more convenient to setup javascript things like that (slideshows, gmaps...) by myself instead of using views integration.
Hope I understood your issue correctly, good luke with this.
For every (custom) field you have option "Number of values" which you can set to fixed amount (i.e. 4) or unlimited. Can you use that?
Easier: Use Rules. Create an additonal (fifth) image field (multivalued) that will be the one consuming the slideshow. Create a new Rule, triggered on creation or update of your content with 4 actions: each one adding the content of one of the fields to the multivalued field list. You probably need to avoid showing that field but that depends on what are you using to display, so hide it using display suite or just not using it in the content template. This way, you show your users your 4 fields but makes the slideshow work based on a computing of the user inputs.

Create a drupal 6 views slideshow from a single content type that has both, image and video fields

I need a little direction. I've created a content type that has both, images and videos attached to a node. I need to create a single frame slideshow that riffles through the mixed media. Currently, I'm using the Embedded Media Field as well as the ImageField to upload the content. I'd like to keep that within the same content type if possible. I was considering separating them and then using taxonomy to make them relational, but that sounds convoluted. At this point, the slideshow displays them both, together.
Could I add both fields to an array in a template file, then return them as one field?
It sounds like you want to add some markup that encapsulates both fields. If that is the case, you can re-write the output of the fields.
Try this:
Edit the "Content: Slideshow main image" field
Enable "Exclude from display"
Click Update
Edit the "Content: Upload Full Size Video" field
Enable "Rewrite the output of this field"
Here you can add whichever markup you want and make use of the field tokens. For example, something like <div>[field_slideshow]<br>[field_upload]</div> Note: The token values will depend on the names of your CCK fields.
Also, for Drupal related questions, there is a separate Drupal Answers exchange where you might get more targeted help.

Custom drupal view

Im kinda new to drupal, and its views. SO can anybody tell me how do i make structure like on picture below
http://d.pr/i/LrYX
You will need to enable the Views UI module as well as Views and its dependencies in order to build views.
You will want to create a content type that represents the 'company'. Then you will want to give it an image field for the logo, and maybe a link field or a text field if you want it to link back to something. This is all core in Drupal 7 with the exception of the link field.
When creating the view have it show a grid of fields for the content type you just created. View creation screen should look something like this.
Add the fields using the AJAX interface on the left and set the grid to show 4 columns in the Settings for the grid format. This configuration is in the left column under the format header.
The left handle column should look something like this before you start adding fields.
After that the rest is just CSS.

Wordpress Custom Content Types

After long research, no answer or hints about this question seems to be available.
I want to have multiple image custom content types. But how to add them with jQuery? I want an option that add dynamically multiple image custom content types when you are in the user interface to add new content.
You have the custom content type in front of you: My
You want add a new one
You give it a description, and want to add an image
Here comes my question: You add an image and you click a button to add another image input field (in the backend)
I hope you can help me with this.
Edit: To be more specific, where, in which file do I implement the jQuery functionality to dynamically add more image upload fields. I have no clue where to implement it.
Are you referring to the back-end user (using wp-admin) or a front-end user (using your actual wordpress ite)?
You can use gravity forms ( http://www.gravityforms.com/ ) in combination with this plugin http://wordpress.org/extend/plugins/gravity-forms-custom-post-types/ to create a front-end form that will allow a user to create a new taxonomy term as well as submit an image.
On the backend there is a great plugin to create duplicate fields which would allow you to do what you're describing as "You add an image and you click a button to add another image input field (in the backend)"...It's called magic fields http://magicfields.org/
What about http://podsframework.org/ its nice framework for handaling custom content type.

Resources