multiupload in editmode

Controllers / Actions and Views, Properties, Editables, Areas, Pages, Snippets, Links, Navigation, ...
Post Reply
User avatar
nexus
Posts: 6
Joined: Thu Aug 22, 2013 5:56 pm

multiupload in editmode

Post by nexus » Fri May 30, 2014 6:46 pm

Hey Everbody,

i have following challenge, i could not imagine how can i solve this with pimcore.
and maybe this isnt and i have to go another path throug pimcore.
it would be nice if someone can hint me to the right direction!

i wanna have for example a button in editmode in a docoument template.
if i push this button the multiupload comes up like in the assets menue.
after i had choosen some pictures they can be uploaded in a predefined assets folder by the way,
the editmode should be reloaded and gave me an already filled up areablock with image

tech parts:
editmode >
multi-upload and automatically filled up
$this->areablock("myAreablock",array("allowed"=>array("image","input")))
in the view of "image" the single image from multiupload should be integrated.

after all i wanna have some view like:
http://www.pimcore.org/wiki/pages/viewp ... Id=4816942

and the multiupload pictures are listed block by block.


I have a knot in the brain but maybe iam on an absolutly wrong way ???


lots of greetings
jan

User avatar
IgorBenko
Posts: 689
Joined: Thu Jul 21, 2011 4:33 pm
Location: Berlin
Contact:

Re: multiupload in editmode

Post by IgorBenko » Fri May 30, 2014 7:07 pm

This can be done with multi-href field, though without multi-upload, so you would have to upload every image separately.

As far as I know there is no built in way to use multi-upload instead of single upload. You could maybe extend multi-href to implement this.

I am not totally sure about this, so I hope others will chime in with their ideas.

Cheers, Igor
basilicom GmbH - Official Pimcore Selected Company - http://basilicom.de/de/pimcore

User avatar
johan.lindgren@ateles.se
Community Support
Posts: 871
Joined: Fri Apr 27, 2012 8:18 am
Location: Sweden
Contact:

Re: multiupload in editmode

Post by johan.lindgren@ateles.se » Fri May 30, 2014 8:53 pm

Hi,

a simple solution might be to

- create asset-folder /a
- create the page with a document editable href pointing to assetfolder /a
- in your template grab all images uploaded in /a as children of the folder pointed to

When in editmode you can easy follow the href to view the assetfolder and make use of the standard multi upload assets to folder feature.

But ofcourse there are more fullyintegrated ways to do this.

One bad thing with this solution is that your document wont be directly connected to your asset (if you rely on dependencies for something)


Cheers
Johan
---------------------------------------------------------------------
Ateles Consulting AB - a Pimcore Professional Partner

User avatar
nexus
Posts: 6
Joined: Thu Aug 22, 2013 5:56 pm

Re: multiupload in editmode

Post by nexus » Fri Jun 06, 2014 9:59 am

Thanks for the ideas ... for so long ... but this does not really help.

the purpose:

1. multi upload from desktop into a predefined assets folder from EDITMODE
2. Automatically import from these assets into the "image" brick
$this->areablock("myAreablock",array("allowed"=>array("image","input")))

The Goal is ... the user has to multiupload easily pictures in document editmode,
then the 'myAreablock' is filled up with these assets,
the view reloads and voilá you have that draggable list view with the combined input/image

for usebility reasons it still important to make steps short.

if this way of thinking is not possible in the described way,
it would be helpful, if someone can hint me to another.


greez
jan

User avatar
IgorBenko
Posts: 689
Joined: Thu Jul 21, 2011 4:33 pm
Location: Berlin
Contact:

Re: multiupload in editmode

Post by IgorBenko » Fri Jun 06, 2014 10:22 am

Hi Jan,

I like your idea a lot, but as it is now this is not possible out of the box. You can either create a plugin to do it, create a pull request on github or add a feature request to pimcore's issue tracker.

Yes, some things in pimcore are not optimal in view of usability yet, but Pimcore has already made a huge progress in usability improvements and I am sure this will be done in the future. Let's just take it step by step :)

Cheers, Igor
basilicom GmbH - Official Pimcore Selected Company - http://basilicom.de/de/pimcore

floben21
Posts: 45
Joined: Fri Dec 16, 2011 12:04 am

Re: multiupload in editmode

Post by floben21 » Fri Jun 06, 2014 5:45 pm

Hi,

I don't know if i'm right, but maybe you could you use renderlet instead of areblock directly ?

