Leaderboard
Popular Content
Showing content with the highest reputation on 03/01/2019 in all areas
-
Version 3.0.127 contains almost 30 new commits, the majority of which are focused on resolving older issue reports. For more details on those commits, see the commit log. This latest version on the dev branch also adds a couple of new features that you might find useful. Specifically, two new Page status flags: “unique” and “flagged”. Below we’ll go into more detail about what these are and how to use them. https://processwire.com/pw-3.0.127/8 points
-
That error is a generic PHP error message, so making sense of it requires some basic PHP debugging skills. There's no manual here – just read the message, see what it is related to, and try to figure it out from there. Google is your best friend when debugging PHP code ? The message here is rather clear: In other words you're trying to call function and() on a null value in your _main.php file, line 49. The exact reason is impossible to say without seeing the code, but my guess so far would be that you're grabbing a page or something like that, and not actually checking that it has a valid value before trying to use it as an object.4 points
-
3 points
-
There are so many ways in ProcessWire to do or save things. Depending on your background and history with ProcessWire you will find other ways or solutions. I know recipe-collectors that would only need two fields. A title and a textarea. I personally would go a more abstract way to be able to much more and other things. Template: Recipe Fields: title (text) summary/introduction (textarea) preparation (textarea) ingredients (repeater) Fields: ingredient (page reference - pages with template ingredient) amount (int or text) unit (select options - grams, cups, liters, hint) images (image) Template: Ingredient Fields: title With that setup I can easily collect all my recipes, create a list of all ingredients I need for all of my recipes. Can look for recipes with a special ingredient and so on.3 points
-
I think so - even if the CSS approach works, it' really strange to me that the 404 page affects trash for all - sounds like there is still a bug there somewhere.2 points
-
One easy option to hide it is to install @tpr's AdminOnSteroids module, which – among others – adds the CSS class role-superuser to <body> so you can also use its Admin CSS feature: body:not(.role-superuser) .PageListID27 { display: none; }2 points
-
You could also do it with simple CSS: body:not(.role-superuser) .PageListID27 { display: none; }2 points
-
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
-
A simple module to enable easy navigation between the public and the admin side of the site. After installation a green bar will appear to the upper side of the screen, containing a few navigation elements and displaying the PW version number. Heavily inspired by @apeisa's great AdminBar (Thanks!). I needed a bit simpler tool for my projects and as a result, this was made. Available on GitHub .1 point
-
I actually did exactly as wbmnfktr suggested in a previous project (still in development). At first I was a bit hesitant of having to create new ingredients every time I wanted to add a new unique recipe, but the pros quickly outweighed the cons. It makes filtering on the front end a lot better/easier, as well as makes new recipes easier.1 point
-
1 point
-
@adrian Thanks, reopened: https://github.com/processwire/processwire-issues/issues/817 Thank you also @szabesz It is good to have a workaround, but I think it should be fixed (if possible) in the "trash for all" code.1 point
-
In his other post I also recommended this but .role-superuser seems to be added by AdminOnSteroids only...1 point
-
1 point
-
Hi, From the top of my head this could do it this way : a template with a title and body (recipe) field and a repeater field to hold the ingredients list : a text field to hold the ingredient name a text field to hold the amount of ingredient a select field to hold the amount unit (tsp, l, ml? etc..)1 point
-
I face a problem with dependencies right now. A field should only be shown and be mandatory if a checkmark (within the repeater matrix type section) is set but this doesn't work all the time. Right now I disabled this dependency and focused on other things but yes... it still seems to be a little bit... unstable.1 point
-
I never thought about that and the website is actually hosted on a Windows (IIS) server which might be an issue. However, the CRLF/LF doesn't seem to change any of the output. Actually, I just tested the exact same code on a UNIX apache server and there it is formatted as expected. So there must be something related to the IIS server. I'll contact the hosting support. Thanks a lot for the link, looks very very interesting, I'll try this for my next project. I was already amazed by the flexibility of Processwire and I didn't even know about this way. This just puts flexibility on another level. Processwire never fails to impress me. Thanks a lot for your help @szabesz !1 point
-
But still, I'm not happy. I've closed the bug report, but afterwards I have found out, that it is not only a problem if I move 404 under admin, but also, if I hide it like this. $wire->addHookAfter('Page::listable', function(HookEvent $event) { if($this->wire('user')->isSuperuser()) return; $page = $event->object; if($page->id === 27) $event->return = false; }); So there seems to be no way the let the "editor" see the trashcan AND not see the 404 page in the backend. What do you think? Shall I reopen the bug report? Thank you!1 point
-
For the record: According to Ryan, it is not good to move the 404 Page under "admin". https://github.com/processwire/processwire-issues/issues/8171 point
-
For the record: According to Ryan, it is not good to move the 404 Page under "admin". https://github.com/processwire/processwire-issues/issues/8171 point
-
1 point
-
Thanks for the code sample, I cannot see anything suspicious there, it is very similar to how I do things and in my case the output is formatted in the browser just as expected. You might want to check the type of line breaks you use, I always use Unix LF so I have no experience with Windows CRLF for example. That said, your code might be "messed up" because prependTemplateFile and appendTemplateFile, so you might want to try constructing your page similar to this: https://www.pwtuts.com/processwire-tutorials/alternate-template-strategy-using-a-single-output-file/ <body class="<?php echo $page->template->name; ?>"> <?php include($config->paths->templates . "/includes/header" . ".php"); include($config->paths->templates . "/views/{$page->template->name}" . ".php"); include($config->paths->templates . "/includes/footer" . ".php"); ?> </body> That is by using _main.php as the skeleton of that page and including partials by using include. I do it this way too. In config.php I have: $config->prependTemplateFile = '_init.php'; $config->appendTemplateFile = '_main.php'; Which is the way most of us set things up, I guess, because this way into _init.php one can put helper functions, for example, and _main.php can be replaced in the admin to out put something else than HTML (eg. XLM for RSS feed, JSON for public API, etc...). If you use these for header and footer, you loose flexibility. However, your setup should work too so there must be an issue behind the scenes.1 point
-
Hi @Wanze, I have a product template with a repeater that I use for tags of the product. I think that it would be great use the tags of the product for populate the meta tag of the page ? buy Andrea1 point
-
Hey @Tom. Thanks for the nice words and your feedback. I agree, it would be neat to have an image field for clients. Could you open a feature request on GitHub? I would like to discuss the implementation with you, or anyone interested in this. I guess there are may ways to achieve this, and I'm not sure which one's the best ?1 point
-
What do you think about appending the field type to the Fields asmSelect list options? I often don't remember the type by the name so it would come handy. However, since it's a plain select HTML element it cannot be styled and in the rendered asmSelect the type appears twice (also at the end of the bars).1 point
-
Hi @adrian, A lot of the code is much the same, but tidied up with the the coding style guide implemented, so I'm not surprised the diff doesn't reveal much! The readme is pretty thorough and covers a lot, but here's the gist: addData() - add X-Mailgun-Variables - https://documentation.mailgun.com/en/latest/user_manual.html#attaching-data-to-messages - to be honest don't know what use cases there are for it but it's in the API and was easy to implement addTags() - add multiple tags as an array getHttpCode() - to get the response code from either send() or validateEmail() * Most methods now chainable (see the Advanced Example in the readme) Tracking only used if bodyHTML() is set (As this only works in HTML email) cc() and bcc() only used when batchMode is off - this seems to me to be the correct implementation WireMail::htmlToText() used for generating the text version if only HTML passed (as in WireMail now) The ASCII conversion for tags now uses $this->sanitizer->nameFilter($tag, [" "], "", false, 128); WireMail::replyTo() implemented - doesn't seem to have been before removed addAttachment(), now uses WireMail::attachment() - which adds the ability to set the filename Unixtime is now passed to setDeliveryTime() A bunch of other small tweaks like using $sanitizer->email() in validateEmail() * I'd wanted to use WireHttp for the requests, but it doesn't allow custom cURL options. I have done a pull request for this, but I don't think I'll be changing the module's cURL request implementation now anyway. Cheers, Chris1 point
-
Thanks @nbcommunication - could you please highlight the new features you've added? I did a diff on yours vs @Macrura's but there are so many changes, it's hard to pick out what is new. Thanks!1 point
-
Maybe you can use the truncate method https://processwire.com/api/ref/sanitizer/truncate/ ? // Truncate string to closest word within 150 characters $s = $sanitizer->truncate($str, 150); Here is another example of how to use a hook to add a "summarize" method to all the $page objects https://processwire.com/blog/posts/pw-3.0.28/ Here is reset https://secure.php.net/manual/en/function.reset.php Here is explode https://secure.php.net/manual/en/function.explode.php1 point
-
1 point
-
Sounds pretty similar to a Drupal based module I just heard about. https://www.drupal.org/project/build_hooks and here is where I read about it https://weknowinc.com/blog/improving-drupal-and-gatsby-integration-drupal-modules Maybe that Drupal module would give you some more ui or functionality ideas?1 point
-
@bernhard nice! I'll update the tutorial (done now) and point to this module. I haven't had much time at ll to work on that site, been so busy trying to learn enough skills to call myself a dev one day...1 point
-
@flydev I adjusted the Regex Pattern for the endpoint url to allow numbers too: https://github.com/thomasaull/RestApi/commit/f2e851faf4b89449bca496d6bea20ee85dc0f6ee Please update the module to 0.0.6 for this to become active1 point
-
TemplateEngineSmarty is now compatible with TemplateEngineFactory 2.x: https://github.com/blue-tomato/TemplateEngineSmarty1 point
-
This reminds me that we have a recent discussion of "how to put count into good use": https://weekly.pw/issue/248/ : "exact match queries using Page reference fields"1 point