Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/13/2017 in all areas

  1. No problem @SamC. Instead of "today" you can also use strings like: "next monday" or "next year" or "+1 week 2 days 4 hours 2 seconds". See strtotime function.
    3 points
  2. Using it for website design, overriding styles all the time. I kind of have liked that you have must buzzword components right at hand, ready to integrate, so when a clients asks: oohhh those nice backgrounds that move around when you scroll, DONE, ohhhh I want all this animated like a disney movie, DONE and so on... I have found some things that I need to hack around but in a much less percentage than Bootstrap, at least in my experience. Though a fellow I am working with now has really spoiled me into noticing that writing your own CSS isn't that hard and just makes less work than reverse engineering a framework.
    3 points
  3. ProcessWire is mentioned in the repository Awesome UIkit:
    3 points
  4. PW does not pull any CSS or Js to your frontend unless you tell him so.
    2 points
  5. There are various pages in the admin, which do not have the "admin" template. These are generally not accessable as backend page per se, but really checking for the rootParent is the most future prove way of handling that even if updates to processwire would change something with the templates. The backend parent page will more likely stay with it's id of 2.
    2 points
  6. Thanks for the reply. I've been looking over how the PW UIKit implementation works, and as usual it's very logical. It's just a case of starting with the blank profile, linking to the UIKit CDN and then including the _uikit.php file to take advantage of the PW helper functions. Simple and to the point. As for the updates. I just suppose I'd prefer a changelogs page that lists all the changes between versions with easy ways to compare between versions and to link to the information you require. In my opinion, it would be great if PW had a page like this: https://www.sidefx.com/changelog/ It's a nice simple page, and you can alter it to fit your needs.
    2 points
  7. Hi, I have created a site profile that shows how to integrate ProcessWire 3.0 with Vue 2.0. See repository here. How this site profile works This ProcessWire site profile is loosely based on the REST API tutorial by @gebeer. Here are the most important steps to reproduce it: Admin settings Create an api template with default settings and just the title field assigned to it. Refer to @gebeer tutorial for further details Create a pages and nav templates with just the title field, for both template tick “Allow URL Segments” in the “URLs” tab (see attachment) Create a home template, this is going to be the single php file that will load your Vue SPA. Assign this template to the root of your website Any other template you create should have the “Alternate Template Filename” field in the “Files” tab set as home (see attachment), in this way if a user enter the website from any url that is not the root, ProcessWire will always redirect to the home template, Vue router will handle the url and call the right data through the REST API Under the root, create an api page and assign the api template to it (you can set “hidden” to this page so doesn't show up in the menu) Under the api page, create the pages nav and pages (see attachment), and assign the templates nav and pages to them. Now you have the www.sitename.com/api/pages and www.sitename.com/api/nav urls that you can use to fetch the JSON data PHP template setup In the templates folder, create home.php file and leave it empty, the HTML will be generated by webpack Now create pages.php and nav.php files. On these files is where we return the JSON data, based on the right url segment. Again, refer to @gebeer tutorial for further details on this matter. Note that I wrote a PageFields class that I use on these templates to fetch ProcessWire fields. The fields that are supported are text, textarea, repeater, img. Other fields may work but I haven't tested them. See the REST API setup for further details about how to use the PageFields class REST API setup You can decide what fields are included and what fields are excluded by passing a configuration array to the PageFields class. You can find here a list of the available configuration settings. See examples below. Show only selected core fields: $pageFields = new PageFields($p, [ 'fld_core_included' => ['url', 'httpUrl', 'template'] ]); Show no global fields, and only selected custom fields: $pageFields = new PageFields($p, [ 'fld_core_included' => [], 'fld_include_all' => false, 'fld_included' => ['title', 'gallery'], ]); On a gallery image field, hide breakpoint listing and show only httpUrl field: $pageFields = new PageFields($p, [ 'img_fld_overrides' => [ 'gallery' => [ 'fields' => ['httpUrl'], 'bp_list' => false ] ], ]); Webpack setup The most important file of all Webpack setup is config/index.js. On line 33 you need to provide your domain name so that Webpack can proxy the ProcessWire REST API to the Webpack dev server. Without this you wouldn't be able to take advandage of the Webpack hot module replacement feature which allows you to reload a vue module without refreshing the page, it also allows you to keep the state of the app. Notes My REST API may have bugs, this is just an example of an integration with ProcessWire, I suggest you either build your own REST API or use the awesome GraphQL module by @Nurguly Ashyrov. Todo Replace REST API with the GraphQL module. This requires vue-apollo, the Apollo/GraphQL integration with Vue, and vue-supply for integration with Vuex.
    1 point
  8. Unless I'm missing something, there's no dedicated place on the forum to report bugs regarding the website / forum etc? Is there any chance we could have a sub-forum for it? There have been a number of times I've seen the odd spelling mistake etc, but I've just ignored it because I didn't know who to alert. Here's the latest one I've stumbled across: http://processwire.com/api/ref/page/ Notice the missing spaces.
    1 point
  9. Hi @holmescreek Do you use this code on pages with "testimonials" template? If no, you should use $testimonials = $pages->get("/testimonials/)->testimonials_repeater->getRandom(4); foreach($testimonials as $ts) { //code }
    1 point
  10. If you do need to do it in init() which is before wire('page') is available, then you can do this: if(strpos($_SERVER['REQUEST_URI'], $this->wire('config')->urls->admin) === 0) {
    1 point
  11. https://processwire.com/api/multi-language-support/multi-language-urls/#api
    1 point
  12. $isAdmin = $this->page->rootParent->id == 2
    1 point
  13. Good to know, thank you R
    1 point
  14. Thanks @adrian giving me the hint of the possibility of configuring the parent page. I found I missed the "Where editing tools are available and separately configurable" > "Configurable pages" inside module configuration and then it may be configurable in the page setting tab after adding parent page.
    1 point
  15. @alan, besides BatchChildEditor another handy module for this purpose is ImportPagesCSV. You select a template and parent, then in "Paste in CSV data" you just paste in a list of page titles and put 'title' on the first row (to indicate it is a list of titles).
    1 point
  16. Hi everyone, Some critical updates this morning: 1) The module stopped doing anything in recent versions of PW 3 - I don't exactly when, but this is now fixed. 2) I also added support for restricting the new Pages > Tree dropdown menu that was added in 3.0.55 Please let me know if you find any problems with these changes or if you find any other situations where the module is no longer working. Given the rapid development of new ways to access the page tree that are being added to PW, I strongly recommend thoroughly testing your site if this module is protecting critical info from certain users. Hopefully everything is already taken care of for the current PW dev version, but with the UiKit admin theme, there could be possible breaks. Thanks for testing and letting me know!
    1 point
  17. I think there is some confusion because the word 'tree' has in the past sometimes been used to refer to the page list (ProcessPageList) but now labels the dropdown 'Tree' menus. To be clear, the intention behind my module is not about preventing roles from accessing the page list, it's about removing the dropdown menus which I consider to be a confusing UI for roles with limited editing access. There is a related GitHub issue open here: https://github.com/processwire/processwire-issues/issues/231
    1 point
  18. You get "1" because you try to "echo" your include file. The include() method, after successfully including the desired file, returns a TRUE value which, when echo'ed out, is 1.
    1 point
  19. Nice! Thanks for sharing @arjen.
    1 point
  20. @Karl_T - BCE doesn't use a named Lister because it works with the core Lister, not just ListerPro. That's part of why the Config tab isn't there, but I added the Default Columns to the BCE config settings (both default, and also per parent page), so you should define them there. Does that take care of your needs?
    1 point
  21. The PW Backend is basically a highly-specialized frontend to your data, so if you set your permissions correctly you can let whoever you want have access to it.
    1 point
  22. For reference here's a simple mutation field implementation <?php wire()->addHookAfter('ProcessGraphQL::getMutation', function ($event) { $query = $event->return; $query->addField('log', [ // define return object under type 'type' => new ObjectType([ 'name' => 'Log', 'fields' => [ 'result' => [ 'type' => new StringType() ] ] ]), // available arguments for the query 'args' => [ 'text' => new StringType() ], // what to do with the request 'resolve' => function ($value, $args) { // process given input // return object outline should be same as 'type' return [ 'result' => 'done. ' . $args['text'] ]; } ]); }); When you refresh GraphiQL console, you get your new field!
    1 point
  23. Done! The latest version now allows you to hook into getQuery & getMutation methods of the ProcessGraphQL class. Those hooks are solely there so you could modify the query and mutation operations. Here how it might look like in your template file. <?php namespace ProcessWire; use Youshido\GraphQL\Type\Scalar\StringType; $processGraphQL = $modules->get('ProcessGraphQL'); wire()->addHookAfter('ProcessGraphQL::getQuery', function ($event) { $query = $event->return; $query->addField('hello', [ 'type' => new StringType(), 'resolve' => function () { return 'world!'; } ]); }); echo $processGraphQL->executeGraphQL(); The above code will add a hello field into your GraphQL query that responds with the string "world!". You'll have to use the Youshido\GraphQL library that ProcessGraphQL module uses internally. The same thing could be done with the mutation operation via getMutation hook method.
    1 point
  24. I think most people do, but you don't have to. You can do this using includes. For instance, you could have a template file "master.php", and set this file as the "Alternate template filename" for all your templates. Then in the master file you use some logic to include the file that contains the code for each template. For instance, you could create some subfolders to divide up these included files and then tag templates (on the Advanced tab of Edit Template) with a single tag according to which subfolder their file is in. Your logic in master.php then could be something like this: $path = $page->template->name . '.php'; if($page->template->tags) $path = $page->template->tags . '/' . $path; include($path);
    1 point
  25. Ah ha! That makes sense from my end. At the time I was having problems, it was on a server that was using Cloudflare. I had disabled Cloudflare for other reasons (namely their CSS caching drives me bonkers) and that resolved my issues, but I had never made the connection between the two. Thanks for coming back and chiming in with your findings.
    1 point
  26. You could always turn those xml data into custom wire objects / a big wirearray. That way you could at least use the runtime selector engine of processwire. Not as powerful as selecting from the db, but still quite useful.
    1 point
  27. No, I did not know fredi until the past 10 minutes Of course I've heard about it but never tried. Mine (petname FEEL) is a very simple addition - only a JavaScript file (or snippet) and a link markup is needed. I was using a similar solutions in my previous projects and finally decided to make it public, that's all. The other answer is "because I had to check if it's possible" It is simple so it doesn't have many settings unlike modules like Fredi has (or will have). If it fits your (or your client's) needs, then use it, otherwise look for more advanced frontend editors.
    1 point
×
×
  • Create New...