Leaderboard
Popular Content
Showing content with the highest reputation on 04/04/2017 in all areas
-
Not sure if you can use these, but this, to the best of my knowledge, is the home of PW Tips and Tricks: https://processwire-recipes.com/4 points
-
You can double-click the bin icon on file/image fields to mark all items for deletion.3 points
-
Hi guys, after several months I finally released my most complex ProcessWire project so far: https://ricardo-vargas.com About the client: Ricardo Vargas is a specialist in project management and strategy implementation. He's an accredited professional and author of several books. Since 2007, he publishes a bilingual podcast about project management with millions of episodes listened. From 2012 to 2016, he worked for the United Nations Office for Project Services (UNOPS) in Copenhagen, Denmark. He currently lives in Portugal. The previous site was developed in 2009 using Wordpress by my team at the agency I was working for. In 2011, Ricardo invited me to work with him and I started to maintain the site ever since. The front-end side was good, performance-wise, but the backend started to become horrendous to work with so in 2012 I started my quest to find a better CMS and found PW. After developing small projects and messing around with it I convinced my client/boss last year to let me develop his new website with PW. I did all the stuff (design, frontend, backend, and server ops) so if you find something buggy or strange, let me know, please! I'll appreciate! The site is currently running on Digital Ocean droplet with 2GB of RAM. Nginx and Cloudflare (for SSL mostly). I'm using forge.laravel.com to manage it. Approx. 3,000 unique users per day doing 72,421 requests (Cloudflare stats). Key features: Pages are loaded with ajax using https://github.com/miguel-perez/smoothState.js so the podcast player (Soundmanager ) can continue to play the podcast episode as the user navigates other pages. Member area where the user can see the books his own (and download their files) and also see his bookmarks and reports. I imported and the users (+ 4k) from the WP database and decided to get rid of passwords (the future!) so after some research and tests, I chose Auth0 login system. I've mentioned the member area on this topic (there are a couple of screenshots there): Modules used AdminLinksInFrontend AdminOnSteroids AdminTemplateColumns Auth0Login (Custom made) BatchChildEditor ClearCacheAdmin FieldtypeRuntimeMarkup FlickrAPI (Custom made) FormBuilder InputfieldCKEditor MarkInPageTree MarkupLoadRSS PageReferencesTab PageViews (Custom made) PduReport (Custom made) PrevNextTabs ProCache ProDrafts ProcessDatabaseBackups ProcessJumplinks ProcessSendyAPI (Custom made) ProcessWireUpgrade ReaderAreaManager (Custom made) SlideshareAPI (Custom made) TemplateLatteReplace TextformatterAccordion TextformatterHannaCode TextformatterMarkExternalLinks TextformatterMultiValue TracyDebugger UserBookmarks (Custom made) WireMailMailgun importPagesCSV2 points
-
I was trying to be extra cautious just in case someone could spoof DETECT mode, although I don't really think that is an issue - I will revisit this sometime soon, because it would be nice if this was always available. Use the "Logout" button - that will log you out so you are a "guest", but still keep the Tracy debug bar available and keep the User Switcher session alive. Feel free to post any suggestions for improvements as you play around with this.2 points
-
might address this somewhat with the revamped subscribers module which im going to be working on soon... what did you want to see? I though of putting together a site profile job site as an example of how to use it in production.2 points
-
Yes. It was my bad. I did not make sure the FieldtypeCheckbox always returned a boolean. I think it returns 0/1 in ProcessWire. Anyways, just patched it. Update to the latest version and it should work. Edit: As always, thanks for the feedback.2 points
-
Yeah, it would be a good idea to make a cheat sheet on these hidden "shortcuts".2 points
-
I have had this module sitting in a 95% complete state for a while now and have finally made the push to get it out there. Thanks to @teppo for his Hanna Code Helper module which I referred to and borrowed from during development. http://modules.processwire.com/modules/hanna-code-dialog/ https://github.com/Toutouwai/HannaCodeDialog HannaCodeDialog Provides a number of enhancements for working with Hanna Code tags in CKEditor. The main enhancement is that Hanna tags in a CKEditor field may be double-clicked to edit their attributes using core ProcessWire inputfields in a modal dialog. Requires the Hanna Code module and >= ProcessWire v3.0.0. Installation Install the HannaCodeDialog module using any of the normal methods. For any CKEditor field where you want the "Insert Hanna tag" dropdown menu to appear in the CKEditor toolbar, visit the field settings and add "HannaDropdown" to the "CKEditor Toolbar" settings field. Module configuration Visit the module configuration screen to set any of the following: Exclude prefix: Hanna tags named with this prefix will not appear in the CKEditor toolbar dropdown menu for Hanna tag insertion. Exclude Hanna tags: Hanna tags selected here will not appear in the CKEditor toolbar dropdown menu for Hanna tag insertion. Background colour of tag widgets: you can customise the background colour used for Hanna tags in CKEditor if you like. Dialog width: in pixels Dialog height: in pixels Features Insert tag from toolbar dropdown menu Place the cursor in the CKEditor window where you want to insert your Hanna tag, then select the tag from the "Insert Hanna tag" dropdown. Advanced: if you want to control which tags appear in the dropdown on particular pages or templates you can hook HannaCodeDialog::getDropdownTags. See the forum support thread for examples . Edit tag attributes in modal dialog Insert a tag using the dropdown or double-click an existing tag in the CKEditor window to edit the tag attributes in a modal dialog. Tags are widgets Hanna tags that have been inserted in a CKEditor window are "widgets" - they have a background colour for easy identification, are protected from accidental editing, and can be moved within the text by drag-and-drop. Options for tag attributes may be defined You can define options for a tag attribute so that editors must choose an option rather than type text. This is useful for when only certain strings are valid for an attribute and also has the benefit of avoiding typos. Add a new attribute for the Hanna tag, named the same as the existing attribute you want to add options for, followed by "__options". The options themselves are defined as a string, using a pipe character as a delimiter between options. Example for an existing attribute named "vegetables": vegetables__options=Spinach|Pumpkin|Celery|Tomato|Brussels Sprout|Potato You can define a default for an attribute as normal. Use a pipe delimiter if defining multiple options as the default, for example: vegetables=Tomato|Potato Dynamic options Besides defining static options as above, you can use one Hanna tag to dynamically generate options for another. For instance, you could create a Hanna tag that generates options based on images that have been uploaded to the page, or the titles of children of the page. Your Hanna tag that generates the options should echo a string of options delimited by pipe characters (i.e. the same format as a static options string). You will probably want to name the Hanna tag that generates the options so that it starts with an underscore (or whatever prefix you have configured as the "exclude" prefix in the module config), to avoid it appearing as an insertable tag in the HannaCodeDialog dropdown menu. Example for an existing attribute named "image": image__options=[[_images_on_page]] And the code for the _images_on_page tag: <?php $image_names = array(); $image_fields = $page->fields->find('type=FieldtypeImage')->explode('name'); foreach($image_fields as $image_field) { $image_names = array_unique( array_merge($image_names, $page->$image_field->explode('name') ) ); } echo implode('|', $image_names); Choice of inputfield for attribute You can choose the inputfield that is used for an attribute in the dialog. For text attributes the supported inputfields are text (this is the default inputfield for text attributes so it isn't necessary to specify it if you want it) and textarea. Note: any manual line breaks inside a textarea are removed because these will break the CKEditor tag widget. Inputfields that support the selection of a single option are select (this is the default inputfield for attributes with options so it isn't necessary to specify it if you want it) and radios. Inputfields that support the selection of multiple options are selectmultiple, asmselect and checkboxes. You can also specify a checkbox inputfield - this is not for attributes with defined options but will limit an attribute to an integer value of 1 or 0. The names of the inputfield types are case-insensitive. Example for an existing attribute named "vegetables": vegetables__type=asmselect Descriptions and notes for inputfields You can add a description or notes to an attribute and these will be displayed in the dialog. Example for an existing attribute named "vegetables": vegetables__description=Please select vegetables for your soup. vegetables__notes=Pumpkin and celery is a delicious combination. Notes When creating or editing a Hanna tag you can view a basic cheatsheet outlining the HannaCodeDialog features relating to attributes below the "Attributes" config inputfield. Advanced Define or manipulate options in a hook You can hook HannaCodeDialog::prepareOptions to define or manipulate options for a Hanna tag attribute. Your Hanna tag must include a someattribute__options attribute in order for the hook to fire. The prepareOptions method receives the following arguments that can be used in your hook: options_string Any existing string of options you have set for the attribute attribute_name The name of the attribute the options are for tag_name The name of the Hanna tag page The page being edited If you hook after HannaCodeDialog::prepareOptions then your hook should set $event->return to an array of option values, or an associative array in the form of $value => $label. Build entire dialog form in a hook You can hook after HannaCodeDialog::buildForm to add inputfields to the dialog form. You can define options for the inputfields when you add them. Using a hook like this can be useful if you prefer to configure inputfield type/options/descriptions/notes in your IDE rather than as extra attributes in the Hanna tag settings. It's also useful if you want to use inputfield settings such as showIf. When you add the inputfields you must set both the name and the id of the inputfield to match the attribute name. You only need to set an inputfield value in the hook if you want to force the value - otherwise the current values from the tag are automatically applied. To use this hook you only have to define the essential attributes (the "fields" for the tag) in the Hanna Code settings and then all the other inputfield settings can be set in the hook. Example buildForm() hook The Hanna Code attributes defined for tag "meal" (a default value is defined for "vegetables"): vegetables=Carrot meat cooking_style comments The hook code in /site/ready.php: $wire->addHookAfter('HannaCodeDialog::buildForm', function(HookEvent $event) { // The Hanna tag that is being opened in the dialog $tag_name = $event->arguments(0); // Other arguments if you need them /* @var Page $edited_page */ $edited_page = $event->arguments(1); // The page open in Page Edit $current_attributes = $event->arguments(2); // The current attribute values $default_attributes = $event->arguments(3); // The default attribute values // The form rendered in the dialog /* @var InputfieldForm $form */ $form = $event->return; if($tag_name === 'meal') { $modules = $event->wire('modules'); /* @var InputfieldCheckboxes $f */ $f = $modules->InputfieldCheckboxes; $f->name = 'vegetables'; // Set name to match attribute $f->id = 'vegetables'; // Set id to match attribute $f->label = 'Vegetables'; $f->description = 'Please select some vegetables.'; $f->notes = "If you don't eat your vegetables you can't have any pudding."; $f->addOptions(['Carrot', 'Cabbage', 'Celery'], false); $form->add($f); /* @var InputfieldRadios $f */ $f = $modules->InputfieldRadios; $f->name = 'meat'; $f->id = 'meat'; $f->label = 'Meat'; $f->addOptions(['Pork', 'Beef', 'Chicken', 'Lamb'], false); $form->add($f); /* @var InputfieldSelect $f */ $f = $modules->InputfieldSelect; $f->name = 'cooking_style'; $f->id = 'cooking_style'; $f->label = 'How would you like it cooked?'; $f->addOptions(['Fried', 'Boiled', 'Baked'], false); $form->add($f); /* @var InputfieldText $f */ $f = $modules->InputfieldText; $f->name = 'comments'; $f->id = 'comments'; $f->label = 'Comments for the chef'; $f->showIf = 'cooking_style=Fried'; $form->add($f); } }); Troubleshooting HannaCodeDialog includes and automatically loads the third-party CKEditor plugins Line Utilities and Widget. If you have added these plugins to your CKEditor field already for some purpose and experience problems with HannaCodeDialog try deactivating those plugins from the CKEditor field settings.1 point
-
This module allows the page name to change when the title is edited. Modules directory: http://modules.processwire.com/modules/page-rename-options/ Github: https://github.com/adrianbj/PageRenameOptions I'd love to think that this module was not necessary for me but, especially during development, I find that page titles often change and I'd really rather have the names/urls match the title. I don't think you can expect clients to remember to change the name when they change the title, or even if they do, they still have to get it right which can be a challenge with a long article names with characters not allowed in page names. With none of the config settings checked, the default behavior is to have the page name always match changes to the page title, but allow the user to manually edit if they want. The options allow you to protect initial differences (changes you may have made as a user with an exempt role), completely disable manual changes, or protect manual name changes from subsequent changes to the title while editing. My preferred settings are to set the exempt role as superuser, and check "Initial Differences Protected" and "Prevent Manual Changes". CONFIG SETTINGS Exempt Roles The selected roles will not be subject to any of the rules below. The name will change automatically with the title, but they will be able to manually edit the page name as desired. Excluded Pages Pages that are excluded from the actions of this module. Changing the titles of selected pages will behave as though this module is not installed. For multi-language sites it is recommended to select the site's homepage. Initial Differences Protected If checked, further changes to the name (to match a changing title) will not happen if the name is already different from the title (evaluated on page edit initial load) Prevent Manual Changes If checked, it won't be possible to manually edit the name. If checked, this will disable the "Live Changes Protected" setting since it won't be possible to make any manual changes. Live Changes Protected If checked, further changes to the name (to match a changing title) will not happen if the name field was manually changed at any time during the current page edit. Please test the behavior of each setting thoroughly so you understand what each one does! Please let me know if you have any further requirements around permissions / role access to the module's functionality.1 point
-
Looking to write a tricks and tips article, anyone got anything which is SUPER useful for Processwire users which sits outside of installation and general usage and structure? Maybe things you wish you were told, or little tricks to get around restrictions or issues.1 point
-
+1 Or you might want to look for non PW solutions which must be integrated for sure, so that is some extra work. I've just read about this one the other day: http://www.responsivefilemanager.com/1 point
-
Loading of regular pages might benefit a tiny bit from using my module, but managing images would still be prone to the same delays if you put all images into a single library (which is just a page behind the scenes). You might still be able to make use of it if you can separate images into different libraries (e.g. by categorizing them into logos, photos, product images etc.) so numbers stay manageable. Media Library uses PW's native tools (file/image fields, CKEditor pwimage plugin), and I have to admit, I haven't tested those (and my module) with a big number of images - the module is a result of an internal requirement at work, where the number tends to stay well below 100. I'd say give it a quick try in a test system (perhaps in conjunction with the FileFieldTweaks option of @tpr's AdminOnSteroids). If you find you need something more elaborate though, @kongondo's Media Manager pro module might be worth a look.1 point
-
1 point
-
Hi @Ivan Gretsky - you need to manually set the output mode to "DEVELOPMENT" to make the User Switcher work. I initially set it up this way as an additional security layer, but I am thinking about revising the need to do this. Let me know if you still have any problems.1 point
-
@palacios000 - you need the "filename" rather than "url" of the attachment. Also if the files field allows more than one, make sure to do first() etc as well.1 point
-
Hi @noelboss, welcome to the forums! You should have installed the necessary fields and module instead, and their install process will take care of everything. As the documentation says:1 point
-
1 point
-
This sounds great to me! Tricks and tips can be useful, but if you have the time, a tutorial can be more helpful, but obviously requires more time. The topic of "newsletters and frontend users" is worth the effort, I think. I'm thinking of targeting somewhat experienced developers new to ProcessWire, so you should not have to delve into all the details, but provide working example code with comments and some explanation, just like you did in the case of your Beginner’s modules tutorial, but this time it would be more lengthy I think.1 point
-
im looking to revamp the Subscribers module soon and create a site to show its implememtation - I was thinking a simple job listing CV site unless someone could think of anything better?1 point
-
1 point
-
Only after hooks have access to the old return value, so to modify it you need to use an after hook. But you should be able to hook before a hookable function and return something completely custom. At least when making sure you do use $event->replace = true, because otherwise the hookable function would run as well and replace your custom return value.1 point
-
@Nurguly Ashyrov Thanks for the video ! i'm using your module with Vue.js for a web application, really nice. I'm juste facing a problem right now, i get an error when trying to get checkboxes : Not valid resolved type for field \"checkbox_name\" (the field access is allowed in graphql settings). Any idea ?1 point
-
This hook didn't work for me. Maybe something in the API has changed? Reading up on hooks that modify the return value, I found that only After hooks can modify it. I modified @Macrura 's code and this is working for me on 3.0.42 wire()->addHookAfter('Page::path', function($event) { $page = $event->object; if($page->template == 'landing-page') { // ensure that pages with template 'landing-page' live off the root $event->return = "/$page->name/"; } });1 point
-
1 point
-
There is no module i know of that can import external content, it is also somewhat complicated unless you know that the contents of the wikipedia page have some structure you can parse and get only the main text; typically for something like this you would use the simple html dom parser and using a module/hook on save for that template and then put those contents into your body field... you'd have to probably write some logic to get only the part you need, using the dom parser api another concept is to copy the page and paste it into your body field manually, and if you use the ImportExternalImages module, it should grab all of the images and add them to your local site.1 point
-
Hi @benbyf I cannot come up with something that has not been addressed in the forums in some way or another, there is so much buried here that it is probably impossible to decide what should be highlighted more than others. It might not fit your current needs, but what I would like to see in a more concise/tutorial like manner is implementing complete frontend user features from scratch. Well, maybe not from scratch, you could use UIkit 3 to do the design stuff, but other than that only pure PW could be used, even without the backend's form API. Something like this one turned into a complete tutorial: Such a tutorial would not only provide on solution to the long standing "how to do frontend users" dilemma, but it would also be a great example of implementing forms, sending emails, etc..1 point
-
Hi @Alex L As far as I can see you need to implement your own version of "article summary" so that you have something to output instead of "body". Such as: https://processwire.com/blog/posts/pw-3.0.28/ You can also extract the first paragraph in various ways: http://stackoverflow.com/questions/8757826/i-need-to-split-text-delimited-by-paragraph-tag Hope this helps. If get stuck just post what you implement so that we can help further.1 point
-
You mean @horst's Image Animated GIF module? Compatibility is set to 2.5, 2.6, 2.7, 3.0, so maybe that's why?1 point
-
1 point
-
@ank you may try echo $input->post['field_optionselect']->title . Or you can do a var_dump($input->post['field_optionselect']) in your template. That will tell you in which format the data is there and how you can access subfields like 'title'. For using field data on the redirect page, youcould take the values of the fields and attach them as URL query strings to the redirect URL. Dummy code // in the template with your form process the fields from your form $valueField1 = $sanitizer->text($input->post['field1']); // send them to the redirect page as url querie strings $session->redirect("yourredirecturl" . "?field1=$valueField1"); // in the template of your redirect page, you can now get the value $valueField1 = $input->get['field1']; // and then do with it what you want1 point
-
Are you absolutely sure you are on the same domain after the redirect? I had some issues with redirect to subdomains.1 point
-
Just popped in to praise the getlines filter's coolness I have a CKEditor field containing a simple unordered list. I wanted to animate each lines separately but it wasn't possible because the whole UL was rendered together so I couldn't add the required classes to each LI's. Using getlines together with striptags filter it's now possible ($iterator is built-in): <ul n:inner-foreach="($p->body|striptags|getlines) as $key => $value"> <li data-animate data-animation-classes="animated fadeInLeft" data-animation-delay="{$iterator->counter * 300 + 200}"> <h3>{$key}</h3> {$value} </li> </ul> Of course I could add the required attributes in CKEditor but that would require more troubles (modifying CKEditor field to allow attributes, hardcoded delay values, etc).1 point
-
it's a really amazing module, and will be indispensable for any site using hanna codes, i can already see this solving major problems with users entering incorrect stuff into their hanna codes. the options and description stuff is also amazing work!1 point
-
Great thing @Robin S! Something to make content creation even easier. I see there is an option to exclude some Hanna codes from the list. What do you think about a whitelist option (preferably overridden on a template basis)?1 point
-
@Torsten - welcome to the forums. Firstly, PW no longer uses TinyMCE by default - it now uses CKEditor. Here is a post on how to set up RTL for CkEditor: Hope that helps.1 point