Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

9 Neutral

About SwimToWin

  • Rank
    Distinguished Member

Contact Methods

  • Website URL

Profile Information

  • Gender
    Not Telling
  • Location

Recent Profile Visitors

3,267 profile views
  1. I want to add a dependent SELECT field on my template page that lists pages from a parent "sub-page" in the current parent node. On /product1/page I have the field "photo" which is a SELECT field. I want the SELECT to list pages from /ROOTPARENT/photos. The idea is that I can reuse the same photo in many places - but only need to keep it update it once under /product1/photos. My page structure looks like so: /product1/page /product1/photos/photo3 (template=photos) /product2/photos/photo9 I have tried adding these Selector Strings on the Field (Setup -> Fields -> PHOTO -> Input tab -> Selectable Pages field group -> Selector String): parent=/product1/page, template=photos, sort=name WORKS (but only on children of current product). parent=page.rootParent ... parent=$page.rootParent ... parent=$page.rootParent parent=$parent ... parent=$parent1 When using a SELECT Input Field Type, the editing pages gives the fatal error "Unrecognized operator: $". parent=parent ... parent=. Returns an empty list How might I find child pages from the current "/product1/photos/ page"? Your inputs are appreciated. Thanks.
  2. Excellent suggestions. Thanks to all. @adrian, your solution works like a charm: Press New Set Title and Name (Template is currently unassigned) Press "Save" - Page now gets published with the chosen template, all template fields are blank. Setting pages to unpublished is still possible. This is how I want the flow.
  3. The basic Processwire workflow assumes that I (as an Editor) want to save new Pages in draft mode - and therefore new pages are always set to unpublished by default. To publish the page, it is necessary to actively press "Publish", otherwise the Page will not be visible. The workflow is: Add new Page Status is now "Unpublished: Not visible on site." Press Publish - the page is now visible on site I want to publish pages right away (without having to press Publish). Where is that configured? ProcessWire 3.0.123 Uikit v3 admin theme (0.3.0)
  4. @adrian I do have one question: Users are allowed to create sub-pages in their branch, is it possible to restrict the templates, users can select? For instance, a Contact Page is created by me - and the user shall not be able to create an additional Contact Page. Template Once Per Parent seems to do the trick?
  5. I have a website that allows users to create their personal "website" (a page with sub-pages). Users shall be able to: Log in (frontend and/or admin), Edit "their" page(s) - I am using the "Page Edit Per User"-module (https://modules.processwire.com/modules/page-edit-per-user/) to grant access to the relevant pages Create child pages - possible? Users shall not be able to see other pages in the admin interface - "Admin Restrict Page Tree" may do the trick (https://modules.processwire.com/modules/admin-restrict-page-tree/)? Frontend editing shall be possible - I am considering "Fredi" (https://modules.processwire.com/modules/fredi/) for this. The challenge is that it takes a lot of modules and configuration. Is there a way to set this up that doesn't require a lot of configuration for each new user?
  6. ProcessWire is setting a "wires" cookie for each guest session. Is it possible drop that cookies, so there are no cookies at all for guests? That way, I don't need to spam the user with a cookie consent box. I don't need cookies for user preferences and marketing purposes. (Why are cookies being set by default in the first place?)
  7. Hi, I am in the process of creating a local news site, based on ProcessWire. Among other things, the site will be presenting local events, and I have a question specifically about recurring events. Events (recurring or not) shall be shown in *one* list, like in this example: 10.01.2019 19:30 - Some event (Page #1235) 11.01.2019 17:15 - Another event (Page #1237) 12.01.2019 16:00 - The Final Event (Page #1239) When I have recurring events, I would like to keep these on the same page (using a Repeater field) as shown here: 10.01.2019 19:00 - A Star is Born film, showing in Cinema ABC (Page #1234 holds all occurrences) 10.01.2019 19:30 - Some event (Page #1235) 11.01.2019 19:30 - A Star is Born film, showing in Cinema ABC (Page #1234 holds all occurrences) 11.01.2019 17:15 - Another event (Page #1237) 12.01.2019 20:00 - A Star is Born film, showing in Cinema ABC (Page #1234 holds all occurrences) 12.01.2019 16:00 - The Final Event (Page #1239) The editing interface will use these fields: id title date_start - a datetime field (use for one-time events) time_start - a text field dates - Repeat field with these sub-fields: date_start - a datetime field (use for recurring events) time_start - a text field Listing events by date_start is simple when the site only has run-once events (using the 'date_start' field). But when repeated events enter the picture, it is necesssary to generate all occurrences for each repeated event ('dates.date_start') - and join these with the list of run-once events ('date_start'). I am unsure if that is possible? PS: I am aware that Ryan created an Events fieldtype module, unfortunately the site needs more detail about each event than this module offers so it is easier to create a site-specific set of Event fields.
  8. @adrian - Very nice module! I was requested to add password / passphrase protection of a Danish site, and this module came very handy. Background image added: html { background:url('/images/background.jpg') no-repeat center center; min-height: 100%; background-size: cover; } body { min-height: 100%; } Transparent background color added on top of the background photo (so the text remain readable): legend { background: #eee; opacity: 0.7; color: #333; font-weight: bold; font-size: larger; } If you have time to spare, then I have two minor enhancement requests: 1. The TITLE tag prepends "protected :: " before the site title. Better: Make the prepended string translateable (perhaps that's already possible somehow?). Or, add multi-language capabilities as suggested by Juergen (I would prefer a text string tough). 2. Login with a single passphrase field I only need one field (password / passphrase) - but the module require that I add two fields (username and password). Better: Allow the administrator to specify a passphrase ... if the passphrase is correct then a default username and password is activated. Here is how it may work: * Administrator creates a guest user. * Administrator creates a passphrase and links it to the guest user. * When end-user logs in with correct passphrase, then user is logged in as the guest user.
  9. Background info: I am using ProcessWire as the back-end to manage contents on multiple sites. I use ProcessWire as an editing system and database only. The ProcessWire templating system is not in use. I will describe the setup in a separate topic - it's cool! ;-)
  10. I am using ProcessWire as the back-end to manage contents on multiple sites (I call them "sub-domains"). I use ProcessWire as an editing system and database only. The ProcessWire templating system is not in use. I want to use ProcessWire's API and in particular the Include & Bootstrap method to output contents -- pretty much in the same way you do, if contents is stored in a MySQL database and output in PHP files that use PDO to load data. The issue is that I cannot get ProcessWire to fully work on each of the "sub-domains". https://processwire.com/api/include/ says: > You can do anything with ProcessWire's API that you can do from a template, > so all of this still applies, as does everything in the developer API. How can I get access to variables such as $input when using Include & Bootstrap? I tried these: $wire->pages->get("/foo/bar/"); echo "Segment1: " . $wire->input->urlSegment1; # Returns null $wire->pages->get("/foo/bar/"); echo "Segment1: " . $wire->input()->urlSegment1; # Internal Server Error $p = $wire->pages->get("/foo/bar/"); echo "Segment1: " . $p->input->urlSegment1; # Returns null $p = $wire->pages->get("/foo/bar/"); echo "Segment1: " . $p->input()->urlSegment1; # Returns null @ryan Can the API Variables documentation be updated with a section / an example that explain how to use "Include & Bootstrap" for each variable (since this is a really strong feature in ProcessWire)? $page $pages - Example: $homepage = $wire->pages->get("/"); $input $sanitizer $session $fields $user $log $templates $config
  11. It works. Thanks, much appreciated. I also have a few reflections on the workflow in ProcessWire: First of all - I am able to achieve the result. ProcessWire never lets me down.. However, getting there was a bit difficult due to a few things: (I say this in a positive spirit and as a constructive contribution to the ongoing development efforts) 1. It is unclear to me that the "Super User" role is in fact a "Web master" role. 1a. Recommendation to @ryan: Rename the "Super User" role to "Web master" to make it obvious that the super user is a co-administrator with permissions to work with a) contents and b) site structure. 1b. Recommendation: Create a default "editor" role with Permission to work with contents and users only. Adding an Editor should be as easy as adding a co-administrator. Why would I ever want to grant co-admin permissions to a customer? They can destroy the entire site structure by accident - in minutes). 2. I created a new "editor" role but granting Create and Edit permission is not possible on the "Edit Role" page. Why? "The page-add and page-create permissions can only be added from the template access settings and are shown here just for informational purposes." As a result, it is necessary to edit each of the relevant templates and specify role access (hard!). 2a. Edit Role page: Editor was allowed to "create pages" - but that is not enough to add pages in "sections" (/foo-section/new-page). Granting the "add children" access permission was also needed. 2b. Recommendation: Administration of each Role should be possible from the Edit Role page (/processwire/access/roles/edit/?id=1234&s=1&c=1). I hope these observations and enhancement requests make sense and will prove usable in future development effors. And again, thank you for your quick reply and guidance.
  12. In my world, Super Users / Editors should only be able to work with Pages and administer users. Everything else is the domain of the web master. The purpose is to prevent technically inexperienced editors from destroying core elements of a site, such as fields and templates. That leaves me with the question, how to deny Super Users access to Setup, Modules and Roles / Permissions? PS: May I also suggest that it shall be possible to set Permission for each of the main menu items - including their sub-menu items.
  13. Hi Robin S, FYI - There is a simple way to get support for array_chunk in WireArrays, it's described here: https://processwire.com/talk/topic/17324-array_chunk-support/ I am posting this in the hope that you and others will find it useful..
  14. While ProcessWire and WireArray does not have support for array_chunk, there is a simple way to achieve this. With array_chunk() you can easily add DIVs to a foreach loop, without having to set up counters when using general PHP (hat-tip to Laurance over at StackOverflow). The idea in a ProcessWire context is to use array_chunk() to split an array into chunks - and use eq() when looping page results. Simple example that will split a WireArray into three columns. Before we begin, you should know the array_chunk syntax: array_chunk($array, $chunk_size, $preserve_keys=true|false). <?php $p = $pages->get('/news')->children('limit=15, template=article, sort=-sort'); ?> <div class="row"> <?php foreach (array_chunk(range(0,14),5) as $chunk): ?> <div class="col"> <?php foreach ($chunk as $i): ?> <h5><a href="<?=$p->eq($i)->url?>"><?=$p->eq($i)->title?></a></h5> <?php endforeach; ?> </div> <?php endforeach; ?> </div> A more realistic example: <?php $p = $pages->get('/news'); $pp = $p->children('limit=15, template=article, sort=-sort'); ?> <h2><a href="<?=$p->url?>"><?=$p->title?></a></h2> <div class="row"> <?php foreach (array_chunk(range(0,14),5) as $chunk): ?> <div class="col"> <?php foreach ($chunk as $i): ?> <h5> <a href="<?=$pp->eq($i)->url?>"><?=$pp->eq($i)->title?></a> </h5> <?php endforeach; ?> </div> <?php endforeach; ?> </div>
  • Create New...