Leaderboard
Popular Content
Showing content with the highest reputation on 01/20/2015 in all areas
-
Hello, all! Sorry if this should be in another forum, but I didn't see one for general introductions, testimonials, and the like. I actually don't need help yet (the documentation and existing forum threads have already been immensely helpful), but I am just finishing up my first project using ProcessWire and felt the need to come here and say thanks. I've been designing/developing websites for several years now, and this is by far the most intuitive CMS I've used...from both a development and end-user standpoint. I just showed my most recent client the backend a couple of days ago and he was amazed at how easy it was for him to update content. So, thank you!19 points
-
As a former (well, still current WP developer due to certain clients), I can tell you that your search is in fact over.4 points
-
Haha, sorry about that. I knew that title was misleading, but used it anyway! Wordpress more than anything else, but I've tried several over the years. Drupal and Joomla (of course), CMS Made Simple, Textpattern, a couple of flat-file systems...for two projects I even built a basic CMS on top of forum software (SMF and MyBB). I think my search might be over, though. Thank you all for the warm welcome!4 points
-
http://visualizingmodernchina.org The Visualizing Modern China web site is the online companion to an academic book by the same name. The web site presents images beyond what would have been economical to print. The pages are pregenerated. ProcessWire is on a different domain on the same server. (You will have to trust that ProcessWire is involved, because there is little evidence of it!) I used the CropImage module. Images are stored in the usual place in ProcessWire, then copied to the /images directory when a page is viewed or generated in PW.3 points
-
I added two config options: Including not only visible pages: optional, include all hidden and unpublished pages and pages that user doesn't have access to view Multiple Output: optional, multiple selection (using ASMSelect) Field settings: Select Lists: (settings above -> first one)3 points
-
I made it a row at the end of the profile as a temporary measure I think it could be confusing otherwise as I expect a photo with a link on it to open a larger version of the image or, at most, the website of the developer in this case. If we add several ways to get in touch with a developer (I'm thinking Twitter, LinkedIn and others) there would be some nice icons to click on and it would be trivial to make the first one be a speech bubbles icon and link to the forums using that one. @felix - I will get back to you later today - I have to do some other stuff first. @pideluxe - you are not alone with some of these thoughts. I think EllisLab have some nice categories - what I don't want to do is stray too far from what you can offer that relates to a website built with ProcessWire (Expression Engine's dev directory has a myriad of categories for example that I don't think all apply to their product) but many of those look good to be honest. I agree with you - budget is something I wanted to steer well clear of. I would rather clients (and devs looking for other devs/designers with PW experience) approach developers based on what they see of someone's work/services than only contact the dev with the lowest prices - it is nonsense to do this as, as you say, every project is different and the dev knows best what their time/skills on a particular project should cost. It is likely that we would look at the larger ideas further when thinking about a future version of the ProcessWire site as a whole, so some things will take a while. I do aim to add a few more things over coming weeks to the directory in terms of more fields you can fill out, but I didn't want to add too many options to begin with though as the more options you offer the more you have to check during the approval process - and I had no idea how long that was going to take to begin wtih Thanks to everyone for the feedback so far - keep it coming.3 points
-
Actually it would be nicer if those avatars would link to the developer. Instead of justhe a picture.3 points
-
I'm happy to announce that the official ProcessWire Developer Directory has been launched at http://directory.processwire.com It comprises a developer list and a map and is designed to allow anyone developing with ProcessWire to find each other. It also allows potential clients to find developers as well as illustrating how widely ProcessWire is used worldwide. The developer list displays in random order so as not to favour any one developer and is currently quite short, but it should grow nicely as you create your own profiles. The login process is linked to your ProcessWire forum account so the same details you use to login here will allow you to get started. There is a manual approval process as well as some rules so that we can ensure that the directory contains quality content and is free of spam. As a minimum, developers must have 10 posts here on the forums before they can login and post a profile, however after that there are relatively few restrictions - as long as you follow the guidelines on the Profile form and abide by the Terms and Conditions (a condition of submitting a profile) you will be fine. You may notice small icons/badges next to some developers - these are designed to recognise special contributions to the ProcessWire project and are awarded by staff as part of the approval process. Whilst checking each entry's content we cross-check against forum profiles, the modules directory and other sources to determine which badges apply to a developer. There are plans for more features over time which you can be notified about by checking the box at the end of the profile form. I look forward to seeing your profiles soon!2 points
-
Welcome chadamas, I've been using PW since late 2011, and I don't think about CMS's anymore. I suspect you will never look back.2 points
-
You would use the beautifier translate option (Sanitizer::translate) to have sanitizer use the special char conversion $name = $this->sanitizer->pageName($pageName_en, Sanitizer::translate); The chars are defined in the PageName module config screen, where you can set conversion for each char like "ö => oe", default is "ö => o"2 points
-
Why do you need the "../"? Shouldn't it be absolute from domain root "/en/contact/contacts-done/" Since you say you loose the post vars, try to inspect in console while posting, it tells you if it get's redirected. You just have to find the correct url that doesn't do it. Usually you just use $page->url in the language you are and post it to itself, then redirect after it was successful to show a success message. It's called PRG pattern http://en.wikipedia.org/wiki/Post/Redirect/Get to avoid getting send again when using back button or refresh etc. Edit: Just wanted to mention since I don't think it's good to post a contact form to a "done" page, what if there's form errors you want to show the form again?2 points
-
Is there any particular feature from PHP 5.4 you are using? I think many are using Ubuntu's release cycle (5 year LTS from 2012), where there will be PHP 5.3. for two more years (of course possible to update to 14.04).2 points
-
Thanks! It would be great to have a link of the developer page to the forums member page and if the developer created some modules the reference as well. (And I miss my module author icon )2 points
-
Ah. You’re overriding ProcessWire’s $user variable here: $user = $sanitizer->username($input->post->user); Now $user is just some string the visitor entered, and no longer the special user object. Just use a different variable like $username or something. The same thing applies for other API variables like $page, $pages, $session, etc. as well, of course.2 points
-
This module creates a blank dashboard page in your site admin and sets it as default when you login instead of the page list. It came from a need in a few projects where I was creating modules for various user roles to use and I didn't want them to see the page list at all, but needed to display various stats and quick access buttons. For example, if you have a person who is creating invoices or doing other back-office stuff in various other Process modules then as an admin you wouldn't want them to access the page tree anyway, and there are other scenarios where you might want to have a dashboard instead of launching straight into the page list. It also requires (and adds) a permission - "dashboard" - so you can create new roles and assign the dashboard permission to those roles - something you might want to do fairly commonly if you have a lot of admin modules that you want to restrict access to. Editing the template is simple - there is a dashboard.php template file in the /site/modules/ProcessDashboard/ folder (decided to leave it in there to keep it safe, but I might be tempted to move it into /site/templates/ ) as well as .js and .css files ready to add your code to. You can use the API as you usually would to create your dashboard experience. For example, display data based on user roles or even specific users using code like this: if ($user->hasRole('invoices') { echo "Hi staff member $user->name. View invoices to be processed below: ... ..."; } if ($user->name == 'pete') { // Show some super-awesome stuff here } You can also do away with the dashboard.php template file and edit the module directly, putting your code and output in the execute() function (the way most Process modules are written) but I decided to include the separate template file to make it easier for more people to use. This does touch on areas a few other modules have addressed to some degree (like diogo's Custom Admin Pages) but this is designed for one purpose - instant dashboard creation. You can download the module here: http://modules.processwire.com/modules/process-dashboard/ This module also uses code from diogo's ProcessHomeAdmin module so that the default admin page can be overridden.1 point
-
Some sites need widgets, as they have been called in some systems; a widget can be almost anything, like: tag cloud mini calendar menu quote rotator free text social sharing search contact info map This is a simple way to create widgets that can be shown in multiple "areas" of a page, as well as on specific pages. In this particular method you would need to setup each widget type you want and then determine how best to accept any necessary user input like content, pages select (like for a menu) or settings. This example uses include files for each widget type, and the name of the include file would match the name of the widget type, which is also a page field. In this example, I'm also using ListerPro to provide a widget management page. Fields The main fields used on this widget example are : title widget_location (page select - options in this case are footer and sidebar) widget_type (page select, you would configure your widget types as selectable options) pages_select (would be used for multiple pages and might apply to a menu widget) body - used for plain widgets selector (selector inputfield, used for telling the system where to show the widget) text_structured - for this i'm using a YAML field, but it could just as easily be a table; would depend on what you want to store; YAML would allow this single field to be used for varying requirements based on the widget type, but would be harder to validate and prone to user error; icon - a page select for an optional icon which is being used in the template, and would be shown as part of the widget. Files for each widget type you want to allow users to select from, you would need to create an include file with the markup for that widget, and then add that widget to the list of available widgets. here is an example for a site with several widget types: Selector & Output wherever you want to include the widgets (footer, sidebar etc.) you would run a $pages->find and then foreach through the widgets (in this case finding all footer widgets). In this case the (incredibly amazing new) selector field would be specifying what pages to show the widget on. We assume that most widgets won't have a selector specified, and will default to show the widget. if a selector is specified, we can check to see if this page fits the selector by using the $page->is($selector) syntax. <?php $widgets = $pages->find("template=widget, widget_location=footer, sort=sort"); foreach($widgets as $widget) { // check if the selector field is in use and if so, see if this page is supposed to display it: if( $widget->selector) { if( !$page->is("$widget->selector") ) continue; } $widgetType = $widget->widget_type->name; $include = file_exists("./inc/widget-{$widgetType}-foot.inc") ? "./inc/widget-{$widgetType}-foot.inc" : './inc/widget-footer.inc'; include($include); } ?> this example also has a fallback file in case the widget type is not specified, sort of a default. the widget's .inc file will be unique to your design and how you have it setup.1 point
-
This is a very basic guide on how to optimize a ProcessWire page for speed. It doesn’t go into the depths of optimization and perfect render paths but will provide you with some proven ProcessWire methods for faster websites. The big problems that are easy to fix are what we aim for. You want quick improvements? Then read on… First let's have a look ath the following graph. Those are the areas, we want to improve. Source: http://httparchive.org/interesting.php?a=All&l=Oct%201%202014 Clean up your HTML Look at your HTML source code. Are there any unnecessary parts? Remove anything that might not be needed and try to keep your markup as clean as possible. Avoid using too many external JS libraries or other tools. It is okay to include jQuery from a CDN, because most visitors will already have cached the file. Too many of those external requests will slow down the page. If possible, try to avoid render-blocking Javascripts and move your script tags to the end of the page, right before the body. In most cases, your Javascript will enhance your content but doesn’t need to fire before the site is rendered. Always think if you need to include another library or the fourth webfont on your site. Minify Markup The next step to save some bytes is to remove all whitespaces from your markup. It doesn’t have to look nice, it has to be loaded fast. We perform this trick with our new super-weapon: The AllInOneMinify module for ProcessWire. Install it like every other module for ProcessWire. Once activated, go to the module settings and tick the checkbox for “Minify HTML” and look at your sites source code. It should be minified. AIOM can handle conditional browser comments. If your layout depends on whitespaces you could “force” them by putting an into the markup. Optimize the CSS Now we’re heading for the next larger part of a usual website. We will combine all CSS files and then remove anything not needed (whitespace,comments) from it. Before we start, make sure your CSS files only contain rules that you really use. Especially if you’re using a framework like Bootstrap, most of the selectors are never used. Remove them carefully. We need the AllIneOneMinify module from the previous step again. After installation, open the template file where your HTML header is generated. We will now replace all stylesheet tags with a single file. AIOM needs to know all CSS (or even LESS) files, relative to your template folder. It will then output a link to a single, compressed CSS file. You might have this in your HTML head: <link href="<? echo $config->urls->templates;?>/css/grid.css "rel="stylesheet" /> <link href="<? echo $config->urls->templates;?>/css/style.css“ rel="stylesheet" /> Replace all links to Stylesheets with the single tag like this: <link href=”<? echo AIOM::CSS(array(‘css/grid.css’,’css/style.css’)));?>” rel=”stylesheet”/> You pass an array with the file names to the AIOM method CSS. It will return a link to the file. AIOM takes care of image urls inside CSS. It will detect changes in the source file and only generate a new file if necessary. While developing, you might want to turn on the “Development” checkbox in the module settings. Make JavaScript tiny Do the same as you do to the CSS to your Javascript files. First, clean up the code. Then install AIOM and compress all JS files into a single file using the AIOM::JS method that works as the AIOM::CSS method. For best results, think about including scripts like jQuery from a CDN and put your scripts below the content, before you close the body tag. Also note that the order on how your throw your JS files into AIOM might be important, depending on the code inside. Get the right image size. ProcessWire comes with great image tools. Use them, to make images exactly the size you need them. You don’t have to serve that little thumbnail with over 3000px length just because the editor wasn’t able to reduce the size. Example: Your designer wants to have a slider image with a maximum size of 600x320 pixel. To output the image with that exact dimensions, use the API accordingly: $sliderImage->size(600,320)->url; An even better way would be to use adaptive images or the new srcset attribute combined with a JS fallback. Then your site only delivers the image size as needed. Hint: Play around with the image quality setting in the config.php. Maybe you don’t need images with a JPG quality of 90+. Compress the images further with minimize.pw To make images even smaller, we can use the minimize.pw service. This service will compress images nearly lossless by using more complicated tools to reduce the size of PNGs and JPEGs. By doing this, you remove bytes from the largest chunk of your website weight. minimize.pw is free for 2000 images. Just enter your E-Mailadress and receive a free key Then you have to install the ProcessImageMinimize module and enter they key. You can now activate the option to automatically compress every image uploaded. It is fail-safe and will compress images in the background. Please note, the automatic mode only works with images uploaded AFTER you have activated the module. You can manually select image fields with the ->mz() API method. Just include it before you output the image in your template file: $myImage->width(300,300)->mz()->url; We've closed the service. You could use something similar like Imgix ( https://www.imgix.com/ ). Activate GZip compression on your site Another method to speed up your site is to activate GZip compression. The server will then send all files compressed to the client. This works with nearly all browsers and the CPU power required is minimal. You can tell your server to do this, by adding those lines to your .htaccess file in your root directory. Please take care, that you do not overwrite the ProcessWire rules in the file! For best results add them on the top of the .htaccess file: <IfModule mod_deflate.c> AddOutputFilter DEFLATE js css AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html </IfModule> This was taken from another forum post. Tell the client to cache stuff To make repeating visits faster, we can tell the browser to cache special files for a longer period of time. Again, add this on top of your .htaccess file: <IfModule mod_expires.c> ExpiresActive On ExpiresDefault "access plus 1 seconds" ExpiresByType image/x-icon "access plus 1 year" ExpiresByType image/jpeg "access plus 1 year" ExpiresByType image/png "access plus 1 year" ExpiresByType image/gif "access plus 1 year" ExpiresByType text/css "access plus 1 month" ExpiresByType text/javascript "access plus 1 month" ExpiresByType application/octet-stream "access plus 1 month" ExpiresByType application/x-javascript "access plus 1 month" </IfModule> <IfModule mod_headers.c> <FilesMatch "\\.(ico|jpe?g|png|gif|swf|woff)$"> Header set Cache-Control "max-age=31536000, public" </FilesMatch> <FilesMatch "\\.(css)$"> Header set Cache-Control "max-age=2692000, public" </FilesMatch> <FilesMatch "\\.(js)$"> Header set Cache-Control "max-age=2692000, private" </FilesMatch> <FilesMatch "\.(js|css|xml|gz)$"> Header append Vary: Accept-Encoding </FilesMatch> Header unset ETag Header append Cache-Control "public" </IfModule> Remember, that this caching might be annoying while developing the site. Use the internal cache (or ProCache) Another trick to make the site faster is to use a caching system. This will “store” your rendered site so you don’t have to query the database that often. We can either do this with the internal cache of ProcessWire or use the commercial, official ProCache module. Using the build-in system, you go the the setting page of a template and open the “Cache” register. You can now set the Cache time and what happens if something changes. The settings depend on the content of the site. Mostly static content can be cached longer and you might not need to reset the cache every time. Dynamic sites will need shorter cache times. ProCache (buy here) is even faster because it will bypass PHP and the database. Files are served directly as HTML. Please note, that caching might make the site faster but it can create new problems. Use with care. Summary Keep your code as clean as possible. Remove anything unnecessary and then compress HTML,CSS and JS using the AIOM module. The largest part of your page weight are images. Keep them small by using the appropriate dimensions and consider services like minimize.pw. In the end, use intelligent caching and buy ProCache. Following this guide takes not more than an hour but can speed up your site and make your visitors happy. This was just a quick overview of techniques to optimize your page speed. There is plenty of stuff you can do but the steps above are a good first step. Maybe you can share your favorite methods (or links) to start the discussion.1 point
-
Hi All, I am gladly posting my first site profile. Blue-VR Site Profile for ProcessWire Summary A site profile for corporate or personal website. Profile can be used with ProcessWire open source CMS/CMF version 2.3+. The front-end uses the Bootstrap 3.1 css framework for to get the responsiveness and mobile friendliness. Front-end Demo - bluevr.webcreate.lk Back-end Demo mode - bluevr-webcreate.lk/processwire (The username 'admin' and password 'bluevr2') Overall features * HTML5 & CSS3 + ({less}) * Build with bootstrap 3.1 * SEO Friendly * Clean & modern design * Responsive markup * Contact form and google map locations with multiple google markers * Testimonials using bxSlider * AIOM supports (Just install the module no need to touch the code) How to install Please take a copy of the latest ProcessWire (Replace the install, modules and templates directories with those in this profile, as shown below: - /site-default/install/ - /site-default/modules/ - /site-default/templates/ Make sure you do following steps as well 1. Add `tinymce` directory into /site-defaut. 2. Add the following two lines to your `/site/config.php` file: $config->prependTemplateFile = '_init.php'; $config->appendTemplateFile = '_main.php'; Download Github: https://github.com/gayanvirajith/BlueVrSiteProfile/ Credits I would like to thanks Ryan for giving us great CMS/CMF and modules. Hani AbuGhazaleh for a great module of Fieldtype: Select (AKA Drop Down) David Karich for providing such a nice module AIOM+. *** Please note that the site profile is still on testing stage. Thanks ------------------------------------------------------------------------ Edit: install instructions. Edit: Add credits Edit: Update live demo url Edit: Update back-end demo mode details1 point
-
It really is straightforward if you follow the the module 'Page Edit Field Permission' instructions Create all your extra fields for your Categories A - D Add those fields to the template 'blog-post' Create 3 roles . I say three since as per your description Category B and D seem to have the same fields? If not, create 4 roles and give them distinct names Install the module 'Page Edit Field Permission'. Make sure to read its instructions. In its configuration screen use the 'Handy Tool....' to create permissions for all your 'blog-post' fields that you want to limit access to. For instance, if you want all your users with the roles Categories A -D to be able to view the 'title' field, then there is no need to create a permission for it. The module will create permissions prefixed with 'page-edit-', e.g. if you ticked 'blog_body' as one of the fields in that screen, a permission 'page-edit-blog_body' will be created. Edit each of the roles you created in #3 and check the relevant permissions allowed for those roles. (i.e. give the roles access to edit selected blog fields). Edit and assign your users the different roles your created in #3. You can test with some dummy users, e.g. Jane, Samra, Onuko, Shah to represent your four Categories/Roles. Also give them the role 'blog-author' (needed by Blog). Edit the template 'blog-post'. In the Access tab, you should see the four roles created in #3. If they will all have 'view pages', 'edit pages', 'create-pages' and 'add children' privileges, then rather than granting these to each role, just assign the four privileges to the role 'blog-author' in that same screen. This is a template level access you are granting. Try logging in as each of your four dummy users. Edit a blog post. You will notice some fields are hidden depending on the role that user was assigned. Logging in as a superuser enables you to see all fields. That's it really...1 point
-
Looks like Ryan is already onto this - maybe you should hold off for a day or two: https://github.com/ryancramerdesign/ProcessWire/commit/bd16deaf8f9e690fc47e91766e479550042eea5d Maybe also keep an eye on CSV import module (http://modules.processwire.com/modules/import-pages-csv/) to see when that gets updated, or maybe it will work already with those core mods in that recent commit - not sure!1 point
-
I think you're looking for repeater or pagetable field https://processwire.com/talk/topic/6417-processwire-profields-table/page-2#entry63119 And for PageTable there's a extended version. https://processwire.com/talk/topic/7459-module-pagetableextended/1 point
-
The - vs _ is coming from the fact that the module makes use of $sanitizer->fieldName to convert the entered Label for the template into its name. fieldName doesn't allow dashes. I have committed a fix that should solve the mistake. Please let me know how it works for you now. As for the custom templates - it is really situation dependent, but I like it so that I can restrict the creation of new child pages to just one template so the site editors never have to choose the appropriate template when creating a new child page option.1 point
-
Regarding question one I would suggest looking at the Table ProField. It's a custom table, but inside of ProcessWire. Information about using processwire via command line can be found here: http://processwire.com/api/include/1 point
-
Pretty much, but with a few additions as well. I have created a Gist of the renderPosts() function here: In the demo blog-post.php and blog-posts.php you could use it as shown below (assumes you've already included the function) //assumes function renderPosts() already included in page $content .= renderPosts("limit=5", true, $options);//using our function above//blog-posts $content = renderPosts($page, '', $options) . $blog->postAuthor() . $blog->renderComments($page->blog_comments) . $blog->renderNextPrevPosts($page);//blog-post For featured image, the default is off (0) . So, you need to add an $options array with values for featured image 1 or 2 for the type(s) of post where you want a featured image (i.e. small or large). Below are the defaults: //display post's featured image: 0=off,1=top(above post-headline),2=bottom(first item in post-body)') $options = array('post_small_image' => 0, 'post_large_image' => 0);//these are the defaults -> off (zero) Btw, note that for large posts you cannot use an embedded image as the featured image. You will need to designate a featured image. For small posts, both embedded and images tagged 'featured' will be picked up as featured images.1 point
-
1 point
-
1 point
-
Wearing my non-pw hat for a second it is not uncommon for multimedia heavy sites (in my case large amounts of mapping) to be pre-seeded, usually using an automated routine written in an automation package (free ones are available and reasonably easy to use straight in the browser). This process in our case resizes, creates pyramids and initiates the cache. While this is overkill for 100 images and I'd agree with the solutions given by the previous poster, pre-seeding in this fashion is certainly an option for sites using vast amounts of multimedia.1 point
-
Welcome to the forum! Great to hear that you're liking PW, hope we'll be hearing from you often from now on1 point
-
lol I was hoping to see a romantic story literally. same here the UI is so superb and the admin alot of thought into it.1 point
-
No, you can't adjust that markup via options. There's other ways of doing it on the PHP side though, making it more foolproof than doing it client-side. See option #3 in this post (writing your own code to render posts): https://processwire.com/talk/topic/7403-module-blog/?p=83119 Maybe using str_replace: See this post by DaveP: https://processwire.com/talk/topic/7403-module-blog/?p=78348 Copy and modify the method renderPosts() into your own function which you can include in your template files Using #3 above, you can continue using the rest of MarkupBlog methods such as renderCategories() together with your own modified renderPosts(). If this doesn't make sense just ask1 point
-
1 point
-
<form role="form" action="../<?php $config->urls->root;?>contatti/contatti-invio/" method="post" > will be like... ..//contatti/contatti-invio/ ? Apart from that you have the italian url here so I'm not sure how you get the english one?1 point
-
Solved, the parent template "EDIT PAGES" for the current users role, needed to be ticked. Now it works fine, sorting pages from a custom dashboard within a MarkupAdminDataTable.1 point
-
ProcessWire performs a redirect if your URL where you send the form doesn't have a trailing slash. Is this the case? You can also use DevTools in Chrome or a Tool like Firebug and check what's going on with your request. Cheers1 point
-
Had to do this yesterday. But this works only on the newest dev version of processwire, because Ryan just implemented the removeTab() method. Older versions will still show the tab, but no actual form to delete something. <?php /** * ProcessWire 'Hello world' demonstration module * * ProcessWire 2.x * Copyright (C) 2014 by Ryan Cramer * Licensed under GNU/GPL v2, see LICENSE.TXT * * http://processwire.com * */ class RemoveDeleteTab extends WireData implements Module { /** * getModuleInfo is a module required by all modules to tell ProcessWire about them * * @return array * */ public static function getModuleInfo() { return array( 'title' => 'RemoveDeleteTab', 'version' => 1, 'summary' => '…', 'singular' => true, 'autoload' => true, ); } public function init() { // Remove Settings Tab in Global settings for non superadmins $this->addHookAfter('ProcessPageEdit::buildForm', $this, "removeDeleteTab"); } public function removeDeleteTab(HookEvent $event){ // check what role the user has, if superuser do nothing if($this->user->isSuperuser()) return; $page = $event->object->getPage(); if($page->template->name === "settings"){ $form = $event->return; $fieldset = $form->find("id=ProcessPageEditDelete")->first(); $form->remove($fieldset); $event->object->removeTab("ProcessPageEditDelete"); $event->return = $form; } } }1 point
-
Im using : <a href="<?php echo $pages->get(ID_OF_PAGE)->url; ?>"> <?php echo $pages->get(ID_OF_PAGE)->title; ?> </a> This way i get page that i want, i can change its name and title from inside admin panel. This way i dont have to go in code every time i want change title or parent of the page1 point
-
The more flexible way would be to not hardcode anything, like this. <a href="<?php echo $pages->get("template=login")->url; ?>">Sign in</a>1 point
-
Craig, I had used the Facebook login and didn't have a clue what password (if I even had one). I simply did password reset to get local password and used that when joining into directory.1 point
-
In ProcessWires index.php you can configure the name of the wire folder: $wireDir = 'wire'; https://github.com/ryancramerdesign/ProcessWire/blob/master/index.php#L77 I doubt Ryan is actively supporting and testing this, but might be worth a try. If you rename your wire-folder you will probably have to adjust some lines in your htaccess too.1 point
-
Mass editing view! Clicking field name on left would open field settings in modal - clicking field name on right would open template context field edit in modal. Interesting concept! It also shows nicely, that same field can belong to multiple template (ie. field is independent from template).1 point
-
Ask and you shall receive! Check out today's dev commits https://github.com/ryancramerdesign/ProcessWire/commits/dev "Add Adrian's ProcessTemplateFieldCreator for quick access to create new fields in ProcessTemplate."1 point
-
Nicely done. One little recommendation I have on the frontend is to utilize Slick Carousel instead of Bootstrap's carousel. It's much more powerful and has touch support, among many other features. I will eventually be switching some carousels I've done in the past to it. Zurb Foundation also recommends it now instead of their built in carousel (Orbit Slider, which is being deprecated). - Jonathan1 point
-
Maybe this helps someone. Nerd alert! Currently building a shop module for a project, where I was looking for a easy way to handle/store form data in session and later repopulate it easily using form API. It can be very tedious to do that manually grab the fields, store in session repopulate form. So I found a way to do it "automatically" by serializing form object and build a name => value array that I store in session, then retrieve the array later and convert it to WireInputData as it is required for form object to process. Further I needed to turn of CSRF temporarely to get around error when populating the form object. Here a example code for those interested. // generate $form // when sent if($input->post->send) { // process form $form->processInput($input->post); // if no errors if(!count($form->getErrors())){ // serialize form values and store in "shop" session namespace $formfields = $form->getAll(); $formdataKeys = $formfields->explode(function($item, $key){ return $item->name; }); $formdataValues = $formfields->explode(function($item, $key){ return $item->value; }); $formdata = array_combine($formdataKeys, $formdataValues); $session->setFor("shop", "userformdata", $formdata ); $session->redirect("nextpageurl"); } } else { // if session formdata found repopulate form object if($formdata = $session->getFor("shop", "userformdata")){ $formdataInput = new WireInputData($formdata); $form->protectCSRF = false; // to not get a CSRF validation error $form->processInput($formdataInput); // fills in form and validates it $form->protectCSRF = true; } } return $form->render();1 point
-
Let's see what happens. Of course alternatively, serializing the form object also works quite simply with a foreach, without using PW's WireArray::explode() which is fun anyway. After all the trick here is the $form->getAll(), which returns a InputfieldWrapper containing a flat array of only the fields whithout fieldsets and nested wrappers. And example of how to populate the form directly without using processInput($data), which requires to toggle the CSRF and the form validates and show errors when rendering the form. So setting values to the form object using $form->get(field)->attr("value", $value) does that "silently" and it doesn't trigger any validation thus not show errors when initially loading the form. if($input->post->send) { $form->processInput($input->post); if(!count($form->getErrors())){ $exclude = array("send"); // skip fields by name foreach($form->getAll() as $field) { if(in_array($field->name, $exclude)) continue; $formdata[$field->name] = strip_tags($field->value); } $session->setFor("shop", "userformdata", $formdata ); $session->redirect($this->page->url . $this->nextStepSegment); } } else { // populate data to form inputfields without using processInput(), which processes the form if($formdata = $session->getFor("shop", "userformdata")){ foreach($formdata as $name => $value) $form->get($name)->attr("value", $value); } } return $form->render();1 point
-
IMPORTANT - DO NOT USE THIS FOR A PRODUCTION SERVER This is not strictly a ProcessWire tutorial, except it really is very useful for developing ProcessWire websites. I have just rebuilt my little dev server and it was a right pain - basically, I made the mistake of following a couple of bits of really bad advice. I eventually nailed down the right thing to do in the right order from about three different sources and have decided to write it up. This tutorial will take you through installing a pristine, new version of Ubuntu on an old PC, setting it up to work on your local network (this is NOT a publicly facing server), installing Virtualmin, Samba window shares, and setting up your first virtual server. The main problem I found with the help that I followed, is that no one seemed to link all these install processes together - so a standard install of Ubuntu with Apache would completely mess up Virtualmin and make it all a nightmare. This is a PDF file without screenshots, but to be honest, I am not sure how screenshots of command line is particularly helpful to anyone! Feel free to use this and let me know if it actually worked. NOTE: I am not a sysadmin, so if you find strange errors, you are more likely to find the answer through Google than by asking me - this is just the result of me pulling my hair out for a day or so. I certainly cannot guarantee that this is perfect or even the best way. Installing Ubuntu and Webmin.pdf1 point
-
Table Use this for tabular data, like rate tables or other things that you might typically represent in a spreadsheet. Use it for situations where you don't need the full-blown flexibility of repeaters, as it's technically more efficient with far less overhead than repeaters. Something like the Events Fieldtype could be very easily re-created via a Table field, but the potential uses are far broader. But for the most part, think tabular data when it comes to the Table field. Multipliers This is good for when you need a range of values (whether text, textarea, numbers, dates, etc.). If you are using repeaters with just one field in them, you might be a lot better off with a Multiplier. Like the Table field, Multipliers are very efficient and low overhead relative to something like Repeaters. Use Multipliers when you need to repeat a single input multiple times, optionally with a min and max number of inputs. Lets say you are building an employee directory, and each employee has between 1 and 3 email addresses. Rather than using 3 separate email fields, you would use 1 multiplier field and specify min=1 and max=3. Repeaters These are infinitely flexible in terms of what they represent, but each row of values is technically a page in the system. As a result, with the flexibility comes significant overhead. This is really only an issue when the quantity of repeater items gets high, or when you have lots (thousands) of pages using repeaters. I recommend repeaters for setting up things like homepage carousels. For example, if you go to the Villas of Distinction homepage, there are 3 separate repeaters in use on that page, each holding a photo, title, description, link. The client can have as many items in each of those sections as they want. Currently it looks like the first repeater as 6 items, the 2nd has 2, and the 3rd has 6. The possibilities of what can be represented with repeaters is endless, but look for potential alternatives when dealing with large quantities (whether large quantities of repeater items, or large quantities of pages using repeaters). PageTable This is one of the ProFields that is available for free (thanks to Avoine sponsorship) on the ProcessWire dev branch. Meaning, it'll be available for everyone to use as part of the core in ProcessWire 2.5. And you can use it now if you don't mind running the dev branch. PageTable has all the flexibility of repeaters, but with lower overhead from the admin/input perspective. Rather than trying to bundle all the inputs on one screen, PageTable shows you a table of items and you click on the item to edit it in a modal window. This enables it to be a lot more efficient from the admin UI perspective. It's also more flexible than repeaters are in terms of where you store your items. PageTable lets you choose where they should live, whether as children of the page being edited, or as children of some other parent page you designate. They might be a little more work to setup than repeaters, but I think that most situations where you need the flexibility of repeaters may be better served by PageTable. PageTable still can't compete with the speed and efficiency of Table or Multiplier, but consider using PageTable anywhere that you might have used Repeaters before. Repeaters and PageTable are fundamentally different from the admin UI/input perspective, so you'd want to compare them yourself to see what suits your individual input needs better. PageTable involves more clicking to create and edit items, making Repeaters potentially faster for entering data rapidly. But PageTable will scale much further in the admin UI than Repeaters will, so I would personally favor PageTable in more situations than Repeaters.1 point
-
This is specific to any CMS or software you might run on a server (not just ProcessWire). When it comes to the security of the hosting, I prefer something dedicated (VPS or dedicated) so that you don't have multiple websites (managed by other users) sharing the same file system. When you are dealing with a shared file system, you've got more to consider when it comes to the permissions of files and such. You need to make sure that the permissions settings you've chosen for uploaded files and such is not going to give other accounts the ability to change them. You are also likely sharing MySQL instance with other users in a shared environment as well, so there's that matter of resources being shared. You can certainly secure the shared environment just as well as the dedicated one, but it'll take more work and monitoring. Shared hosting environments also represent a bigger prize to hackers, so that seems to be where they prefer to focus their efforts. I would go with a managed dedicated or managed VPS. For example, I think all the servers available from ServInt are managed (I know this one we're on right now is). One other recommendation would be to isolate your software. Don't run WordPress and ProcessWire from the same account if you don't have to. WordPress is always a target, and if you get broken into that way, then you could create problems for everything else running on the same account (this is not uncommon with WordPress at least).1 point
-
@Craig A Rodway, you covered the essentials very good. The client/company should have in existence a written, well documented and enforceable Data Access Policy. This covers what are the approved or disapproved uses of the system. The policy would also state explicitly most of what Craig A Rodway has already written. A good system would have initial training on Data Access (Policy manual, Video Review, Classroom training) where the main points are gone over. You would have a signature of acceptance and provide either semi-annual or annual recertification of the user's acknowledgement of understanding the Data Access Policy. Where logging is concerned, there needs to be a policy where someone actually reviews the logs (to include a written certification of review). The same goes for testing the backup/restore process. It must be a valid and frequently tested system (to include a written certification of acceptable testing results). Make sure that users who use the system but also have backend administrative responsibilities, have separate accounts for each function. Setup alerts/alarms for certain critical administrative actions that report the action being taken. These alerts/alarms would go to the system administrator and other trusted individuals who are outside of the normal system administration realm. The system administrator needs to know the alert/alarm system is working, Someone other than the system administrator(s) needs to be aware of what critical changes are being made to the system This alleviates anyone gaming or deliberately sabotaging the system. Basically a good system is based on trust and adequate verification techniques. Good luck on your project because the human factor is the achilles heel of any information system.1 point
-
That sounds like a really interesting project Some measures you can consider: Session inactivity timeouts. Force regular password changes and/or use 2-factor authentication. Use SSL. Ensure users can only access the data they are allowed to. Not just through interface options, but URLs as well. Look at the hosting infrastructure. Credentials to access it. Who has access? What about your provider? Where is your database is stored? (Shared hosting? Easy to guess credentials?) Look at how data is imported and exported within the system. Is it possible to bypass any validation or auth checks? Forms. They should definitely be using CSRF protection. Can user input be overloaded? That is, can I submit additional form values that the system doesn't check or expect, but still get saved to the DB. Logging. Log as much as you can in order to provide an audit trail. It is guaranteed that somewhere down the line, someone will ask the question "When did this record change to this value and who made the changed?" Backups. Hopefully the data will be backed up. How easy and quick can this be restored? What granularity? User education. Some users may need it explaining to them that sharing usernames and passwords, or writing them down, is not good practise. There are probably some additional things - that could start getting into the realms of penetration testing - but that's a summary things I can think of in a short time1 point
-
It's worth mentioning that whilst I've made it easy for newcomers to modules to create a dashboard template, it is worth learning how Process modules work so that you can create your own to do some amazing stuff in the ProcessWire admin. See the ProcessHello module as a starting point: https://github.com/ryancramerdesign/ProcessHello EDIT: There was also another way to do this module - I could have skipped creating a separate dashboard page under the admin page and simply made the admin page load the dashboard, however I quite like having the link in the menu at the top of the page so it's really obvious how to get back there.1 point