Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/18/2017 in all areas

  1. Released: https://modules.processwire.com/modules/process-documentation/ https://github.com/outflux3/ProcessDocumentation This is a new module that will be released soon - the purpose is to allow you to create help pages in the admin. This differs from the Admin Help module in the approach, and will be kept totally separate. The Admin Help modules provides the ability to make a help tab on any page edit screen (and optionally make that pop up in a lightbox), as well as a single process page showing all of the help pages in a single accordion. This module's workflow is different - first you can create your help pages any way you want using any template and any field for the body text. You can create unlimited admin help pages, using ProcessDocumentation, select the page to display, and then users can click on that in your menu to access the help page. You can create a folder structure by creating a top level menu item using ProcessList, and then various help pages under that parent using ProcessDocumentation. The module comes with 2 internally used textformatters, one of them adds classes needed to the markup for some elements to allow styling within the content and not conflict with admin theme rules (e.g. ol, ul, blockquote, table etc.). The other textformatter allows you to implement jQueryUI tabs within your help page, using a simple shortcode/token format. The styling for the jQueryTabs widget matches that of the standard processwire admin theme tabs, so that users will feel familiar with the interface. Instructions: 1) Install the ProcessDocumentation module. It will also install the 2 textformatters. You don't need to apply those textformatters to any field, they are just used internally by the module and called in the correct order to make them work. 2) Select the field to use for the content display (e.g. body). 3) Create your content. If you want to use tabs, this is the syntax: {tab=My First Tab} Some content {tab=My 2nd Tab} Some more content {/tabs} Make sure to close the tabs or the page will break... you need 2 or more tabs for it to work. You can only currently have 1 set of tabs per page. You should be able to safely use lists and tables. 4) Create the process page under the admin. Select ProcessDocumentation as the process and then select the page to show from the tree. 5) Now you should have the menu item in your menu if you are using Reno it will be on the left, and under a parent if you setup a parent in the tree. Clicking on that will render the help page. This example uses 7 tabs. If you are superuser, you will see the edit process settings. Other users will see the edit content only, which allows them to edit the content of the help doc, make corrections or additions. If you need to prevent access to any documentation pages by any role, you just add the name of the process page to the permissions and then don't check it for that role. The module has a defined permissionMethod that checks to see if that permission is defined, and then if the user has it. Not defining individual help page permissions means they are visible to anyone with the documentation permission. There is more work to be done on CSS, and other small details.
    5 points
  2. Welcome to the forums and to processwire @Eljeff! Currently, processwire does not have ready made templates to drop in, or a marketplace for such things. However, when you install a fresh copy of processwire, you get several site profiles to use, and there is a bootstrap profile out there. One of my favorite things of processwire, is that is is very simple to get a basic site up and running. With just a few if/foreach loops and echo's, you can get a simple site going very quickly. This makes it super easy to integrate your own framework/css into the mix. @flydev has shared these videos which will help out in the start of your templating:
    5 points
  3. I was able to build a decent widget based dashboard using only this module and some hanna codes; And using @Robin S's hanna code dialog, i was able to build a widget based dashboard in a few minutes, with text and buttons. these are all based off the dashboard redux module markup and styling; the outer container hanna code loads the styles needed, so no need to actually add those to the module css files. 1) the CK editor view of the dashboard (page that is rendered): 2) the resulting page: also, i added the ability to disable the default CSS file from loading, allowing users to make their own styling for the dashboard pages; this way you can load whatever font you want, and style it to match your goal design for the doc pages. Here is what the unstyled page would look like, (and using the built-in, native jQuery UI tabs): Here is the styled version, loading default CSS (currently optimized for Reno Theme): Here is the latest module config screen:
    4 points
  4. 1) the purpose of using the process module is so that you can have single pages for the documentation articles, that are navigable from the primary admin nav and bookmarkable so you can send users a link to the article; There isn't any plan for template contextual help because that is already covered by Admin Help module. Also using the jquery tabs is completely optional; In its simplest use case, you'd just render some text there on that page for your users to read and refer to; maybe some global instructions for things they get confused about, an embedded video, or links to some tutorials on ck editor, or even some instructions about how modules work, or SEO consideration... 2) In the scenario where let's say you do want to render some very complex help page, say with tabs, accordions, or some complex charts that need custom javascript, and you don't want to use the built in tabs shortcodes, and you don't want to use hanna codes; you'd like to be able to display the output of a template file field that generates the markup for your help page, because you are doing your tabs in a repeater, and you also have a table that you are generating with a table field etc.; I believe that you would not need RuntimeMarkup for this; the module would simply need a switch between rendering a single field (default behavior), vs. using the template class to render the page using that custom template; so in that case you'd only need to have a field to input the path to the custom template file for rendering the help page, if i understand correctly; Said template file would be able to self-control its own dependencies for styles and script so you'd also disable the default style from loading; As far as i can predict, this should be a fairly simple addition to the module and shouldn't have any negative effect on the typical/simple use case;
    3 points
  5. Find gives you multiple pages (actually a PageArray with zero or more pages) , and respects page status, whether it's hidden and access settings, while get gives you the page (a Page/NullPage object) disregarding access preferences. To find pages created by a particular user, you need $myUser = $users->get('admin'); $myPages = $pages->find("created_users_id=$myUser");
    3 points
  6. Done, please check v1.6.8 on GH.
    3 points
  7. Today I got the email: "CSS Grid is included in Edge 16 that was released today as part of the Windows 10 Fall Creators update."
    3 points
  8. We are putting PW through its paces on one of our projects. Currently we have 3.5 million pages and counting. Everything has been scaling well and is running great, except for some of our selectors that use subfields. Our project involves physical units (represented by PW pages) that transmit their status to our application each day, resulting in a new page for each transmission. We are using a page field on the unit to store a reference to its latest transmission. We then need to filter the units by their last transmission date, so we are using the following selector: $pages->find('template=unit, last_transmission.date_field<-1 day, last_transmission.date_field>=-7 day, sort=created, limit=10'); Once we had several thousand unit pages in the system, this selector began to fail. After doing some debugging to see what SQL PW was actually producing, we discovered that the problem was that the selector was generating three separate sql queries. One returned the ids of all of the units that had a last_transmission date greater than a given timestamp, one returned the ids of all the units that had a date less than a given timestamp, and the last took the results of the other two queries and applied any remaining selectors. Since there were several thousand units, the first two queries caused a memory error. We resolved this issue by using the created date instead of a custom date field on the last transmission, so the selector changed to: $pages->find('template=unit, last_transmission.created<-1 day, last_transmission.created>=-7 day, sort=created, limit=10'); For some reason PW was able to combine this into a single SQL query, whereas it was unable to do so with the custom field. Not sure if this is the intended behavior or not, but it looks like this is an area of PW core that might be improved upon. Has anyone else come across this issue and are there any other workarounds I might not be aware of?
    2 points
  9. More info from the Docs Get: http://processwire.com/api/ref/pages/get/ Find: http://processwire.com/api/ref/pages/find/
    2 points
  10. I'm trying to wrap my head around your page structure, is it something like this? Can you post a screenshot? $page | +--t3Cities_list +--t3Cities_list | +--tags_template | | | +--tag | +--tag | +--tags_template | +--tag +--tag I've cleanup your code, and what does $getCities do? Are you listing`t3Cities_list` pages and their tags (depending on checkboxes) <?php namespace ProcessWire; /** @var $page Page */ $getCities = $page->find("template=t3Cities_list"); ?> <?php foreach ($getCities as $city): ?> <?php foreach ($city->tags as $get): ?> <?php $getTags = $page->get("template=tags_template, include=hidden")->children("sort=title, tag_code={$get->title}"); ?> <div class="grid-masonry"> <div class="grid-sizer"> <?php foreach ($getTags as $tag): ?> <div class="grid-item"> <a href="<?= $tag->url ?>" class="img-hovered"> <div class="overlay"><span><?= $tag->title ?></span></div> <img src="<?= $tag->categorythumb->url . $tag->categoryThumb ?>" alt="" class="img-responsive"> </a> </div> <?php endforeach; ?> </div> </div> <?php endforeach; ?> <?php endforeach; ?>
    2 points
  11. You need to add the field to the template which was used to create the case study page. On the page edit, can see settings tab. That will show you which template is being used. Details/input/actions are for specific settings on a field. The code will go in the template file i.e. /site/templates/basic-page.php or wherever your head section is rendered from. Maybe '_main.php'? It depends on your approach to organzing your templates.
    2 points
  12. I'm thinking you dont actually get $product using $pages->get('id=' . $product). Do you have Tracy Debugger installed? What does var_dump($product) give you, before and after you override it? <?php foreach($order->order_products as $product): ?> <?php $product = $pages->get("id=" . $product); ?> <tr> <td><?php echo $product->title; ?>test</td> </tr> <?php endforeach; ?>
    2 points
  13. Thanks, for this project I'm pretty committed to my custom access module at this point, and it's working well. I did install that module just now to have a look. It isn't compatible with PW3 out of the box (needs fixes here and here), it caused the Pages tab to disappear for non-superusers, and the absence of even a module readme makes it difficult to get to grips with. Not sure of the advantages over Page Edit Per Role. Apparently you can allow non-superusers to administer the user groups, although without documentation it wasn't clear to me how to allow that. Interesting though.
    2 points
  14. Yes, it can totally serve as a makeshift dashboard; if you are able to make the markup how you need it within CK editor, then it would work but wouldn't be able to replace the page tree as the landing because usually like in the dashboard module there is code in place to handle that; but as a sub-page dashboard it would work. (alternately maybe you could use a hook in ready.php to set the page as the admin landing page, instead of page tree.. If you need custom PHP, you can just use Hanna Code Textformatter and your options are pretty unlimited; for example you could build a super simple dashboard with some buttons or information using those hanna codes to output the required markup for your dashboard; for simple sites this could be preferable to trying to build a custom dashboard from scratch; the dashboard redux module i use has around 13 fields, a few templates and a lot of page references, as well as requires icon picker, color picker; you could achieve almost the same type of dashboard layout by using some nested hanna codes...
    2 points
  15. I think there will be a bit more to it than this, because there are quite a few places in FieldtypeInteger and InputfieldInteger where the value is cast with (int), which will truncate the value of high integers depending on platform. https://stackoverflow.com/questions/670662/whats-the-maximum-size-for-an-int-in-php/2842548#2842548 This one works well.
    2 points
  16. Just needed a few days ago: $pages->find("children.children.id=1028")
    2 points
  17. Like a few others in this forum I have to use a shared server on GoDaddy to host a client's website. It took me about three hours to track down the problem that threw a 500 error after I installed PW 3.0.78. It was a clearly a database connection problem. I checked and rechecked my credentials; they were good. I tried everything Ryan suggested in the .htaccess file. Nothing worked. Finally I went back to the GoDaddy control panel, to Hosting Details > Manage Databases and clicked on the name of the database to bring up the Database Details screen. At the bottom it shows Hostname. This is not what I named the database, but it's what goes into the site/config file to allow the connection. It's a very long string. I hope this helps other people to connect if they have to use GoDaddy.
    2 points
  18. MODULE PREVIEW This is a new module I'm working on, Settings Train. Ever needed to setup one or more pages for site settings, need a lot of fields/settings and an easy way to access them in the front end. This module may be of use to you. You can of course either make an editor page using standard fields for settings, but the goal of this module is to allow files within the template folder to define their own 'dependencies' for settings. Description: this module allows you to create an unlimited number of admin/process pages, and on any process page you can enter the path to a json file that defines the fields to use for the process page. 1.) Contents of kitchen-sink.json [ { "name":"text1", "label":"Text Field 1", "type":"InputfieldText", "width":"100", "description":"", "collapsed":0, "placeholder":"", "value":"", "columnWidth":50 }, { "name":"text2", "label":"Text Field 2", "type":"InputfieldText", "width":"100", "description":"", "collapsed":2, "placeholder":"", "value":"", "columnWidth":50 }, { "name":"select1", "label":"Select Test", "type":"InputfieldSelect", "width":"100", "description":"Description of select 1", "options": { "default":"Default", "blue":"Blue", "red":"Red", "yellow":"Yellow", "dark":"Dark" }, "collapsed":0, "placeholder":"", "value":"", "columnWidth":33 }, { "name":"checkbox1", "label":"Checkbox Test", "type":"InputfieldCheckbox", "width":"50", "description":"Checkbox 1 description", "collapsed":0, "placeholder":"", "value":1, "columnWidth":34 }, { "name":"radios1", "label":"Radios Test", "type":"InputfieldRadios", "width":"50", "description":"", "options":{ "black":"Black", "white":"White" }, "collapsed":0, "placeholder":"", "value":"black", "columnWidth":33 }, { "name":"checkboxes1", "label":"Checkboxes Test 1", "type":"InputfieldCheckboxes", "width":"50", "description":"Checkboxes 1 Description", "options":{ "address":"Address", "phone":"Phone", "social":"Social Icons", "top_menu":"Top Menu" }, "collapsed":0, "placeholder":"", "value":"", "columnWidth":50 }, { "name":"checboxes2", "label":"Checkboxes Test 1", "type":"InputfieldCheckboxes", "width":"50", "description":"Checkboxes 2 Description", "options":{ "address":"Address", "phone":"Phone", "social":"Social Icons", "top_menu":"Top Menu" }, "collapsed":0, "placeholder":"", "value":"", "columnWidth":50 }, { "name":"textarea1", "label":"Textarea Test", "type":"InputfieldTextarea", "width":"100", "description":"Textarea 1 Description", "collapsed":2, "value":"" }, { "name":"pagelistselect1", "label":"Page List Select Test", "type":"InputfieldPageListSelect", "width":"100", "description":"Page List Select Test Description", "collapsed":0, "value":"0", "columnWidth":50 }, { "name":"asm_select1", "label":"ASM Select Test", "type":"InputfieldAsmSelect", "width":"100", "description":"ASM Select (templates) - select a template.", "options":{ "43":"Image", "59":"Options", "61":"Post (post)", "62":"Post Index (post-index)" }, "collapsed":0, "value":"", "columnWidth":50 }, { "name":"url_test", "label":"URL Test", "type":"InputfieldURL", "width":"100", "description":"Enter a URL", "noRelative":1, "collapsed":0, "value":"", "columnWidth":33 }, { "name":"integer_test", "label":"Integer Test", "type":"InputfieldInteger", "width":"100", "description":"Enter an Integer", "collapsed":0, "value":"", "columnWidth":34 }, { "name":"email_test", "label":"Email Test", "type":"InputfieldEmail", "width":"100", "description":"Enter an Email Address", "collapsed":0, "value":"", "columnWidth":33 }, { "name":"ckeditor_test", "label":"CK Editor Test", "type":"InputfieldCKEditor", "width":"100", "description":"Some Formatted Text", "collapsed":0, "value":"" } ] The json file can be anywhere (currently limited to the templates folder). For example, if you have a theme folder and that theme requires specific preferences to be set for that theme, you can have the settings page load the fields needed by that theme. Process Page in Menu: Process Page (editing the settings): Then you can access those settings in your front end like this: $train = $modules->get("SettingsTrain"); $themeSettings = $train->getSettings('news-settings'); the settings are delivered as a WireArray: so you can now do this: echo $newSettings->url_test; which outputs http://processwire.com For rapid site development, this can save you from having to manually setup fields for new projects settings, especially if you use those same settings a lot.
    1 point
  19. I just made a textformatter module that allows you to insert dummy content (lorem ipsum style) in text fields via shortcodes. Usage is simple - just type for example [dc3] into a textarea with this textformatter applied (plain textarea or CKEditor) and it will be replaced at runtime by 3 paragraphs of dummy content. It can also be used to populate text fields (for headings etc) using e.g. [dc4w]. This will produce 4 words (rather than paragraphs) at runtime. The actual content comes from an included 'dummytext.txt' file containing 50 paragraphs of 'Lorem ipsum' from lipsum.com. The 50 paragraphs is arbitrary - it could be 10 or 100 or anything in between, and the contents of that file can be changed for your own filler text if you wish. The slightly clever bit is that for any given page, the same content will be returned for the same tag, but the more paragraphs available in 'dummytext.txt', the less likely it is that two pages will get the same content (very roughly speaking - it's actually based on the page ID) so content selection is determinate rather than random, even though only the tags are saved to the db. Update Tags now work like this - [dc3] - Show 3 paragraphs ([dc:3], [dc3p] & [dc:3p] all do the same). [dc3-6] - Show 3 to 6 paragraphs randomly per page load ([dc:3-6], [dc3-6p] & [dc:3-6p] all do the same). [dc3w] - Show 3 words ([dc:3w] does the same). [dc3-6w] - Show 3 to 6 words randomly per page load ([dc:3-6w] does the same). <End update on tags.> If you think it might be useful, you can download it from GitHub and give it a try.
    1 point
  20. Hi @abmcr Try: foreach($page->images->shuffle() as $image) { echo "<img src='$image->url'>"; }
    1 point
  21. That leaves us with only IE11 supporting CSS grids only half-baked... Sadly, we still have to support it for client projects.
    1 point
  22. How results are sorted if you don't specify a "sort" in your selector In $page->children() and $page->siblings() the results are automatically sorted by the page's default sort field that you specify in the admin. If not specified in the admin, the pages will be sorted by the order they are placed in the admin. This behavior can be overridden by specifying your own "sort=[property]". With $pages->find() and $page->find(), if you don't specify your own "sort=[property]", the results are sorted according to MySQL's text searching relevance. If no text searches are performed in your find(), the results are unsorted. As a result, it is generally a good idea to include a "sort=[property]" when using $pages->find(), especially if you care about the order and your find() operation is not text/relevance related.
    1 point
  23. From the documentation you linked to: https://processwire.com/api/selectors/#sort
    1 point
  24. Thanks I wiil read the tutos tommorow and that wiil clarify the whole thing.
    1 point
  25. Just to clarify, what I said was not intended as an insult, far from it. I meant with some more learning, you'll be able to do this stuff no problems. I come from the othet direction in that wordpress makes no sense to me but a 'proper' CMS does. I mean proper by one with custom fields, templates etc... out the box. Like I said, posting the code you have that renders your head section (or the entire template) would be extremely useful here.
    1 point
  26. @Marudor Hi, I recommend reading a few tutos, like: https://webdesign.tutsplus.com/tutorials/how-to-develop-a-processwire-theme--cms-25692 http://processwire.com/docs/tutorials/how-to-structure-your-template-files/ http://processwire.com/docs/tutorials/default-site-profile/ It should work but it will not affect the frontend of the site because in ProcessWire nothing is outputted without writing some code in the template files. There is no "theme" in the WordPress sense. You need to start taking a look at the template file(s) rendering the page(s) to get started. The developer who implemented the forntend could have chosen all sorts of ways to do it, but if you can provide some code samples we can help by pointing you in the right direction. As you can also see in the tutorials linked above, you need to look for something like (but not the same...): <title><?php echo $page->title; ?></title> And there must be some concatenation used too which adds "Agencja PR Q&A Communications – Poznań, Gdańsk, Warszawa, Bristol" to the string. You can do it this way: <title><?php echo $page->my_field_goes_here; ?></title> where my_field_goes_here is the name of the field you need to add to the template(s) of the page(s). That is where Markup SEO can help you but I never used that module. However, the site might use a template engine like Twig or something similar, so you might not see regular PHP echos being used and that is why you need to find out what renders what in the fist place.
    1 point
  27. I'm looking forward to your newest module. It would benefit my internal/external work tremendously. I hope you don't change the focus of what you are creating.
    1 point
  28. Hmm. I thought you had a <select> that visitors used to filter pages by templates. For pages, $pages->find('id>0')->sort(['template.label', 'template.name']) this one sorts by label, and sorts unlabelled templates by name, but unlabelled templates come after the labelled ones.
    1 point
  29. @matjazpThank you! I've also issued a couple of very minor pull requests on top of this new feature. Nevermind, I see you already pulled them. Thanks again!
    1 point
  30. Does the customer have view permission for template: shop-order? If not, try to add check_access=0 to your selector string. // Get the orders $orders = wire('pages')->find("template=shop-order, order_user_id=$customer, sort=-datetime, limit=10, check_access=0, include=all");
    1 point
  31. foreach($page->template->roles as $role) { echo "$role->name<br>"; }
    1 point
  32. You can use the pipe character too. I use this: <meta name="description" content="<?php if ($page->metaDescription) {echo $page->metaDescription;} ?>"> <title><?= $page->get("windowTitle|headingSubtitle"); ?></title> I use field 'windowTitle' to specifically change the main title for each page individually for SEO purposes. If not present or present but blank, use 'headingSubtitle' field.
    1 point
  33. Any chance this is helpful: https://processwire.com/talk/topic/5658-alpha-release-usergroups-page-based-permissions/
    1 point
  34. Thanks for the explanation! I still haven't find the time to go about implementing a dashboard and generally speaking I'm looking for a "versatile" way of doing it right off the bat that is why your module made me think: why not kill two birds with one stone? Bernhard is right saying that I "just need a process module" but why not build upon an already working solution if possible?
    1 point
  35. @heldercervantes that site is INSANE! Not my style at all, but just, wow! Well done. WebGL totally crapped the bed though on the contact page, page flashed a few times, flickered, got a chrome error bar at the top, webgl has crashed. Worked after a refresh though and I had a good look around. Very impressive. My PC is a few years old, i5-4670k with an nvidia GTX750. My internet is pretty quick (has to be with the stepsons online gaming/chatting/video watching when I'm trying to make websites!).
    1 point
  36. Awesome job!. Seems this could become very handy when making projects for clients.
    1 point
  37. ...which I just merged/committed (whatever the proper term is). Going forward, I'm going to look at making this thing configurable, if only to allow a choice of dummy text file, mainly so I can switch to pommy ipsum when required.
    1 point
  38. Why not store them under admin? It will be out of your sight and users without superuser permission will not be able to see the pages under admin. Thats how PW stores repeater items, too.
    1 point
  39. i think you need to do some more debugging! i just played around with a local test-setup and got this results with 10.000 pages: creation of pages: //foreach($pages->find('parent=8181') as $p) $pages->delete($p); $i=0; $tmp = range('A', 'Z'); while($i<10000) { $p = new Page(); $p->template = 'filtertest'; $p->parent = 8181; $p->title = "test$i"; $p->a = $tmp[array_rand($tmp)]; $p->b = $tmp[array_rand($tmp)]; $p->c = $tmp[array_rand($tmp)]; $p->save(); $i++; } dump (results): d($pages->find('template=filtertest, a=a, b=b')->each('title')); array (13) 14.48ms, 0.09 MB d($pages->find('template=filtertest, a|b|c=a|b|c')->each('title')); array (3084) 1110.54ms, 6.54 MB d($pages->find('template=filtertest, a|b|c%=a|b|c')->each('title')); array (3084) 1339.68ms, 6.54 MB your filter function looks totally weird to me. you have ID values as filter but then you use the slow %= selector. why? see my first example using " = " as selector should give you an instant result! also i don't understand why you are using the OR operator ( | ) for searching different fields. is the information spread over multiple fields?? shouldn't every filter-value be stored in a separate field? PS: my template "filtertest" has fields A, B and C holding letters from A-Z PPS: are you sure the selector is slowing the site down? maybe it is the way you count your number of results in the filter sidebar?
    1 point
  40. Really cool . I can see myself using this a lot. One simple request, can you add support for using regular PHP files for configuration? https://github.com/mrkrstphr/array-config Manually typing JSON for building inputs array would get tedious really quick. I'd rather use a PHP file because: I can add logic to my configuration files (and even include other files). This eliminates having to write some parts over and over. I can just write a function to create a text field and use that. I can use my IDE and its tools, autocomplete, intellisense etc
    1 point
  41. A couple more options for searching the PW website more easily: 1) New search feature in the ProcessWire Info panel in TracyDebugger https://processwire.com/talk/topic/12208-tracy-debugger/?do=findComment&comment=153342 2) Custom search for Alfred (customizable Spotlight type app for Mac) Simply type "pw" and then your search term: These are the settings to configure Alfred to do this search: https://www.google.com/search?q=site%3Aprocesswire.com%2F {query} You might also want to consider adding the following: pwapi : https://www.google.com/search?q=site%3Aprocesswire.com%2Fapi%2Fref%2F {query} pwblog : https://www.google.com/search?q=site%3Aprocesswire.com%2Fblog%2F {query} pwtalk : https://www.google.com/search?q=site%3Aprocesswire.com%2Ftalk%2F {query}
    1 point
  42. There's native `Fieldset in Tab` for creating editor tabs, but sometimes it could make more sense to put a field that's not directly related to `Content` into `Settings` or `Children` tab (such as for body class or some toggles that I see being used often). You can use the hook below to move fields between the tabs. // site/ready.php wire()->addHookAfter('ProcessPageEdit::buildForm', function (HookEvent $e) { // make sure we're editing a page and not a user if ($e->process != 'ProcessPageEdit') return; // RESTRICT BY TEMPLATE // $page = $e->object->getPage(); // if ($page->template != 'home') return; // RESTRICT BY ROLE // $user = $e->user; // if (!$user->hasRole('editor')) return; $form = $e->return; $contentTab = $form->children->get('id=ProcessPageEditContent'); $settingsTab = $form->children->get('id=ProcessPageEditSettings'); // $childrenTab = $form->children->get('id=ProcessPageEditChildren'); // if page template is set noSettings = true, $settings will not exist if (!$settingsTab) return; // MOVE TITLE FIELD TO SETTINGS TAB $title = $contentTab->get('title'); if (!$title) return; $contentTab->remove('title'); $settingsTab->prepend($title); });
    1 point
  43. I think this could be said of any CMS really. I have found though that the barrier to entry with PW is low, and the learning curve is steady. It's not like you get to a point then get totally stuck like I've experienced in the past. I've found knowledge of one thing leads nicely to the next. This is what keeps me interested just keep dangling that carrot.
    1 point
  44. Note: 100% Honesty no Bias I would say it takes much more to develop in WordPress than in Processwire, I will backup my claim with code examples and also various scenarios, before I came into Processwire, I was developing WordPress and really with minimal code , you can do alot in Processwire. Let's look at this now Scenario 1 Fetch Images for a specific Post This is how to do this in WordPress $thumb_ID = get_post_thumbnail_id( $post->ID ); if ( $images = get_posts(array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'numberposts' => -1, 'orderby' => 'title', 'order' => 'ASC', 'post_mime_type' => 'image', 'exclude' => $thumb_ID, ))) { foreach( $images as $image ) { and this is the equivalent in Processwire foreach($page->images as $image){ } You see the concept in Processwire is that everything is a page, so when you are in a Page, you get the neccessary information required for that page, However WordPress has a "Post Concept" and images are tied to the Media Library which is why you have to supply a post to fetch images. Scenario 2 List all Pages on the Site Now imagine you are looking to create a list of all your pages, this is what you will do in WordPress <?php /*pass your search string here example like this ( 's'=>'test' ) */ $args=array('s'=>'test','order'=> 'DESC', 'posts_per_page'=>get_option('posts_per_page')); $query=new WP_Query($args); if( $query->have_posts()): while( $query->have_posts()): $query->the_post(); { echo $post->post_title; echo $post->post_content; } endwhile; else: endif; ?> Now this is the same result in Processwire $pagesList= $pages->get("/"); foreach($pagesList as $page){ } Minimal PHP Knowledge and beautiful design, I can guarantee you within a week's practice you will be able to deliver something quicker, however some tasks might require additional time, but Processwire has been carefully designed to appeal to people, at a point I wasn't happy when it wasn't adopting Advanced concepts (FIG,PSR) but as I evolved i realized there's more to coding and that user adoption is important. Now let's forget the code let's look at Content management Now you want to create Website and let's assume in your case, it's a website about selling Boats (sorry that's what to mind), Out of the box for WordPress, unless you are creating a custom type, you can't fit that logic into WordPress as it's built around Posts and taxonomy, so you have to create a custom type and this involves codes, or install a plugin, whereas in Processwire you simply create a Page which holds Boat informations and create fields to accept relevant information. This is much more intuitive than WordPress, because in WordPress you might have to add it as a custom field which obviously involves coding again, or as usual checking to see if such a plugin exists, or the last option is to pray that someone builds a theme that involves selling of boats. Now this is the custom field in WordPress, however by default most of the custom fields in WordPress are Text input, during my previous experience creating a custom field other than text involves coding and obviously you know what comes next; installing a plugin again for another need. WordPress takes a lot of time, money and also very nerve wrecking, updating WordPress or the plugin is like russian roulette to me, I have to backup, and pray for the best, It's moments like this that I become very religious. And if something breaks I either have to fix the issue or revert, and sometimes the reason you are updating is because of security issues, so it's either breaking the site or getting hacked. Which means additional money for consultancy and it gets messier from there. I've been there and done that and I simply decided to migrate to another platform as WP wasn't worth my sanity. Processwire is good and the modules built are easy to use and configure, my favourite is the DatabaseBackUp without thinking too much you can easily understand your way around. In conclusion Processwire is good and easy to grasp, it might not be perfect and that's a good thing because it means there's room for improvement, and we are even lucky to have you around, as you can share how we can make Processwire more user centric and easy to use and also features can be created in modules to make PW a more robust system. I will link @Joss article TLDR: Processwire is easy to learn.
    1 point
  45. I am sure it will! The challenge will be if someone asks you to work on a project with something else
    1 point
  46. @svsmailus you don't particularly need deep working knowledge of PHP. The API is really simple to use. I came into this with almost zero knowledge of PHP (but a basic knowledge of general programming principles), a year later and I'm doing some really cool things. Not as cool as some of the guys here but this isn't a competition, they are very generous here with sharing the knowledge. In my opinion, if you want to progress in any CMS, this forum is the place to be. Processwire has allowed me to do things in the one year that took me much longer to achieve with the convoluted and plugin dependant ways of other CMS systems, including Drupal 7 & Wordpress. My templates output exactly the HTML I want and no more and querying the database is so simple. This in turn has saved me a bunch of time with the CSS as I don't have to style out classes chosen by the plugin developers thus being able to reuse code a lot easier across multiple sites. In regards to hosting, after changing a few times over the years, I use 'Kualo' now. They have been absolutely outstanding for support and the live chat is great. If you're anything like me, that is, very curious, like to ask a lot of questions and are keen to learn, then there's nothing stopping you! I am also working on a blog with a bunch of basic tutorials for people right at the beginning like yourself, hoping to go live within a couple of weeks (once I have some more content). Good luck ==EDIT== p.s. welcome to the forum!
    1 point
  47. Starting with the modules or plugins, despite being productive initially, causes more issues in the long run. This is also, I think, the major disadvantage of WordPress. Majority of the backend is inaccessible to beginners, and the core is obnoxiously complicated. How can showing some posts be so difficult (you know, "the loop"). This forces you to use plugins over plugins and the only thing you learn in the process is how to prevent them from spontaneously disintegrate. I agree with what @Peter Knight said. Even though there are modules for most scenarios, I enjoy recreating those modules by hand, because I get to practice coding and explore new/better/faster approaches, and I also get familiar with the inner workings of ProcessWire. Maybe in the future I'll get bored of building things from scratch but then I'll have built an array of modules, templates, snippets, and will know exactly when to use which.
    1 point
  48. I wouldn't start by installing a Module such as Blog etc. I believe for you, a better approach would be to gradually build your own from scratch. You'll learn a lot more that way. Start with a few individual pages based on a template called "blog-post" and add a few basic fields. Just title, summary and body would be fine. Once you can make and view them then try to create a blog overview or homepage displaying the title and summary of each and a link to each full post. Lets say that template is called blog-posts (plural) You'll get a real kick out of just being able to do that and you're just echoing simple tags and getting to know "foreach" statements. Then try to add a date field to each blog post and add that to both templates. Later you can try adding a main image, maybe even an author and then move onto tags and categories. I think you'll get much more enjoyment out of building your own and a better understanding of the fundamentals.
    1 point
  49. I would argue that as @louisstephens pointed out, much of the php you need is simple echo'ing and foreach'ing and a willingness to learn. As for the problem with the blog, perhaps we should get the blog module author @kongondo in on the discussion to see if he can get you up and running.
    1 point
  50. Happy New Year to everyone! For a project that I'm working on, I needed to have dependent checkboxes on page edit forms in the admin. Just like dependent selects but for checkboxes. I couln't find anything and decided to write my first Inputfield module. I have only tried it on PW > 3.0. But it should also work on the 2.x branch. Would be great if some of you could try it out and give some feedback. You can find the module InputfieldDependentCheckboxes at github Here's some screenshots of the module in action and instructions on how to use it. ##An Inputfield for ProcessWire admin interface that handles the display of dependent checkboxes in page fields Sometimes we need checkboxes to depend on other checkboxes in our page edit forms. This module adds this functionality to standard page field checkboxes for 2 or more checkbox fields. ## Installation 1. Copy all of the files for this module into /site/modules/InputfieldDependentCheckboxes/ 2. In your admin, go to the Modules screen and click "Refresh". Under the 'Inputfield' section, install the 'InputfieldDependentCheckboxes' module. 3. Open Modules->Configure->InputfieldPage. Under 'Inputfield modules available for page selection' add 'DependentCheckboxes' from the select dropdown and submit ##Field Setup This inputfield extends the standard checkboxes for page fields. Therefore you need to have page fields configured already that you can extend with this Inputfield type. ###Prerequisites You need to have at least 2 fields of type page that have 'Checkboxes' defined as Input field type and live on the same template. A real world example: There are different types of instructors. Each instructor type can have multiple different certifications. For this to happen, we need 2 page fields (multiple): A) instructor_types: lists pages with template 'instructor_type' B) certifications: lists pages with template 'certification' The certification template needs to have the instructor_types page field to assign one or more instructor_types to a certification. ###Setup (link checkbox fields) 1. Edit your page field A and go to the 'Input' Tab. Under 'Input field type' choose 'DependentCheckboxes'. Hit save. Now under 'Choose the target checkboxes field' choose the name of your field B. Hit save again. 2. In your page field b make sure to choose a template under 'Input' Tab under 'Selectable Pages'->'Template of selectable page(s)'. Your fields should be setup. If you now edit a page that contains the 2 fields, the dependent checkboxes should be working. EDIT: And yes, this is working for multiple dependent checkboxes, too. (I have tried it with 3 so far) Some notes on how the module works behind the scenes: - parent checkboxes (actors) that have dependent checkboxes (targets) get custom data attributes applied which contain arrays of the targets' IDs - some Javascript is initiated on acxtors and targets to handle the display based on the id arrays in the data attributes. EDIT: since this module's mention in ProcessWire Weekly it might get some more attention. I just wanted to point out that it is still in alpha state. I will continue development and more thorough testing while implementing it in an ongoing project within the next 3-5 months or so. I will eventually release a stable version then. If you use the module with only 2 dependent checkbox fields, it should work smoothly. There are still some quirks when using 3 or more and I need to figure out how to best resolve them. So please be patient (or jump in with ideas ).
    1 point
×
×
  • Create New...