Leaderboard
Popular Content
Showing content with the highest reputation on 12/05/2016 in all areas
-
This is a image and animation heavy single page for NexWafe, a spinoff of the Fraunhofer Institute for Solar Energy Systems (ISE) based in Freiburg, Germany. The sections were realized with Flickity carousels to separate the content into slides. The site features various animations, like parallax separators, fixed lines and two large animations to illustrate the process and production. The animations were realized using ScrollMagic in combination with GSAP. Challenging was to keep the site performant by lazy loading almost every image and disable animations for mobile devices. www.nexwafe.com Modules used: ProCache Markup Sitemap XML Email Obfuscation (EMO) Tracy Debugger Regards, Andreas4 points
-
I can also confirm that ecwid is good and could work easily with Processwire; i have used it on several sites. The main reason why you might want to use FoxyCart or SnipCart over ecwid is that in Ecwid (at least the last time i used it) you have to setup the products within the ecwid interface, as opposed to defining your products within PW. Part of the reason for using PW as the basis of an ecommerce site would be to take advantage of custom fields, and being able to code your own logic for all of the product's attributes, everything from images to pricing, variants, stock, etc. So if you used ecwid then you'd need to double enter the product details; Where ecwid can excel would be on simple sites where you just need to add a few products and don't care about using custom fields.4 points
-
In the module info for a Process module you can include settings that automatically create a page under Admin: // page that you want created to execute this module 'page' => array( 'name' => 'helloworld', 'parent' => 'setup', 'title' => 'Hello World' ), Is there an easy way to make this created page hidden so it doesn't appear in the admin menus? Or if I need a hidden page would I have to create/remove the page in the install()/uninstall() methods? Edit: should have guessed it would be so easy... // page that you want created to execute this module 'page' => array( 'name' => 'helloworld', 'parent' => 'setup', 'title' => 'Hello World', 'status' => 'hidden', ),4 points
-
For those of you who are experienced with the PW API (and those looking to learn), there is now an "Action Code" viewer that shows the executeAction() method of the action you are about to execute. It is of course collapsed by default and only available to superusers. Anyway, hope you'll find it useful and either reassuring (if you're worried about what code it about to be executed on your site), or informative as to what can be done with the API.4 points
-
Hi everyone, Here's a new module that I have been meaning to build for a long time. http://modules.processwire.com/modules/process-admin-actions/ https://github.com/adrianbj/ProcessAdminActions What does it do? Do you have a bunch of admin snippets laying around, or do you recreate from them from scratch every time you need them, or do you try to find where you saw them in the forums, or on the ProcessWire Recipes site? Admin Actions lets you quickly create actions in the admin that you can use over and over and even make available to your site editors (permissions for each action are assigned to roles separately so you have full control over who has access to which actions). Included Actions It comes bundled with several actions and I will be adding more over time (and hopefully I'll get some PRs from you guys too). You can browse and sort and if you have @tpr's Admin on Steroid's datatables filter feature, you can even filter based on the content of all columns. The headliner action included with the module is: PageTable To RepeaterMatrix which fully converts an existing (and populated) PageTable field to either a Repeater or RepeaterMatrix field. This is a huge timesaver if you have an existing site that makes heavy use of PageTable fields and you would like to give the clients the improved interface of RepeaterMatrix. Copy Content To Other Field This action copies the content from one field to another field on all pages that use the selected template. Copy Field Content To Other Page Copies the content from a field on one page to the same field on another page. Copy Repeater Items To Other Page Add the items from a Repeater field on one page to the same field on another page. Copy Table Field Rows To Other Page Add the rows from a Table field on one page to the same field on another page. Create Users Batcher Allows you to batch create users. This module requires the Email New User module and it should be configured to generate a password automatically. Delete Unused Fields Deletes fields that are not used by any templates. Delete Unused Templates Deletes templates that are not used by any pages. Email Batcher Lets you email multiple addresses at once. Field Set Or Search And Replace Set field values, or search and replace text in field values from a filtered selection of pages and fields. FTP Files to Page Add files/images from a folder to a selected page. Page Active Languages Batcher Lets you enable or disable active status of multiple languages on multiple pages at once. Page Manipulator Uses an InputfieldSelector to query pages and then allows batch actions on the matched pages. Page Table To Repeater Matrix Fully converts an existing (and populated) PageTable field to either a Repeater or RepeaterMatrix field. Template Fields Batcher Lets you add or remove multiple fields from multiple templates at once. Template Roles Batcher Lets you add or remove access permissions, for multiple roles and multiple templates at once. User Roles Permissions Batcher Lets you add or remove permissions for multiple roles, or roles for multiple users at once. Creating a New Action If you create a new action that you think others would find useful, please add it to the actions subfolder of this module and submit a PR. If you think it is only useful for you, place it in /site/templates/AdminActions/ so that it doesn't get lost on module updates. A new action file can be as simple as this: <?php namespace ProcessWire; class UnpublishAboutPage extends ProcessAdminActions { protected function executeAction() { $p = $this->pages->get('/about/'); $p->addStatus(Page::statusUnpublished); $p->save(); return true; } } Each action: class must extend "ProcessAdminActions" and the filename must match the class name and end in ".action.php" like: UnpublishAboutPage.action.php the action method must be: executeAction() As you can see there are only a few lines needed to wrap the actual API call, so it's really worth the small extra effort to make an action. Obviously that example action is not very useful. Here is another more useful one that is included with the module. It includes $description, $notes, and $author variables which are used in the module table selector interface. It also makes use of the defineOptions() method which builds the input fields used to gather the required options before running the action. <?php namespace ProcessWire; class DeleteUnusedFields extends ProcessAdminActions { protected $description = 'Deletes fields that are not used by any templates.'; protected $notes = 'Shows a list of unused fields with checkboxes to select those to delete.'; protected $author = 'Adrian Jones'; protected $authorLinks = array( 'pwforum' => '985-adrian', 'pwdirectory' => 'adrian-jones', 'github' => 'adrianbj', ); protected function defineOptions() { $fieldOptions = array(); foreach($this->fields as $field) { if ($field->flags & Field::flagSystem || $field->flags & Field::flagPermanent) continue; if(count($field->getFieldgroups()) === 0) $fieldOptions[$field->id] = $field->label ? $field->label . ' (' . $field->name . ')' : $field->name; } return array( array( 'name' => 'fields', 'label' => 'Fields', 'description' => 'Select the fields you want to delete', 'notes' => 'Note that all fields listed are not used by any templates and should therefore be safe to delete', 'type' => 'checkboxes', 'options' => $fieldOptions, 'required' => true ) ); } protected function executeAction($options) { $count = 0; foreach($options['fields'] as $field) { $f = $this->fields->get($field); $this->fields->delete($f); $count++; } $this->successMessage = $count . ' field' . _n('', 's', $count) . ' ' . _n('was', 'were', $count) . ' successfully deleted'; return true; } } This defineOptions() method builds input fields that look like this: Finally we use $options array in the executeAction() method to get the values entered into those options fields to run the API script to remove the checked fields. There is one additional method that I didn't outline called: checkRequirements() - you can see it in action in the PageTableToRepeaterMatrix action. You can use this to prevent the action from running if certain requirements are not met. At the end of the executeAction() method you can populate $this->successMessage, or $this->failureMessage which will be returned after the action has finished. Populating options via URL parameters You can also populate the option parameters via URL parameters. You should split multiple values with a “|” character. You can either just pre-populate options: http://mysite.dev/processwire/setup/admin-actions/options?action=TemplateFieldsBatcher&templates=29|56&fields=219&addOrRemove=add or you can execute immediately: http://mysite.dev/processwire/setup/admin-actions/execute?action=TemplateFieldsBatcher&templates=29|56&fields=219&addOrRemove=add Note the “options” vs “execute” as the last path before the parameters. Automatic Backup / Restore Before any action is executed, a full database backup is automatically made. You have a few options to run a restore if needed: Follow the Restore link that is presented after an action completes Use the "Restore" submenu: Setup > Admin Actions > Restore Move the restoredb.php file from the /site/assets/cache/AdminActions/ folder to the root of your site and load in the browser Manually restore using the AdminActionsBackup.sql file in the /site/assets/cache/AdminActions/ folder I think all these features make it very easy to create custom admin data manipulation methods that can be shared with others and executed using a simple interface without needing to build a full Process Module custom interface from scratch. I also hope it will reduce the barriers for new ProcessWire users to create custom admin functionality. Please let me know what you think, especially if you have ideas for improving the interface, or the way actions are defined.3 points
-
That will just set it to dev and proceed - it won't actually check the value of $config->env Just an option for you - TracyDebugger has a Mail Interceptor panel which which intercepts all outgoing emails and displays their content in the panel instead - might be a decent option for what you are trying to achieve?3 points
-
The quote above reminded me of something I tried a while ago: <?php /** * Keep track of module config versions in ProcessWire. * Allows smooth upgrading of module versions when configuration * options change. */ class ModuleConfigVersion extends WireData implements Module { public static function getModuleInfo() { return array( "title" => _("Module Config Verisons"), "summary" => _("Store module version in config to allow smooth upgrading."), "version" => "0.0.1", "autoload" => true, ); } public function init() { $this->addHookBefore("Modules::saveConfig", $this, "hookSaveConfig_SetVersionProperty"); } public function hookSaveConfig_SetVersionProperty(HookEvent $event) { $module = $event->arguments(0); $data = $event->arguments(1); $moduleInfo = $this->modules->getModuleInfo($module); $version = $moduleInfo["version"]; $data["version"] = $version; $event->arguments(1, $data); } } This automatically adds the version each time a module's configuration is saved.3 points
-
Hi, After you installed processwire the body and sidebar are always filled with dummy content, unless you used an empty profile but I dont think you did that. What processwire version did you install and what profile did you use during install ? This is clearly a case of something simple that is been overlooked. If you want you can pm me your ftp and admin access and I will have a look.3 points
-
I'm not sure what could be causing the 500 error. The Apache/PHP/PW error logs might shed some light. If this is happening on a live site then it could even be caused by mod_security - turn that off if you can or check with your host. Rather than using your parseContent function you could consider rendering the page with a different template that is created with the index field in mind. $page->render($filename); // $filename assumed in /site/templates/ See this post: Or you could loop over the page's fields in the hook, checking for the type of each field and preparing it's value for the index field accordingly. foreach($page->fields as $field) { /* you can get the value... $page->get($field->name); ...but you'll want to treat it differently based on field type if($field->type == 'FieldtypePage') { ...etc... } */ }3 points
-
foreach ($pages->find('template=basic-page, limit=50') as $p) { $p->of(false); $p->title = "My New Title";// if using a new title...otherwise comment out this line $p->name = $sanitizer->pagenName($p->title); $p->save(); $p->of(true); } If renaming in the thousands let us know so that we can adjust the code...3 points
-
Hello, I created a simple telegram bot. What it does? it enables you to save your voice messages and send them later using emojis or keywords in your group chats. Just add @voxgrambot in your group chats and search all the public voice messages available using text or emojis. If you want to create a new voice message just send a private message to the bot with the command /new . If you want more info send the command /help. The bot was made using Python and https://python-telegram-bot.org The backend was made using ProcessWire 3.x and my Rest API helper. http://telegra.ph/Voxgram-Telegram-Bot-12-033 points
-
Well the top 2 most popular CMS in Germany are Wordpress and Typo3 respectively according to this site, although I shouldn't believe the numbers too much because PW is not even ranked http://www.cmscrawler.com/country/DE And if you've ever used either of them, you'll reach a point where you'll be frustrated either by inflexibility, increased difficulty in maintenance or security issues and you'll have to migrate and something like PW would be like a breath of fresh air in comparison. I think @lisandi sums it nicely in this post.2 points
-
I think the best full solution is Ecwid. Can be integrated with any CMS or plain html website. You can customise it and make it look as you want. It's also probably the 3rd ecommerce solution in the world as features after shopify and woocommerce. I use it for 2 years and they've improved it a lot. A lot of gateway payments, responsive, flexible, you can build whatever you want to be honest. And is also way cheaper than shopify. Basically the admin side is from their web interface and you just copy paste a code into your page to have the products listed. I tried Woocommerce at some point but is a nightmare with all plugins, bugs and maintenance. https://www.ecwid.com/2 points
-
You might find the Page Rename Options module useful - you can set it to keep page names in sync with page titles when they change.2 points
-
One thing I'd definitely never do is mix values of different languages in one language's field. It's bound to come back and haunt you. To get around template additions/changes, you could simply add a (hidden) field to them. Then, in your hook, simply check $page->template->hasField("yourhiddenfield") instead of comparing template names. Lastly, I'd change your code above a bit to always try the user's language first, then try to fall back to the absender's language and lastly the default. public function hookLangInherit(HookEvent $event){ $mlObj = $event->object; // LanguagesPageFieldValue object $currPage = $this->wire('page'); if($currPage->template->hasField("flag_absendersprache")) { //check if detail page is accessed if($this->input->urlSegment1){ // The overview-content and fetch-content pages are living under a specific rootParent which has assigned a specific "absender" $absender = $currPage->rootParent->choose_sender_2016; // Get The new language by a custom pagefield(single) from the "absender" $sprache = $absender->inheritLanguages; $usprache = $this->user->language; $dsprache = $this->languages->getDefault(); // Take the first non-empty value in order of precedence: // First the current user's, then the absender's, then the default language foreach(array($usrpache, $sprache, $dsprache) as $lang) { $newLangValue = $mlObj->getLanguageValue($lang); if($newLangValue != "") break; } // Get the new values in that language $event->return = $newLangValue; } } }2 points
-
@szabesz - that sounds like a great idea - let me think on this to figure out the best option. @Rudy - I was thinking that perhaps the functionality of this module could be improved it bit. Notice in the screenshot that now you can control activating and deactivating different languages at once, as well as leaving certain languages untouched. When you use this, please let me know if you think these options work well, or if you think it could be improved still.2 points
-
I'm looking forward to client-side image resizing in PW. I have clients who will upload massive 24-megapixel 10MB images without a second thought. I use the "Max width for uploaded images" option but it's not working reliably because the oversized images still get through somehow (perhaps out-of-memory issues). Anyway, I was looking for a foolproof way for non-tech-savvy clients to resize images and found this: https://bulkresizephotos.com/ Images are resized client-side so it's much faster than many of the other online tools. You can resize multiple images at once and get a ZIP file back with the results. And the best feature is that you can set the tool up how you want and then generate an embeddable drag-and-drop widget, so it's super-easy for clients to use and there are no options for them to mess up. I created a Hanna Code for the widget and added it to the online documentation I supply to clients so it's right there when they need it. Could even potentially be embedded directly in the admin theme. Until client-side resizing comes to PW this is a useful stopgap.1 point
-
Thought I'd show some work in progress modules. Subscribers https://github.com/benbyford/Subscribers has functions for logging in new users, added with new subscriber role bulk export the subscriber users to comma delineated SubscriberList (submodule) module adds an admin page to view your subscribers and page through them, or export WireMailChimp https://github.com/benbyford/WireMailChimp (though I need to change the name on github) Implements https://github.com/drewm/mailchimp-api adds any user save to a mailchimp list settings for API and List id only adds users that have a checked email_subscribe field to true1 point
-
Yes, Tracy shows the rendered HTML and all recipients. Back to your hook question, there is: getModuleConfigInputfields which may suit your needs, but haven't though into it too much, but it does seem to be what you were asking about. https://github.com/processwire/processwire/blob/35df716082b779de0e53a3fcf7996403c49c9f8a/wire/core/Modules.php#L35341 point
-
1 point
-
hi timothy and welcome to the forum, maybe it would be easier to use a client-side javascript library to create your pdf? https://github.com/MrRio/jsPDF1 point
-
I think I get it, I've just read : https://processwire.com/talk/topic/3644-translate-static-strings-in-the-templates-folder/ @Soma made me understand the process (I think). I probably going to use something like that with a single translation file/language (I have the same sentences multiple times on different templates). So to sum up : - I'll use multi-language textarea field in my backend to manage description which doesn't change often. - I'll use a single translation file / language, loaded dynamically according to the language used by the template. Sounds good to the pro ? Thanks1 point
-
I don't have any experience to be honest with Processwire, just found about it from a friend. I want to make a directory sort of website where users add content and others view and apply for it. What I had in mind was Expression Engine because had this huge flexibility but then I saw PW and was basically the same principles, but atleast I could play with it without buying the core functions. Anyway, coming back to Ecwid, Macrura is right you have to add the products from the Ecwid interface. So basically you add them and after you can copy two types of code to display them in your website. 1 - is the whole list of products, like a grid style let's say and when you click on one opens up the dedicated page for that product 2. a sort of widget or buy button that is just for one product. Like the Shopify button if you want a comparison. Downside is that you have to edit the appearance of the cart and products from the Ecwid admin page, through custom css. Quite flexible I would say but nevertheless. Good aspect is that you can place this cart interface in 20 websites if you want and have the same admin page. So you can sell on facebook, on your website, on your blog, or pretty much anywhere. You can create a page from PW I suppose for each product and just add the Ecwid button for AddTo Cart. And when the buyer clicks the shop, pops on top of your page. You can also redirect it to a different page if you want to make it look like is integrated well dith the rest of the website. Here is my website if you want an idea. I use it with wordpress, but I created some sort of custom pages for products. You can see it best at the Flio Up details page. I believe can be done easily with PW. Loads a bit slow as I have to restructure but anyway, maybe after holidays. In terms of features they are quite rich as any other big ecommerce. But more importantly is easy to manage your sales. if you start having more than 100 orders/month this becomes annoying and time consuming with woocommerce for example. You can't copy paste properly addresses for labels, can't manipulate or modify orders fast and accurate, 10 plugins to keep track with, is a mess in my opinion. If you focus on handling an ecommerce as a business take a dedicated ecommerce platform like Shopify, Ecwid or even BigCartel, Magento. Saves a ton of time, money and headaches. You can have it for free with up to 10 products. That is really how I used it for 1-2 years just because I didn't need anything, the full features are there. Just recently switched to a paid plan of 15 euro/month to have access to some better SEO and apps.1 point
-
Just to add to @kongondo's code, if your site is not in English, you may want to consider: $p->name = $sanitizer->pageName($p->title, true); You can read more about that sanitizer option here: https://processwire.com/api/ref/sanitizer/page-name/ or: $p->name = $sanitizer->pageNameUTF8($p->title); https://processwire.com/api/ref/sanitizer/page-name-utf8/1 point
-
That's a good point - this isn't foolproof for sure. Remember though that it's only config settings that are being exported/imported (which are stored in a json object in the "modules" db table), so nothing should be critical - there are no db schema impacts or anything. New settings should be added in when saving the settings page again. I guess an option to mitigate any confusion might be to add the version of the module to the json file so that it can be compared on import and if the version is different then warn that there might be new settings might be lost and should be reviewed. The other issue to consider is when a module's config settings reference a page, template, or field - these won't match on different PW installations because their IDs will be different. Nothing can really be done about this. I guess I am just trying to make configuring of complex and commonly used modules simpler. Maybe there is no complete solution possible?1 point
-
@adrian One question: how can this module deal with dissimilar settings? I mean when settings of an older version of a module are different from the newer one? In module development, one usually has to implement an upgrade procedure to account for possible db storage differences, I guess something similar is needed in this case too. Am I missing something?1 point
-
1 point
-
Just count yourself lucky and stop your research now. Trust me, you're not missing much. But seriously, this is what I'm talking about. There's got to be a reason why Germany is the only country whose interest in PW reaches the threshold to register on Google Trends - any ideas?1 point
-
<attempted geek joke> If you are into the new syntax of PHP 7.1, how about something like this... public function declareBrexitReferendumResult() : void; /* UK version */ public function declarePresidentialElectionResult() : void; /* US version */ ...take your pick. </attempted geek joke>1 point
-
Maybe I don't fully understand what works and what doesn't in your case, but typically with hooks on after page save you can end up with recursion when you include $page->save inside the hook function. Typically you need to make it a "before" hook, or do: $page->save("index"); so that you are just saving the specific field (not the entire page), so that the hook won't be triggered again.1 point
-
You're right, somehow there was a missing equal sign Thanks for the feedback, please pull the latest version from Github!1 point
-
I'm still in the middle of an almost complete rewrite. I still plan to have it finished by Christmas, but I don't dare to give a more precise estimate right now. As soon as that's finished, I'll release it as a beta and do some heavy-load testing in our intranet to confirm its stability.1 point
-
Hi everyone, I have just added the ability for the PW Info and Console panels to reference the page that is being edited, rather than the Admin > Pages > Edit page (which is generally not a page you'd actually want info about or want to run scripts on). Note, that without this enabled, the screenshots below would be showing the admin edit page with ID: 10. This option is disabled by default to avoid any confusion, but I would recommend that everyone will probably enjoy having this enabled. This idea has been brewing for a little while, but this thread (https://processwire.com/talk/topic/14745-debugging-images/) prompted me to try it out because @microcipcip needed more details about images in the admin because there is no viewable page on the front-end. Please let me know how you find this and if you have any problems!1 point
-
1 point
-
@ZGD The above way of encoding/decoding is only meant as an example - it will put carriage-returns and linefeeds anywhere there is a literal '\r' or '\n' in the data. So, if you have anything like a Windows path (C:\regarding\my\new\nested\filesystem) you could get C: egarding\my ew ested\filesystem out. You will need to pick substitution tokens (particularly for the "\n" newlines) that will not be in your data stream. I think you will get away without substituting the "\r" carriage returns.1 point
-
I've to support Bernhard in his opinion. Why go through the hassle of changing the internal domain name representation, where you don't know the consequences, when setting up the correct hostname for your vagrant machine's ip is so easy and quick.1 point
-
Welcome to the forum claudio. I've had a short look over your website and came to a few points. The first image on the page doesn't load after I clicked the impressum at the bottom and got back. It's just a gray bg. I'm not sure if intro should really be part of the navigation, especially as it's so short. Maybe "…mein Versprechen." (…my promise (to you)) is not the best wording to broadcast professionalism The impressum could look much better and be integrated in the main website From your portfolio I mostly get the impression that you can style the one wp base theme you used on all your sites From that I can hardly tell how good you're backend (php) skills are, which you'd certainly need a baseline of to work with processwire. Do you plan to dive into the cms and switch away from wordpress? Do you have any particular problems with your current choice of cms?1 point
-
i have a similar problem: i want to get -all items from a list if they match the ID TOGETHER WITH -all items wich are marked as global, regardeless of their ID $search= $pages->find("offer_global=1|offer_from='22|33|44|55"); wont work... isnt there something like: $search= $pages->find("offer_global=1|(offer_from='22|33|44|55")); ?1 point