Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/12/2019 in all areas

  1. Hello there! I wanted to share my new proect with you. It's a small online shop for a local wine dealer: https://www.weinmarkt21.de/ Beware, the site is in german language. I used PW 3, Bootstrap 4 and a very few modules for this site. For the whole shop system I used the Processwire shop module Padloper exclusively. Developing in Processwire was a breeze as always. However I had to put some work into the Padloper stuff to make it fit to the needs of my client. It's a vey good base to start with but you should bring a bit of developing experience with you.
    8 points
  2. I've created a small module which lets you define a timestamp after which a page should be accessible. In addition you can define a timestamp when the release should end and the page should not be accessable any more. ProcessWire-Module: http://modules.processwire.com/modules/page-access-releasetime/ Github: https://github.com/Sebiworld/PageAccessReleasetime Usage PageAccessReleasetime can be installed like every other module in ProcessWire. Check the following guide for detailed information: How-To Install or Uninstall Modules After that, you will find checkboxes for activating the releasetime-fields at the settings-tab of each page. You don't need to add the fields to your templates manually. Check e.g. the checkbox "Activate Releasetime from?" and fill in a date in the future. The page will not be accessable for your users until the given date is reached. If you have $config->pagefileSecure = true, the module will protect files of unreleased pages as well. How it works This module hooks into Page::viewable to prevent users to access unreleased pages: public function hookPageViewable($event) { $page = $event->object; $viewable = $event->return; if($viewable){ // If the page would be viewable, additionally check Releasetime and User-Permission $viewable = $this->canUserSee($page); } $event->return = $viewable; } To prevent access to the files of unreleased pages, we hook into Page::isPublic and ProcessPageView::sendFile. public function hookPageIsPublic($e) { $page = $e->object; if($e->return && $this->isReleaseTimeSet($page)) { $e->return = false; } } The site/assets/files/ directory of pages, which isPublic() returns false, will get a '-' as prefix. This indicates ProcessWire (with activated $config->pagefileSecure) to check the file's permissions via PHP before delivering it to the client. The check wether a not-public file should be accessable happens in ProcessPageView::sendFile. We throw an 404 Exception if the current user must not see the file. public function hookProcessPageViewSendFile($e) { $page = $e->arguments[0]; if(!$this->canUserSee($page)) { throw new Wire404Exception('File not found'); } } Additionally we hook into ProcessPageEdit::buildForm to add the PageAccessReleasetime fields to each page and move them to the settings tab. Limitations In the current version, releasetime-protected pages will appear in wire('pages')->find() queries. If you want to display a list of pages, where pages could be releasetime-protected, you should double-check with $page->viewable() wether the page can be accessed. $page->viewable() returns false, if the page is not released yet. If you have an idea how unreleased pages can be filtered out of ProcessWire selector queries, feel free to write an issue, comment or make a pull request!
    2 points
  3. 2 points
  4. From the documentation for "Name format for children": So if you want date format "U" you would enter that along with at least one non-alphanumeric character - e.g. "/U" or "U/". Do not enter "date()" anywhere in the format. ProcessSetupPageName is not the same as the core "Name format for children" feature and it has different format requirements.
    2 points
  5. Hello for all, don't know if this can help to someone, but here is solution for one strange problem (PW 3.096). 1) installation was multilanguage (EN and FR) 2) one langauge was deleted and all works without problems (as a "single-language" website) 3) but then, when my client try to add/create new user this happened: What was strange, at the bottom of that page was empty Language inputfieldset section ("required")??? I try again to install second language (idea was that maybe new uninstall would help), but it was not possible because "...there are Language..." (new red messages). After all, I found that in database are still old language tables and rows and after deleting the problem was solved. Here is the list of tables and records and what I done: 1) delete from table "fields" 3 rows where name: language_files_site, language_files and language 2) delete 3 tables: field_language, field_language_files and field_language_files_site 3) delete from table templates 1 row where name is language Or all that with this query inside phpMyAdmin: DELETE FROM `fields` WHERE `name` IN ('language_files_site','language_files','language'); DROP TABLE IF EXISTS field_language, field_language_files, field_language_files_site; DELETE FROM `templates` WHERE `name`='language'; Please be careful because this is very risky and before anything backup your database. Regards.
    1 point
  6. A module helping you to manage SEO related tasks like a boss! Automatically generates and maintains a XML sitemap from your pages. Includes a Fieldtype and Inputfield to manage sitemap settings and meta data for pages (Title, Description, Canonical URL, Opengraph, Twitter, Structured Data etc.) Multi language support for the sitemap and meta data. Configure default values for meta data on template level and let pages inherit or overwrite them individually. Map existing fields to meta data, reducing the need to duplicate content. Live preview for content editors how the entered meta data appears on Google. Live preview for content editors how the entered Opengraph data looks like when sharing a page with Facebook. Check out the README on GitHub for more details, including usage instructions. The module is currently released as beta and needs testing! Please report any issues on GitHub or in this forum thread, if you find time to give it a try ? Examples Here is an example of rendered meta data you will get from a single SeoMaestro field: <title>Sed dictum eros quis massa semper rutrum. | acme.com</title> <meta name="description" content="Si lobortis singularis genitus ibidem saluto. Dolore ad nunc, mos accumsan paratus duis suscipit luptatum facilisis macto uxor iaceo quadrum. Demoveo, appellatio elit neque ad commodo ea. Wisi, iaceo, tincidunt at commoveo rusticus et, ludus."> <meta name="keywords" content="Foo,Bar"> <link rel="canonical" href="https://acme.com/en/about/"> <meta property="og:title" content="Sed dictum eros quis massa semper rutrum."> <meta property="og:description" content="Si lobortis singularis genitus ibidem saluto. Dolore ad nunc, mos accumsan paratus duis suscipit luptatum facilisis macto uxor iaceo quadrum. Demoveo, appellatio elit neque ad commodo ea. Wisi, iaceo, tincidunt at commoveo rusticus et, ludus."> <meta property="og:image" content="https://acme.com/site/assets/files/1001/og-image.jpg"> <meta property="og:image:type" content="image/jpg"> <meta property="og:image:width" content="1600"> <meta property="og:image:height" content="1200"> <meta property="og:image:alt" content="Lorem Ipsum"> <meta property="og:type" content="website"> <meta property="og:url" content="https://acme.com/en/about/"> <meta property="og:locale" content="en_EN"> <meta name="twitter:card" content="summary"> <meta name="twitter:creator" content="@schtifu"> <meta name="twitter:site" content="@schtifu"> <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [ { "@type": "ListItem", "position": 1, "name": "About", "item": "https://acme.com/en/about/" } ] } </script> <meta name="generator" content="ProcessWire"> <link rel="alternate" href="https://acme.com/en/about/" hreflang="en"> <link rel="alternate" href="https://acme.com/en/about/" hreflang="x-default"> <link rel="alternate" href="https://acme.com/de/ueber/" hreflang="de"> <link rel="alternate" href="https://acme.com/fi/tietoja/" hreflang="fi"> And some screenshots of the UI:
    1 point
  7. This is quite weird... I just noticed today that when I edit a page, the last breadcrumb item doesn't link to the page's parent, but to the main /page view. It shows the correct title though. The link is correct for all the parent pages further up. Just the immediate parent page breadcrumb link doesn't get added the usual /page/?open=123. Admittedly, I have been tinkering about with several site settings today (mainly users/roles/permissions - but I was always logged in as superuser, so that hardly could interfere with this issue), so I'm afraid some of those changes might have broken some stuff. Does anyone else see the same behavior? ProcessWire: 3.0.125 PHP: 7.2.14 Webserver: Apache/2.4 MySQL: 10.1.35-MariaDB Admin Theme: UIKit Are there hooks where you can change admin-breadcrumbs behavior like that?
    1 point
  8. https://processwire.com/api/ref/sanitizer/test-all/ can be helpful in such cases
    1 point
  9. 1 point
  10. @Moebius Try to set useLanguages property to true. $field->useLanguages = true;
    1 point
  11. If I remember correctly, on the notes of "Name format for children" should have a "More" link that leads to documentation. At least this is how it's done with the ProcessSetupPageName module.
    1 point
  12. Hey @dragan, thanks for this hint! I did not have much contact with multilanguage setups in the past, so I hope I added translatable string support the right way in version 1.0.1 of the module. Additionally I removed the german date formats for the inputs. I think, that is something that german users have to configure on their own if needed.
    1 point
  13. Very nice, thanks for the module! I have to say though, the fact that the fields get automatically added to all templates doesn't sit quite right with me. People probably only need to use time limits for specific templates and for the other templates the fields become a kind of clutter. Better I think to let people add the fields to only the templates they need to be on. I haven't looked closely but perhaps you could reduce the number of needed fields to two - just the Datetime fields. Instead of the checkboxes you can have the Datetime fields set to collapse when empty. Don't have the fields default to "today" but just let people populate them when they want them to be active and leave them empty if they want them deactivated. Another possibility if you want to make it easy for people to add/remove the fields from templates would be to have an AsmSelect field in the module config for choosing templates. Then you could hook Modules::saveConfig to get the selected templates and programmatically add/remove the fields from those templates. Clauses could be added to the selector to check... 1. Either releasetime_start is unpopulated or releasetime_start is less than "now" ...and... 2. Either releasetime_end is unpopulated or releasetime_end is greater than "now"... $pages->find("or1=(releasetime_start=''), or1=(releasetime_start<now), or2=(releasetime_end=''), or2=(releasetime_end>now)"); But rather than try and do this automatically in a hook to Pages::find (which would almost certainly be problematic) I suggest just explaining this in the documentation and letting people add it to their selectors as needed.
    1 point
  14. This is already available within the RTE, I think the same functionality should be brought through to the Image field (note: I am not asking for a media manager )
    1 point
  15. I just installed this module. It works great here with the latest PW dev install. Would it be possible to configure the inputfield / module to allow multiple images as well? I'm thinking of scenarios like: an editor being able to quickly re-use images to build a gallery, slideshow or similar.
    1 point
  16. Version 0.4.0 renders some common meta tags not managed by the fieldtype, and fixes a couple of issues reported. Thanks! See https://github.com/wanze/SeoMaestro/releases/tag/v0.4.0 for more information. Cheers
    1 point
  17. Conditionally 2, provided the collapsible option is available. One of the things I like about Processwire is that it plays nice with mobile screens. Some other CMSs are clearly designed for desktops or large tablets only, but Processwire will work even on a smartphone. I can't say how often I'd actually use it on a phone, but it would be nice to have the option. I actually can think of a case where having the backend mobile friendly would be handy. I was at a market last year, and someone didn't have any cash, but did have a credit card. Of course the front end of my site is mobile friendly anyway, but it could be handy to have the backend mobile friendly too.
    1 point
  18. Version 0.3.0 should fix problems on single language installations. ? I will update Travis CI to run the test suite on two installation profiles (single and multi language). This is possible, just wrap the Seo Maestro field in an InputFieldsetOpen.
    1 point
  19. 1,5 month later, after I did most of the project and be sure that I understand PW system, I finally finished that part. It's not perfect of course but it's working fine. Here is how I did it: Templates And Fields: I created 2 templates: grid and grid_item and 1 pagetableextended field grid_items. In grids page I can enter grid_items like below: Title, summary, featured_image for content on the grid items, external url for obvious reasons, grid_ratio is to determine size of item. Design is limited with ratios from 1x1 to 3x3, so I made it selectable page items from options use_border : for images with white bg, so they don't look like they are floating Modules I have created 3 modules. InputfieldGridBuilder,FieldtypeGridBuilder and GridBuilder. Whenever I save the page, new items from grid_items pagetable are available to use like below. I can order items, add new rows, delete row etc. Whenever I change something, there is a method that works to serialize data to the hidden input field,InputfieldGridBuilder. Also, just in case I call the function it every 5 seconds. I make a small fixed grid that is very similar to the one used in the frontend. So anything that you can do here with jQueryui sortables, it's available for using in the frontend. Last module GridBuilder is used for mostly utility purposes for both frontend and backend. It has methods like getItemSize, getItemImage, build etc. Frontend Normally these will be used in homepage but I made the view of page available to users with editing roles, so before using them they can see that it look like. For example this one in the gif above looks like this. So even with the empty rows, it works. And for using in the homepage, I added a multiple selection page field. So they can use more than one grid, or with the location options we already added they can select to have a different view for different countries. (I added Location settings is globally for every page) Questions, critics, feedbacks or "hi,there buddy"'s are highly welcomed.
    1 point
  20. Selectors have to have a defined value after the operator. There is no defined value in "modified>created", as those are two fields. You can go straight to SQL to accomplish this one: $pageIDs = array(); $result = $db->query("SELECT id FROM pages WHERE modified>created"); while($row = $result->fetch_row()) $pageIDs[] = $row[0]; $pageArray = $pages->getById($pageIDs); // $pageArray contains what you want
    1 point
×
×
  • Create New...