Leaderboard
Popular Content
Showing content with the highest reputation on 08/07/2017 in all areas
-
I could provide a few Forum links which deal with issues similar to yours but @maxf5 is right: if you want to render the Repeater Items on individual pages under their own URL then you are better off either using Page Reference fields with Parent/Child relationship in the Page Tree, or you can also use PageTable. Note that a normal PageTable setup is also very similar to a usual Parent/Child relationship setup, however using PageTable has similar benefits as using Repeaters. Repeaters are normally desirable when you do NOT have to render individual pages for the repeaters, such as: galleries, sliders, product variations and so on.4 points
-
4 points
-
Glad you fixed it. Good luck with the development of your website2 points
-
Hi Andreas_D, This isn't due to an error or bug, it's intended Mac OSX functionality. However, it's awful. I hate when browsers change the way the page functions. Now for the work around. I would do something like this, it's not perfect, I just threw it together, but it should work in your case. $(window).on("wheel", function(e) { var delta = e.originalEvent.wheelDelta / 120; var edge = [0, $(document).height() - $(window).height()].indexOf($(this).scrollTop()); if(delta > 0 && edge == 0 || delta < 0 && edge == 1) e.preventDefault(); });2 points
-
Thank you gmclelland, I'll take a look at the module, looks promising. ...ok, I have a modified version of the twig module for the "TemplateEngineFactory" Module. If someone is interested: https://github.com/cojaco/TemplateEngineMustache2 points
-
There is the Page Reference with Date Field module that might be useful for this sort of thing. I've never used it and the module page doesn't indicate that it is compatible with PW3. But the real problem with using Page Reference fields for likes or any purpose that could potentially use thousands of pages is that there is no pagination or limiting possible when getting the field value. So it's not just a matter of dealing with the inputfield in Page Edit but also the impact on memory when getting the value via the API. There's an open request about this but no sign of activity.2 points
-
@joshuag, you say in the email: I think it would be good if you do bump the version number each time you make a release even if it is for bug fixes. Otherwise it isn't clear from the PW modules listing whether that installation has been updated to the latest version, so it's harder to keep track if you have multiple sites running Recurme. Also, it will be easier for you in terms of support if you can ask what the installed version number is and know from that what release of Recurme the user has installed.2 points
-
A few references to Hooks: https://processwire.com/api/hooks/ https://somatonic.github.io/Captain-Hook/index.html https://github.com/adrianbj/TracyDebugger/tree/master/panels/CaptainHook http://www.flamingruby.com/blog/using-hooks-to-alter-default-behavior-of-processwire/ https://webdesign.tutsplus.com/tutorials/a-beginners-introduction-to-writing-modules-in-processwire--cms-268622 points
-
One of PW 3.010's major novelty was the introduction of Horst's new image resizing engine that uses ImageMagick. Now I understand that ImageMagick can convert images to Webp, the image format that Google says can reduce image size up to 34% compared to JPEG. Mozilla is apparently adding support to Firefox, and even the Safari team is playing with it, so it looks like Webp is soon going to be available in most major browsers. If Horst's module can be extended to add Webp conversion, that would be a great addition to PW's already very powerful image manipulation arsenal. I'm currently using the free ImageEngine Lite to serve Webp images to supporting browsers, and the results are impressive. I routinely get images that are between 25 and 60% smaller compared to JPEG, with the same visual quality. I would love to eliminate the need to rely on a third-party service though.1 point
-
OAuth2Login for ProcessWire A Module which give you ability to login an existing user using your favorite thrid-party OAuth2 provider (i.e. Facebook, GitHub, Google, LinkedIn, etc.).. You can login from the backend to the backend directly or render a form on the frontend and redirect the user to a choosen page. Built on top of ThePhpLeague OAuth2-Client lib. Registration is not handled by this module but planned. Howto Install Install the module following this procedure: - http://modules.processwire.com/modules/oauth2-login/ - https://github.com/flydev-fr/OAuth2Login Next step, in order to use a provider, you need to use Composer to install each provider ie: to install Google, open a terminal, go to your root directory of pw and type the following command-line: composer require league/oauth2-google Tested providers/packages : Google : league/oauth2-google Facebook: league/oauth2-facebook Github: league/oauth2-github LinkedIn: league/oauth2-linkedin More third-party providers are available there. You should be able to add a provider by simply adding it to the JSON config file. Howto Use It First (and for testing purpose), you should create a new user in ProcessWire that reflect your real OAuth2 account information. The important informations are, Last Name, First Name and Email. The module will compare existing users by firstname, lastname and email; If the user match the informations, then he is logged in. ie, if my Google fullname is John Wick, then in ProcessWire, I create a new user Wick-John with email johnwick@mydomain.com Next step, go to your favorite provider and create an app in order to get the ClientId and ClientSecret keys. Ask on the forum if you have difficulties getting there. Once you got the keys for a provider, just paste it into the module settings and save it. One or more button should appear bellow the standard login form. The final step is to make your JSON configuration file. In this sample, the JSON config include all tested providers, you can of course edit it to suit your needs : { "providers": { "google": { "className": "Google", "packageName": "league/oauth2-google", "helpUrl": "https://console.developers.google.com/apis/credentials" }, "facebook": { "className": "Facebook", "packageName": "league/oauth2-facebook", "helpUrl": "https://developers.facebook.com/apps/", "options": { "graphApiVersion": "v2.10", "scope": "email" } }, "github": { "className": "Github", "packageName": "league/oauth2-github", "helpUrl": "https://github.com/settings/developers", "options": { "scope": "user:email" } }, "linkedin": { "className": "LinkedIn", "packageName": "league/oauth2-linkedin", "helpUrl": "https://www.linkedin.com/secure/developer" } } } Backend Usage In ready.php, call the module : if($page->template == 'admin') { $oauth2mod = $modules->get('Oauth2Login'); if($oauth2mod) $oauth2mod->hookBackend(); } Frontend Usage Small note: At this moment the render method is pretty simple. It output a InputfieldForm with InputfieldSubmit(s) into wrapped in a ul:li tag. Feedbacks and ideas welcome! For the following example, I created a page login and a template login which contain the following code : <?php namespace ProcessWire; if(!$user->isLoggedin()) { $options = array( 'buttonClass' => 'my_button_class', 'buttonValue' => 'Login with {provider}', // {{provider}} keyword 'prependMarkup' => '<div class="wrapper">', 'appendMarkup' => '</div>' ); $redirectUri = str_lreplace('//', '/', $config->urls->httpRoot . $page->url); $content = $modules->get('Oauth2Login')->config( array( 'redirect_uri' => $redirectUri, 'success_uri' => $page->url ) )->render($options); } The custom function lstr_replace() : /* * replace the last occurence of $search by $replace in $subject */ function str_lreplace($search, $replace, $subject) { return preg_replace('~(.*)' . preg_quote($search, '~') . '~', '$1' . $replace, $subject, 1); } Screenshot1 point
-
just a wild guess and maybe complete nonsense but did you try your script without the logging? the log saves to files, so maybe that's getting slow (and huge logfiles)? but copying half a million pages data from parents to children sounds not too good anyhow and i guess (second guess in 3 sentences ^^ ) there is a better solution...1 point
-
@Vayu Robins: thanks for your suggestion, but to be honest I'm a bit hesitant when it comes to this module and tracking values. I'm hoping to update my Version Control module to PW3 sometime soon, and perhaps after that I'll revisit this idea. Just to be clear, there are a couple of reasons why I'm hesitant about this: First of all that would require storing a lot of additional data, which could quickly become a performance issue. Sure, I could make this an optional feature, but all things considered I'm just not sure if it's really worth it. Second of all storing and outputting such data would get really complicated really soon. It's easy as long as we're just talking about simple text or textarea type fields, but what about HTML, fieldtypes with a bunch of different data columns, and files or images? The easy way out would be to only support a limited set of fieldtypes, but I'm worried that this would be a slippery slope And, finally, I'd like to draw some sort of a line between this module and Version Control. Version Control is the rather complex beast that allows you not just to view what was changed, but also makes it possible to switch between different versions of a page. Changelog was always intended as a simple tool for quickly checking who changed what and when.1 point
-
This module uses namespaces which has been introduced with PW 3. I upgraded all my projects to PW 3.x, so I have no need to test and support older versions.1 point
-
Hi, If you go to a page that doesn't show up, and you go to the settings of that page, is the checkbox checked to activate the english URL? See image below, the checkbox should be checked1 point
-
Thank you Tom. I think the problem for me with the rubberband overscrolling is that it runs well on Mozille but not Safari or Chrom. To recognize mistakes and find solutions is just really difficult. But the forum is already great were all very helpful.1 point
-
@Andreas_D just read that you are a beginner, firstly welcome to ProcessWire. As a beginner, you couldn't have started anywhere else better. I wish I knew about ProcessWire when I started rather than struggling with WordPress. Even now I'm a professional, ProcessWire is something that grows with your skill. It really is the best CMS/CMF out there for everyone at all skills. If you have any questions or need any help, feel free to DM me, I'm always happy to help.1 point
-
1 point
-
Thanks guys for the answers. Altough DOMSubtreeModified did work i found a solution that did'nt involve JS at all. But instead i made a hook to manipulate the PageList item labels.1 point
-
Hello @zaib I'm not quite sure what your issue with repeaters is. Can you please be more specific? Here are the docs if that helps: http://processwire.com/api/fieldtypes/repeaters/1 point
-
I have just sent out a general update via email that resolves the problems mentioned. Thanks everyone1 point
-
Edit September 2022 See this thread: --- I would have taken another way. As each photo are Page, he could create a module which work with a custom MySQL table where he update the like of a page with some informations aside, like the userID (the user who like the page), the pageID (the page being liked) , a likeStatus (like or unliked) and a timestamp. I made a small module to show the idea : then in the frontend, you can render a 'like' button on choosen templates, and finaly get the total number of likes of a page and the most liked page, see: <?php namespace ProcessWire; $likesmod = $modules->get('LikeSystem'); // render a 'like' button $content = $likesmod->render(); // total like of the page $content .= "Number of likes for this page: " . $likesmod->getTotal($page->id); // most liked page $limit = 1 $mostliked = $likesmod->getMostLikedPage($limit); $content .= "<br>Most liked page: " . $pages->get($mostliked[0]['pageId'])->title . "(" . $mostliked[0]['pageId'] . ") " . " (N likes: ". $mostliked[0]['likesCount'] . ")";1 point
-
Not sure how to help you, but you might be better off creating a TemplateEngineMustache module that extends the TemplateEngineFactory module: There is already sub modules created that you could look at for other template engines like Implementation of Twig: https://github.com/wanze/TemplateEngineTwig Implementation of Smarty: https://github.com/wanze/TemplateEngineSmarty Implementation of Jade (by dreerr, thanks!): https://github.com/dreerr/TemplateEngineJade https://github.com/dreerr/TemplateEnginePug I personally use TemplateEngineFactory with TemplateEngineTwig. Hope that helps1 point
-
I don't think you can store objects in $session. See this comment from Ryan for instance: Storing an array (without objects) seems to work: $my_array = []; $my_array['animal'] = 'cat'; $my_array['colour'] = 'orange'; $session->my_array = $my_array;1 point
-
@adrian Got this almost settled, do you have any information on how to save the fieldgroup conext settings for the repeater matrix field?? I see that they are saved through namespaces but I just can't seem to find a way to save them, this is what I am trying: EDIT: Found out, edited code below: $matrix_field_name = "content"; $matrix_type_namespace = "matrix12"; //Field inside repeater you want to edit it's property. $matrix_repeater_field_name = "feature_card_items"; $matrix_template = wire('templates')->get("repeater_$matrix_field_name"); $fieldId = wire("fields")->get("feature_card_items")->id; $matrix_fieldgroup = $matrix_template->fieldgroup; //Get the config data from the fieldgroup and the namespace which determines the field's settings based on the matrix repeater type. $matrix_field_data = $matrix_fieldgroup->getFieldContextArray($fieldId, $matrix_type_namespace); //Copy the data to edit it $matrix_field_data_new = $matrix_field_data; $matrix_field_data_new["description"] = "Bla bla bla"; //Reassign the data to the fieldgroup $matrix_fieldgroup->setFieldContextArray($fieldId, $matrix_field_data_new, $matrix_type_namespace); //Save fieldgroup context data, only unknwon wire("fields")->saveFieldGroupContext($matrix_fieldgroup->getField("feature_card_items", true), $matrix_fieldgroup);1 point
-
To solve this you need to look at the code for each method you are considering hooking and ask yourself things like: What class is the method in? Does the method fire when I need it to? Does the method have an argument or return value that I need to use in my hook? So you are considering hooking ProcessLogin::afterLogin() or Session::loginSuccess(). When you look at afterLogin() you see: It is a method of ProcessLogin, a Process module that handles the PW login form. So it is only going to fire if a user logs in via the core PW login form. Maybe that isn't what you want if you are using a custom login form or logging in users via the API as part of some script. It depends on what you are doing. The method comments in the source code say it is only intended for when a superuser logs in, which could give you a clue if it is the best method to hook or not. It has no arguments that could be useful to quickly tell you things about the user who has logged in (although you could still get the $user object in other ways). So chances are Session::loginSuccess() is going to be a better option because it is a method of Session, so more closely connected to the current user session regardless of how they logged in. And it conveniently has the $user object as an argument so you can easily check properties of the user such as name, role, etc, in your hook.1 point
-
Haven't used those hooks, yet. Probably ___loginSucces() - but probably you could do a $session->redirect() as a somewhat dirty hack at ___afterLogin(), too. I'd suggest to just try it out. If you run into a more specific problem and you have some code to look at, we could help more I guess1 point
-
If you are OK with a hacky solution, then DOMSubtreeModified might do it. I'm not a JS guru but a few days ago I used it to detect "AJAX update", well, sort of:1 point
-
1 point
-
Headings Case A plugin for CKEditor fields in ProcessWire CMS/CMF. Adds a toolbar button for changing the case of all headings or selected headings between sentence case and title case. This is useful when you are copy/pasting text from a document that has been supplied with an inconsistent or incorrect system of capitalisation. Installation The plugin folder must be named "headingscase" – if needed, rename the folder to remove the "-master" suffix added by GitHub. Copy the "headingscase" folder to /site/modules/InputfieldCKEditor/plugins/ In the field settings for each CKEditor field that you want to activate the plugin for: Check the "headingscase" checkbox at Input > Plugins > Extra Plugins Add "HeadingsCase" at Input > CKEditor Settings > CKEditor Toolbar Usage To change the case of all headings, click the toolbar button with no text selected in CKEditor. The first click applies sentence case; the second click applies title case. To change the case of a single heading, select all or part of the heading in CKEditor before clicking the toolbar button. There can be situations where the results need manual correction: proper names, acronyms, etc. Exceptions for small words Certain short English prepositions and conjunctions (three letters or less) are excluded from capitalisation when title case is applied. Edit the exceptions array in the plugin source code if you want to customise this list of exceptions. https://github.com/Toutouwai/headingscase1 point
-
I suspect that what is actually happening is that the 'normal' browser and 'incognito' mode are caching two different versions of the page, the 'normal' probably being older. Try a completely different browser and see what happens. BTW you could also try changing your code to $meta_title = $page->get('meta_title|title'); which should do the same thing. (Coz that ternary is hideous and unnecessary ) This won't actually help with the current problem, but is much nicer code.1 point
-
Hi, just a hint: I do not yet have much experience in this but for a similar (but not exactly same) use case I use @adrian's PageProtector module which supports locking down all Unpublished and/or Hidden pages just by clicking two checkboxes. I use it to protect areas of the website which are not yet ready to be seen by the public. Of course in my case Published pages should be accessible by guests, but you might want to take a look at the module's code to see how he did it so that you can extend it to Published pages as well:1 point
-
1 point
-
Also, just an FYI - you can also use Admin Actions to batch activate languages.1 point
-
Hey everbody. I wanted to share something I have been working for quite some time, in total currently three premium Templates or Site-Profiles for ProcessWire 3 including a onepage template, a blog template and a blog+sidebar template. Here are some Quick Facts: Fully responsive Multilanguage support Full SEO support Optional Google Analytics Easily create new pages out of multiple predefined sections Lazyload the sections of a page [Group and update website-information into blogs] (blog, blog+sidebar) [Use tags to tag and group blog entries] (blog, blog+sidebar) [User-comments] (blog, blog+sidebar) [Create each page with or without sidebar] (blog+sidebar) Website-wide search by text or tags Password protect each page individually with sophisticated page-encryption with dummy texts and pixelated images Just go to https://pwtemplates.de to test the demos (e.g. blog-sidebar) and purchase them for a small expense allowance. Hope you like it!1 point
-
@maxf5 Please have a look at this post. Furthermore turning caching on could be complicated because the value of the hidden date field gets cached and this value is used for spam protection...1 point
-
Or you can use wireRenderFile a new addition to ProcessWires functions: https://processwire.com/blog/posts/processwire-2.5.2/#new-wirerenderfile-and-wireincludefile-functions echo wireRenderFile('markup/contact-markup.php', array( 'name'=>'john doe', 'address'=>'sample street', 'zip'=>'sample city' )); I did not test this example, but according to the docs it should work like this. Requires ProcessWire 2.5.21 point