Recently Browsing 0 members
No registered users viewing this page.
I'm trying to build a bitwise filter for a database query for my textformatter module, and I stumbled over some page statuses I don't quite understand:
/** * Page has pending draft changes (name: "draft"). * #pw-internal * */ const statusDraft = 64; /** * Page has version data available (name: "versions"). * #pw-internal * */ const statusVersions = 128; If I'm not mistaked, there's no way to create multiple draft of a page in the ProcessWire core without module, is that correct? I initially assumed was the status assigned to unpublished pages, but the unpublished status corresponds to id 2048. Is the only way to create drafts with the ProDrafts module?
For my purposes, I just need to understand how I should treat those statuses. I'm trying to get all pages that are published and either hidden or not hidden (I want to make this configurable). Do I need to exclude pages that have the statusDraft, or statusVersions? Only one of them? Only in combination with other statuses? Or can I safely ignore those (so it's fine if the pages have the status or not)? I don't own the ProDrafts module, so I can't check the code to see how individual drafts are stored and how the draft ids correspond to the published id.
Any insight into those statuses is appreciated. Thanks in advance!
I have lots of blogposts in my pagetree and I want the pagelabel to include the value of the post’s datefield (only the year).
Adding date | title in the template settings results in something like…
1536012000 | my blogpost title
Is it possible to convert the timestamp to a readable date?
I am trying to get some extra css-file into my admin templates. I managed to modify my admin.php to this:
<?php namespace ProcessWire; require($config->paths->adminTemplates . 'controller.php'); echo "<link rel='stylesheet' type='text/css' href='" . $config->urls->templates . "css/admin.css'>"; By doing so, the css <link> is added to the very end of each parsed admin-html. (right AFTER the closing </body> tag.)
That causes some trouble. e.g. the page tree is not displaying any more. Although, other pages are working - like the edit form of a page.
My question: is there a correct way of adding my extra css to the admin area?
Thanks for you help!
I'm combining two PW sites into one, Site A into Site B.
At each step, I did it bit by bit as the 'all at once' approach failed.
First, I exported all the fields from Site A and imported into Site B. Any field types not supported by import/export, eg FieldtypeOptions I manually recreated. All good.
Next I exported all the templates from Site A and imported them into Site B and copied across their associated template files. All good.
Finally I exported the pages I needed from Site A into Site B - again, bit by bit to ensure it all went smoothly.
From the admin side, it all looked and worked perfectly.
Front end was a totally different story. All existing pages in Site B worked as expected. NONE of the pages imported from Site A displayed. They all ended in a redirect loop with no errors in the PW logs or Tracy Debugger.
After some trial-and-error, I finally got it working with:
- create a new template in Site B admin with no associated template file and just a title field
- import the fields from the imported Site A template into the newly created template (both on Site B)
- copy the Site A php template file into a new file that matched the new PW Site B template name and save in Site B site/templates
I can deal with the above workaround. Just curious to know if I did something wrong or if the template import/export feature is problematic?
While the export/import was a slow process, turned out the front end redirecting issue was unrelated. For reasons unknown, all templates marked as HTTPS only were the ones redirecting, ie all templates from Site A. Finally solved it by changing the $config->https to true in site/config.php
Now the pages display correctly as https whether the template forces the issue or not.