Search the Community
Showing results for tags 'clone'.
-
Last update: June 2024 Current stable version: 1.5.4 Dev version: github dev-branch You can find the module on Github and in the modules directory : https://modules.processwire.com/modules/duplicator/ https://github.com/flydev-fr/Duplicator/archive/master.zip Screenshots / Features Dir and files exclusion CRON job Advanced settings Local and Cloud storage duplicator.mp4
- 514 replies
-
- 23
-
-
-
ProcessWire InputfieldRepeaterMatrixDuplicate Thanks to the great ProModule "RepeaterMatrix" I have the possibility to create complex repeater items. With it I have created a quite powerful page builder. Many different content modules, with many more possible design options. The RepeaterMatrix module supports the cloning of items, but only within the same page. Now I often have the case that very design-intensive pages and items are created. If you want to use a content module on a different page (e.g. in the same design), you have to rebuild each item manually every time. This module extends the commercial ProModule "RepeaterMatrix" by the function to duplicate repeater items from one page to another page. The condition is that the target field is the same matrix field from which the item is duplicated. This module is currently understood as proof of concept. There are a few limitations that need to be considered. The intention of the module is that this functionality is integrated into the core of RepeaterMatrix and does not require an extra module. Check out the screencast What the module can do Duplicate multible repeater items from one page to another No matter how complex the item is Full support for file and image fields Multilingual support Support of Min and Max settings Live synchronization of clipboard between multiple browser tabs. Copy an item and simply switch the browser tab to the target page and you will immediately see the past button Support of multiple RepeaterMatrix fields on one page Configurable which roles and fields are excluded Configurable dialogs for copy and paste Duplicated items are automatically pasted to the end of the target field and set to hidden status so that changes are not directly published Automatic clipboard update when other items are picked Automatically removes old clipboard data if it is not pasted within 6 hours Delete clipboard itself by clicking the selected item again Benefit: unbelievably fast workflow and content replication What the module can't do Before an item can be duplicated in its current version, the source page must be saved. This means that if you make changes to an item and copy this, the old saved state will be duplicated Dynamic loading is currently not possible. Means no AJAX. When pasting, the target page is saved completely No support for nested repeater items. Currently only first level items can be duplicated. Means a repeater field in a repeater field cannot be duplicated. Workaround: simply duplicate the parent item Dynamic reloading and adding of repeater items cannot be registered. Several interfaces and events from the core are missing. The initialization occurs only once after the page load event Attention, please note! Nested repeaters cannot be supported technically. Therefore a check is made to prevent this. However, a nested repeater can only be detected if the field name ends for example with "_repeater1234". For example, if your MatrixRepeater field is named like this: "content_repeater" or "content_repeater123", this field is identified as nested and the module does not load. In version 2.0.1 the identification has been changed so that a field ending with the name repeater is only detected as nested if at least a two-digit number sequence follows. But to avoid this problem completely, make sure that your repeater matrix field does NOT end with the name "repeater". Changelog 2.0.1 Bug fix: Thanks to @ngrmm I could discover a bug which causes that the module cannot be loaded if the MatrixRepeater field ends with the name "repeater". The code was adjusted and information about the problem was provided 2.0.0 Feature: Copy multiple items at once! The fundament for copying multiple items was created by @Autofahrn - THX! Feature: Optionally you can disable the copy and/or paste dialog Bug fix: A fix suggestion when additional and normal repeater fields are present was contributed by @joshua - THX! 1.0.4 Bug fix: Various bug fixes and improvements in live synchronization Bug fix: Items are no longer inserted when the normal save button is clicked. Only when the past button is explicitly clicked Feature: Support of multiple repeater fields in one page Feature: Support of repeater Min/Max settings Feature: Configurable roles and fields Enhancement: Improved clipboard management Enhancement: Documentation improvement Enhancement: Corrected few typos #1 1.0.3 Feature: Live synchronization Enhancement: Load the module only in the backend Enhancement: Documentation improvement 1.0.2 Bug fix: Various bug fixes and improvements in JS functions Enhancement: Documentation improvement Enhancement: Corrected few typos 1.0.1 Bug fix: Various bug fixes and improvements in the duplication process 1.0.0 Initial release Support this module If this module is useful for you, I am very thankful for your small donation: Donate 5,- Euro (via PayPal – or an amount of your choice. Thank you!) Download this module (Version 2.0.1) > Github: https://github.com/FlipZoomMedia/InputfieldRepeaterMatrixDuplicate > PW module directory: https://modules.processwire.com/modules/inputfield-repeater-matrix-duplicate/ > Old stable version (1.0.4): https://github.com/FlipZoomMedia/InputfieldRepeaterMatrixDuplicate/releases/tag/1.0.4
- 33 replies
-
- 22
-
-
-
Is there a hook to do something right after cloning a page ? I want the page to be saved right after cloning it either from the button in the tree or from a lister, because saving the page triggers several calculations that are not triggered by just cloning the page. Thanks in advance !
-
Question 1 I recently installed PW 3.0.62 for a new site and also have sites running older version of PW 3.x. Can I export the database on an older version of PW 3.x and import it to PW 3.0.62 without any issues? Question 2 (This is kind of alternative to the above for long term use - and maybe a better solution...) On the sites I've previously built I have templates (home, basic-page, contact) and fields that I commonly use, such as business_name, phone_1. The last site I built is running PW 3.0.42. I was considering cloning this into a local site and running the upgrade module to bring it up to PW 3.0.62. From there on out when I start I new project I could just run the PW upgrade module, copy the folder to the location for the new project and duplicate the database using the new projects name. So basically, I'll always keep a "blank slate" site that I can just run the PW upgrade on, then duplicate into a new project. This would cut down on the work and time spent having to re-create these common fields, that I use. From there, I would just add fields, templates, etc, specific for the new website project. Is this a sound approach to speed up development?
-
Hi, I have a small module I created that copies across field content from one page to multiple other pages. I just added a repeater field and while it copies across to the other pages it has caused timeout/memory issues with PHP. I think this is because of the multiple fields within the repeater (title, text caption, image) each being copied multiple times. I thought one way to help would be to not copy images across as they're not needed in the other pages. However I'm unable to figure out how to copy a repeater field excluding one field within the repeater itself. This is my current code: // Inline gallery 1 if(count($page->article_inline_gallery_1)) { $translation->of(false); $translation->article_inline_gallery_1->removeAll(); $gallery = $page->article_inline_gallery_1; foreach($gallery as $item) { $translation->article_inline_gallery_1->import($item); $translation->save("article_inline_gallery_1"); } } At the point that each repeater imported as a whole ->import($item) could anyone help to exclude one of the fields within the repeater?
-
Hi all, I'm still new to processwire and now I have to create the first hook. I need to modify the page-clone module, so there is a field in pages that has to be empty after cloning the page. How could I start this task?
-
Hello, just another wish on my list: Multiple instances for same field. E.g. I have got a simple "text" field that's just a CKEdtior textarea. If I want to use two or more text fields, I need to dublicate the "text" field to something like "text2". I know that every field is unique because of the database structure behind. Is is still possible to make something like this for this problem? Maybe save everything to same table in database but somehow add a "instanceNumber" field that separates "text1" from "text2"? It isn't a big thing, because cloning is easy. I really like to keep redundancies low and cloning fields isn't that great, so I share this wishlist. Maybe there is some way and I don't know about it, so let me know
-
Hi, now I need your help getting an idea: I've got a page "The Jungle Book" containing details on the book by Rudyard Kipling. With ShoppingCart module, I'd like to offer the book both as a PDF for download as well as a printed version. I added the sc_price and sc_qty fields to the page, which is half of what I need: Now the page renders a button to put the book (let's say it's PDF version) into the shopping cart. How do I add a second version of this product on the same page? Titel, price and all the details will be the same, only the actual type of the product (digital version instead of printed version) differs. Since there will be many different pages with books, manually adding a second page for the printed book is not an option. Thanks for your ideas! sarah P.S.: There is this post by apeisa on adding different variations of a product into the shopping cart. But I haven't figured out what's a good way to refer back to the original page (for getting the product information) once a variation is placed in cart.
- 2 replies
-
- shopping cart
- product
-
(and 3 more)
Tagged with:
-
Not sure if this is a bug or a feature. PW 2.5 Stable When i clone a field in advanced tab of field settings i got instantly moved to fieldlist after saving, which is kind of annoying as i wanted to clone the field several times Even when i use "Admin Save Actions" Module i still get moved to fieldlist. Have a nice day Norbert
-
I have cloned (duplicated) a few file input fields today, but found the following odd behaviour: - Drag'n'drop is no longer possible. - Trash icon doesn't display in Mac/Safari + Mac/Chrome. - I can't delete any uploaded files anymore. addtl. infos: Filetypes are usual stuff / allowed file-types (PDF mostly) etc. PW 2.3.2 dev Files are visible in the backend and in the DB. Tried on Mac Safari + Win Google Chrome (in the latter, the trash icon is fine) Due to a large number of input fields, we've resized the input field width to 50 or 25%, but changing them back to 100% didn't do anything.
- 8 replies
-
- uploads
- file-uploads
-
(and 4 more)
Tagged with:
-
Hello, For the ticket booking site that I'm working on, I've made seat chart for each theatre. Each seat chart is made using a repeater field called seat_row which has row name, left, center & right columns(they use rangeslider for storing the number of seats. eg, left column might have 1-7 seats, center column will have 8-16seats and right column will have 17-25seats.). For every show, each row has different ticket cost. What I want to do is, whenever I add a new show for any drama, the page will get theatre name using a pagefield. This way, I'm linking the seat chart associated with theatre to the show. (If it matters, note that theatre gets it's seat chart using a pagefield which links to children of page "maps" where each child page is a map for a theatre.) Now, that I've got the seat chart for the show, I need to add another column to the seat_row repeater field, called row_cost which will store the ticket cost for that row, for that particular show. I guess, cloning the seat map for each show can be a solution. I'd like to know if this is a right solution or if there's any other simpler way. Thank you all in advance.
-
Im making a module to clone a pre defined page tree. This module is called CustomerStructureCloner. I have to fill in a new customer name that will be used as page title and page name. But im having dificulties with some error i dont understand: It clones the first page but not the children. It also doent rename the first page. But instead i get the following error message: Incorrect integer value: '' for column 'data_max' at row 1 Im using the following code inside the module: public function ___execute() { $error = $this->_("Unable to load page"); $id = 1005; // ID of /structure/customer/ if(!$id) throw new WireException("$error A"); $customer = $this->pages->get($id); $form = $this->modules->get("InputfieldForm"); $form->attr('action', './add/'); $form->attr('method', 'post'); $form->description = 'Vul hieronder de naam van de klant in.'; // Form description/headline $n = 1; $root = $this->pages->get('/'); while(count($root->children("include=all, name={'klantnaam'}-$n"))) $n++; $field = $this->modules->get("InputfieldPageTitle"); $field->attr('name', 'clone_page_title'); $field->attr('value', 'Klantnaam ' . sprintf($this->_n("(copy)", "(copy %d)", $n), $n)); // Phrase added to page title to make it unique $field->label = $this->_("Naam van de klant"); // Label for title field $description = "Vul hier een unieke klantnaam in. Deze klantnaam mag niet al bestaan. "; $description .= "Vervolgens wordt er een één-op-één copie gemaakt van de pagina %s en alle onderliggende pagina's"; $field->description = sprintf($this->_($description), $customer->path); // Form description/headline $form->add($field); $field = $this->modules->get("InputfieldSubmit"); $field->attr('name', 'submit_clone'); $form->add($field); return $form->render(); } /** * Called when the URL is this module's page URL + "/add/" * */ public function ___executeAdd() { $input = $this->input; // add a breadcrumb that returns to our main page $this->breadcrumbs->add(new Breadcrumb('../', 'Nieuwe klant toevoegen')); $error = $this->_("Unable to load page"); $id = 1005; // ID of /structure/customer/ if(!$id) throw new WireException("$error A"); $customer = $this->pages->get($id); $root = $this->pages->get('/'); $pageName = $this->sanitizer->pageName($input->post->clone_page_title); $nameTaken = count($root->children("name=$pageName, include=all")) > 0; $clone = $this->pages->clone($customer, $root); if(!$clone->id) throw new WireException(sprintf($this->_("Unable to clone page %s"), $customer->path)); if(strlen($pageName)) { if($nameTaken) $this->error(sprintf($this->_("The name '%s' was already taken, so one was automatically assigned."), $pageName)); else $clone->name = $pageName; $clone->title = $input->post->clone_page_title; $clone->save(); $this->message(sprintf($this->_('Cloned page "%1$s" to "%2$s"'), $customer->name, $clone->name)); } //$this->session->redirect($this->config->urls->admin . 'page/list/?open=' . $clone->id); } What could be the problem that it doesnt clone its children too and doesnt rename the page? Edit: A little update, All the pages templates to be cloned have the right "Family" settings, so they are allowed to be eachothers parent and/or children.