When you drop a folder into the renderlet, you can develop a function to add somes elements into areablock.

Renderlet doc to create your action :
http://www.pimcore.org/wiki/display/PIMCORE/Renderlet

I have already follow the way to add some elements into pages (wysiwyg, not areablock but you should follow the same way):
wysiwygsample :
// Create a new page
$new = new Document_page;
$new->id = null;
$new->setChilds(null);
$new->setKey(Element_Service::getSaveCopyName("document",$newkey, $target));
$new->setParentId($target->getId());
$new->setController('blog');
$new->setAction('comment');
$new->setPublished(false);
=> In your case just get the document page id.

=> Create element text :
$name = 'text';
$type = 'Wysiwyg';
$class = "Document_Tag_" . ucfirst($type);
$new->elements[$name] = new $class();
$new->elements[$name]->setDataFromEditmode($text);
$new->elements[$name]->setName($name);
$new->elements[$name]->setDocumentId($new->getId());
$new->elements[$name]->save();
=> Save the element

$new->setResource(null);
$new->setLocked(false);
$new->setCreationDate(time());
$new->save();
=> Save the page

I have took this part of Pimore core code, take a look at the way to add areablock.

Florent

User avatar
nexus
Posts: 6
Joined: Thu Aug 22, 2013 5:56 pm

drag and drop & sorting Assets Image within Editmode View ?

Post by nexus » Fri Feb 20, 2015 2:20 pm

@Florian

I do get the 'idea' behind of this approach.

But if i put your above code into the Action of my Renderlet
/website/controllers/default/DefaultController.php
which extends Website_Controller_Action
i can not render the specific Document_Tag_Wysiwyg
into my layout view.
Question: i can not edit within renderlet in Editmode, is not possible or?
!So, i have to put the new 'onTheFly' Document_Tag_Xyz
into the View of Editmode. But How do i do this?

--------------------------------------------------------------
General new thoughts to my purpose from Aug. 22

- Multiupload in Editmode, we can handle within in a Plugin
-- You can do this by hook into Document_Tag_Xyz , for example:
-- /plugins/Plugin_Xyz/models/Document/Tag/MultiHfref.php
-- /plugins/Plugin_Xyz/static/js/pimcore/document/tags/MultiHfref.js

When this 'hard' work will be done, then this new copied Document_Tag
is able to preload and multiupload the box in the Editmode View.

The first approache thought it has to be in Document_Tag_Areablock,
because i needed the buildin drag'n'drop javascript sorting Funktion.
But i can adapt this jFunktion into MultiHfref.js

-----------------------------------------------------------------
@For all:

it would be cool, if someone can advise me to some clues to
preDespatch and Render technologies.
Maybe there is a similar approach outside in external Plugins,
where i can learn and adapt from?

@Concept:
The first main concept/ idea is to have
multiupload images within the Editmode View
which create several image tag elements after succesfull multiupload.
Maybe i disclaim the step with mulitupload and jump one further.

- Select a predefined Assets Folder via choosed from Document_Tag_Select.
- Reload Editmode
- Hook into the Dokument_Page and
inject programmaticly Assets in Document_Tag_MultiHfref manuel.

These new elements within Document_Tag_MultiHfref
could now get a new 'drag and drop' Funktion
within the Editmode view for ordering by dragging.

But if this is possible, how? Then i could it with Areablock as well
With every Document_Tag_Xyz

I can not believe this is to heavy stuff,
but sometimes you need a kick in the [censored] :roll:


THX
jan

User avatar
nexus
Posts: 6
Joined: Thu Aug 22, 2013 5:56 pm

Re: multiupload in editmode

Post by nexus » Mon Aug 24, 2015 3:42 pm

how can i include '..standard multi upload assets to folder feature..'
in my document template. Or ...


johan.lindgren@ateles.se wrote:Hi,

a simple solution might be to

- create asset-folder /a
- create the page with a document editable href pointing to assetfolder /a
- in your template grab all images uploaded in /a as children of the folder pointed to

When in editmode you can easy follow the href to view the assetfolder and make use of the standard multi upload assets to folder feature.

But ofcourse there are more fullyintegrated ways to do this.

One bad thing with this solution is that your document wont be directly connected to your asset (if you rely on dependencies for something)


Cheers
Johan

Post Reply

Return to “Documents”



Who is online

Users browsing this forum: No registered users and 1 guest