Leaderboard
Popular Content
Showing content with the highest reputation on 11/02/2017 in all areas
-
» A more exhaustive version of this article is also available on Medium in English and German « First, we'd like to thank the very helpful community here for the excellent support. In many cases we found guidance or even finished solutions for our problems. So a big THANK YOU!!! We are pleased to introduce you to the new Ladies Lounge 18 website. The next ICF Women’s Conference will take place in Zurich and several satellite locations across Europe. We embarked on bold new directions for the development of the website — in line with the BRAVE theme. Ladies Lounge 18 — ICF Woman’s Conference website on Processwire ICF Church is a European Church Movement that started 20 years ago in Zurich and since experienced tremendous growth. There are already well over 60 ICF churches across Europe and Asia. ICF is a non-denominational church with a biblical foundation that was born out of the vision to build a dynamic, tangible church that is right at the heartbeat of time. With the growth of the Ladies Lounge from a single-site event to a multi-site event, the demands and challenges to the website have also increased. A simple HTML website no longer cuts it. Simplified frontend Our goal with the development of the new site was it to present the different locations — with different languages and partly different content — under once uniform umbrella — while at the same time minimising the administrative effort. In addition to the new bold look and feel, this year’s website is now simpler and easier and the information is accessible with fewer clicks. Some highlights of the new website Thanks to processwire, all contents are maintained in one place only, even if they are displayed several times on the website 100% customised data model for content creators Content can be edited directly inline with a double-click: Multi-language in the frontend and backend Dynamic Rights: Editors can edit their locations in all available languages and the other content only in their own language Easy login with Google account via OAuth2 Plugin Uikit Frontend with SCSS built using PW internal features (find of files…) Custom Frontend Setup with Layout, Components, Partials and Snippets Only about 3 weeks development time from 0 to 100 (never having published a PW before) Despite multi-location multi-language requirement, the site is easy to use for both visitors and editors: The search for a good CMS is over It’s hard to find a system that combines flexibility and scope with simplicity, both in maintainance and development. The search for such a system is difficult. By and large, the open source world offers you the following options: In most cases, the more powerful a CMS, the more complex the maintenance and development It is usually like that; The functionality of a system also increases the training and operating effort — or the system is easy to use, but is powerless, and must be reporposed for high demands beyond its limits. Quite different Processwire : You do not have to learn a new native language, you don’t have to fight plugin hell and mess around with the loop, you don’t have to torment yourself with system-generated front-end code or even learn an entierly new, old PHP framework . All our basic requirements are met: Custom Content Types Flexible and extensible rights-management Multilanguage Intuitive backend Well curated Plugin Directory Actually working front-end editing Simple templating with 100% frontend freedom In addition, Processwire has an exceptionally friendly and helpful community. As a rule of thumb, questions are answered constructively in a few hours . The development progresses in brisk steps , the code is extremely easy to understand and simple. Processwire has a supremely powerful yet simple API , and for important things there are (not 1000) but certainly one module which at least serves as a good starting point for further development. Last but not least, the documentation is easy to understand, extensive and clever . Our experience shows, that you can find a quick and simple solution with Processwire, even for things like extending the rights-management — most of the time a highly complex task with other systems. This is also reflected positively in the user interface. The otherwise so “simple” Wordpress crumbles when coping with more complex tasks. It sumbles over its apparent simplicity and suddenly becomes complex: Old vs. New — Simple and yet complicated vs. easy and hmmm … easy Our experience with Processwire as first-timers Before we found out about Processwire, we found CraftCMS on our hunt for a better CMS. We were frustrated by the likes of Typo3, WP or Drupal like many here. CraftCMS looked very promising but as we were digging deeper into it, we found it did not met our requirements for some big projects in our pipeline that require many different locations, languages and features. Initially we were sceptical about Processwire because; A. CraftCMS Website (and before UiKit also the admin interface) simply locked much nicer and B. because it is built on top of a Framework It was only later, that we found out, that NOT depending on a Framework is actually a very good thing in Processwire's case. Things tend to get big and cumbersome rather then lean and clean. But now we are convinced, that Processwire is far superior to any of the other CMS right now available in most cases. The good Processwire is the first CMS since time immemorial that is really fun to use (almost) from start to finish— whether API, documentation, community, modules or backend interface. Every few hours you will be pleasantly surprised and a sense of achievement is never far away. The learning curve is very flat and you’ll find your way quickly arround the system. Even modules can be created quickly without much experience. Processwire is not over-engineered and uses no-frills PHP code — and that’s where the power steams from: simplicity = easy to understand = less code = save = easy maintanance = faster development … Even complex modules in Processwire usually only consist of a few hundred lines of code — often much less. And if “hooks” cause wordpress-damaged developers a cold shiver, Hooks in Processwire are a powerful tool to expand the core. The main developer Ryan is a child prodigy — active, eloquent and helpful. Processwire modules are stable even across major releases as the code base is so clean, simple and small. There is a GraphQL Plugin — anyone said Headless-CMS?! Image and file handling is a pleasure: echo "<img src='{$speaker->image->size(400, 600)->url}' alt='{$speaker->fullname}' />"; I could go on all day … The not soooo good Separation of Stucture and Data The definition of the fields and templates is stored in the database, so the separation between content and system is not guaranteed. This complicates clean development with separate live- and development-environments. However, there is a migration module that looks promising — another module, which is expected to write these configurations into the file system, unfortunately nuked our system. I'm sure there will be (and maybe we will invest) some clever solutions for this in the future. Some inspiration could also be drawn here, one of the greatest Plugins for WP: https://deliciousbrains.com/wp-migrate-db-pro/ Access rights The Access-Rights where missing some critical features: Editors needed to be able to edit pages in all languages on their own location, and content on the rest of the page only in their respective language. We solved it by a custom field adding a relation between a page the user and a role that we dynamically add to the user to escalate access rights; /** * Initialize the module. * * ProcessWire calls this when the module is loaded. For 'autoload' modules, this will be called * when ProcessWire's API is ready. As a result, this is a good place to attach hooks. */ public function init() { $this->addHookBefore('ProcessPageEdit::execute', $this, 'addDynPermission'); $this->addHookBefore('ProcessPageAdd::execute', $this, 'addDynPermission'); } public function addDynPermission(HookEvent $event) { $message = false; $page = $event->object->getPage(); $root = $page->rootParent; $user = $this->user; if ($user->template->hasField('dynroles')) { if ($message) { $this->message('User has Dynroles: '.$user->dynroles->each('{name} ')); } // for page add hook… if ($page instanceof NullPage) { // click new and it's get, save it's post… $rootid = wire('input')->get->int('parent_id') ? wire('input')->get->int('parent_id') : wire('input')->post->parent_id; if ($message) { $this->message('Searching Root '.$rootid); } $root = wire('pages')->get($rootid)->rootParent; } elseif ($page->template->hasField('dynroles')) { if ($message) { $this->message('Page "'.$page->name.'" has Dynroles: '.$page->dynroles->each('{name} ')); } foreach ($page->get('dynroles') as $role) { if ($role->id && $user->dynroles->has($role)) { if ($message) { $this->message('Add dynamic role "'.$role->name.'" because of page "'.$page->name.'"'); } $user->addRole($role); } } } if (!($root instanceof NullPage) && $root->template->hasField('dynroles')) { if ($message) { $this->message('Root "'.$root->name.'" has dynamic roles: '.$root->dynroles->each('{name} ')); } foreach ($root->get('dynroles') as $role) { if ($role->id && $user->dynroles->has($role)) { if ($message) { $this->message('Add dynamic role "'.$role->name.'" because of root page "'.$root->name.'"'); } $user->addRole($role); } } } } } With the Droles and Access Groups Modules we were not able to find a solution. I thought it was hard to get absolute URLs out of the system — Ha! What a fool I was. So much for the topic of positive surprise. (Maybe you noticed, the point actually belongs to the top.) But while we’re at it — that I thought it would not work, was due to a somewhat incomplete documentation in a few instances. Although it is far better than many others, it still lacks useful hints at one point or another. As in the example above, however, the friendly community quickly helps here. processwire.com looks a bit old-fashioned and could use some marketing love. You notice the high level to moan with Processwire. There is no free Tesla here. Conclusion Processwire is for anyone who is upset about any Typo3, Wordpress and Drupal lunacy — a fresh breeze of air, clear water, a pure joy. It’s great as a CMF and Headless CMS, and we keep asking ourselves — why is it not more widely known? If you value simple but clean code, flexibility, stability, speed, fast development times and maximum freedom, you should definitely take a look at it. You have to like — or at least not hate PHP — and come to terms with the fact that the system is not over-engineerd to excess. If that’s okay with you, everything is possible — with GraphQL you can even build a completely decoupled frontend. We are convinced of the simplicity of Processwire and will implement future sites from now on using it as a foundation. Links & resources we found helpful API documentation and selectors API cheatsheet pretty handy, not quite complete for version 3.0 Captain Hook Overview of Hooks Weekly.PW newsletter a week, exciting Wireshell command line interface for Processwire Nice article about Processwire Plugins & Techniques that we used Custom Frontend Setup with Uikit 3 and SCSS, and Markup Regions Uikit Backend Theme ( github ) Oauth2 login modules In-house development Login with E-Mail Pro Fields for repeater matrix fields (infos, price tables, daily routines) Wire upgrade to update plugins and the core Wire Mail Mandrill to send mails FunctionalFields for translatable front-end texts that are not part of a content type (headings, button labels, etc.) Runtime markup for dynamic backend fields (combination of first and last name) Tracy debugger for fast debugging Textformatter OEmbed to convert Vimeo and Youtube links into embed codes HideUneditablePages thanks to @adrian6 points
-
// Initialise artist name variable $artist = ''; // Find "work" pages that have this exhibition selected in their "work_exhibition" field // and sort them according to the title (i.e. name) of the artist // Iterate over those works... foreach($pages->find("template=work, work_exhibition=$page, sort=work_artist.title") as $work) { // If the name of this work's artist is different to $artist if($work->work_artist->title !== $artist) { // Then store the artist's name in $artist $artist = $work->work_artist->title; // And output a heading echo "<h3>$artist</h3>"; } // Output the title of the work echo "<p>$work->title</p>"; }4 points
-
Hopefully, one of these links helps you with placing your Google Analytics code. https://www.lunametrics.com/blog/2012/02/09/where-put-google-tracking-code/ https://groups.google.com/forum/#!topic/digital-analytics-fundamentals/V9z4TVXQW_4 https://support.google.com/analytics/answer/1008080?hl=en3 points
-
Thanks for the clarification @Robin S. I appreciate the comments, they are helpful. The things that I was unsure about I have asked for clarification and you've provided this. I am passionate about all my modules, both commercial and free. I would never knowingly release a module that is half-finished . In this regard though, I must apologise to all VPS users because there has been an oversight on my part. I'll explain in a minute. My workflow is that I develop my modules in ProcessWire 2.7 using Reno Theme. I then test in the default admin theme. When I have everything working and looking as it should (PHP, JS, CSS, inside repeaters, etc), I repeat the process in ProcessWire 3.x. There are some cases where I even have Reno Theme-specific CSS classes, to make sure everything works fine irrespective of the theme. In the case of the last version of VPS, I now realise, I forgot to test using default theme in ProcessWire 3.x and for this I apologise to all of you. I am glad Robin caught this. I am equally very curious why others didn't notice this. It can only mean, either you don't use the default theme, or mainly use ProcessWire 2.7 or etc? Either way, I will fix this. And it is Robin. Please don't hold back! Like I said, I was unsure about some statements and you've clarified them. To all, please, don't hold back on the feedback. Not wanting to repeat this statement everywhere, this goes not just for VPS, but for all my modules, free and commercial. However, I can't promise to implement every suggestion since I need to consider things like backward compatibility.3 points
-
You're right, @AndZyk. I tried putting it after the relevant slider code, figuring that would be enough, but when I dropped it right down to the end, it started working. Thanks!!2 points
-
Hello @ROLAND_JUNO As mentioned, just put your Google Analytics Tracking-Code before the closing </head> inside your template files. Depending on your template strategy it could be either in an include or a _main.php, so you don't have to put it in every template file. Regards, Andreas2 points
-
Just my opinion, but I don't quite understand whats the benefit to get rid of one dependency to immediately replace it with another dependency. I have no experience with VueJS or Angular yet, but as far as I can see, you would be completely dependent on one of those frameworks. In this case I'm maybe a little bit old school, but I like jQuery and also don't understand, why everybody wants to get rid of it as fast as possible. Also the comparison of ProcessWires API with jQuery was on of the first things, that got me interested. Luckily it is not our decision to decide.2 points
-
2 points
-
Hello @mike62, I haven't used Slick yet, but on the website it says: You are using jQuery 1.2.6. So maybe you should try an newer version of jQuery, because 1.2.6 is really old. Regards, Andreas2 points
-
2 points
-
I didn't intend any insult - it's just that I've found from conversations with clients and colleagues that people differ in how much they notice design details. I've had conversations with clients where they literally cannot see the difference between typeface A and typeface B, or colour A and colour B. To them, it's just "a font" or "green", and no amount of discussion changes that. For people in our line of work perhaps it depends on what our background or "first love" is: a person who comes to development via design probably sees things differently to someone who comes to design via development. I don't think that at all. But I do think that there is some significance to crossing from free module to commercial module. There's a greater responsibility to ensure that the product is reasonably mature, tested, and fit for purpose. It's only natural that consumers will have higher expectations if they are buying a product as opposed to receiving it for free. Please don't take it that I'm bitterly disappointed in VPS or anything like that because I'm not. It's an awesome product, but one that I feel needs a bit more work in order to be production-ready. My only intention here was to give some constructive feedback.2 points
-
That's certainly doable within a template but not simple. You'd have to parse the URL to extract the video ID, convert it to lowercase, add the "video-" prefix and then match it against the image field. I've used the module within a Repeater several times and personally I prefer having a dedicated image field within the Repeater so I can see the thumbnail right alongside the URL. So much easier to identify the thumbnail that way, both visually within Page Edit and in the template file.1 point
-
Maybe I'm missing something, but I don't understand how this can work. If video URLs are entered within a Repeater field then presumably there are multiple videos on the page. So how is the connection between video URL and video thumbnail going to work, given that the sort order within the Repeater and Images field can both be changed independently by the user?1 point
-
1 point
-
Hi @AndZyk - this was actually just fixed yesterday. Please update and let me know if you still have any problems.1 point
-
Maybe it has been asked before, but when I have TracyDebugger disabled I get this error in the console of my developer tools: Could this be avoided by a try-catch block? It is not too important, but it would be great to not have this error. And I cannot mention enough how great your module is. It helped me a lot of times.1 point
-
As mentioned in the documentation of Slick, you need to add your scripts (jQuery and Slick) at the end of your closing body tag: Right now you add your scripts before. Usually it shouldn't matter, but it seems to be in this case.1 point
-
@ROLAND_JUNO ... Add the code between <! - Google Analytics -> {GOOGLE ANALYTICS CODE} <! - End Google Analytics -> As below and in place UA-XXXXX-Y enter code ( tracking ID ) ... This is an example in _main.php from processwire 3.x ... More info: <?php namespace ProcessWire; // _main.php template file, called after a page’s template file $home = pages()->get('/'); // homepage $siteTitle = 'Regular'; $siteTagline = $home->summary; ?><!DOCTYPE html> <html lang="en"> <head id='html-head'> <!-- Google Analytics --> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXX-Y', 'auto'); ga('send', 'pageview'); </script> <!-- End Google Analytics --> <!-- THERE ARE EXAMPLES OF PROCESSWIRE 3.X DO NOT COPY THEM --> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title id='html-title'><?=page()->title?></title> <meta name="description" content="<?=page()->summary?>"> <link rel="stylesheet" href="<?=urls()->templates?>styles/main.css"> </head>1 point
-
yeah, first load jQuery, then slick.js, and at the end init your slider; also, you should wrap it in a document.ready function.1 point
-
I've been staring at this for a while and finally figured out why it works - very clever!1 point
-
Sorry about that - I wasn't seeing that because I had an older, updated install that already had those options stored in the settings database. New version just committed fixes it. Thanks again!1 point
-
Just Not suggesting we should go the VueJS route at all, but here's an interesting "admin" panel built with Vue: https://github.com/iview/iview-admin Check out the demo - SPA admin panel.1 point
-
All of the resources, css, js, images, and fonts are taking quite a while to load. What type of hosting service is this site using, shared? I am not familiar with modernizer. Can you temporarily disable it and see if that helps any? I'm just thinking out loud about eliminating a possible cause one at a time.1 point
-
@mike62 1) no need to remove ProCache 2) you should be logged into your admin when you are developing or trying to see uncached pages 3) make sure to add body class to cached pages so you can tell what is going on 4) install and use Tracy Debugger 5) make sure you have both wire_challenge and wires_challenge cookies in PC settings 6) if you for some reason do need to see the site when not logged in, add a get var, like ?nocache to the end of the url by the way, what happened to your admin - it looks like the admin from a much earlier version of PW. You should check to see if your user has an admin theme selected... By the way, i have never had to do any of the things you list, and work on live sites around 20 hrs a week.1 point
-
Many of the images are taking a long time to load, for example,1021701976_1-1.1140x760.png takes 12.64 seconds. You can add setlocale(LC_ALL,'en_US.UTF-8'); to your /site/config.php to remove that error. Use whatever locale is appropriate for you. [edit] You can use the browser dev tools > network tab to determine loading issue. It will help eliminate that issue should others exist.1 point
-
this works $uniques = new \ProcessWire\PageArray(); foreach($p as $item) { $uniques->import($item->category); }1 point
-
Ok so I had the same situation! After migrate, could not Log in. To prevent this problem I found that migration should be done in a proper order. 1. Install PW on your new domain. 2. Copy and replace the /site directory. (if needed delete the content of site/assets/cache, i think I did that, sorry I repeated the process a lot of times because of failures so not sure about that anymore ) 3. modify "site/config.php" so the DB info is correct, confirm that userAuthSalt is correct (same as in your old domain or local dev version) 4. copy and replace the ".htaccess" in the root dir 5. Now export and import the DB (if I did it before previous steps then it did not work in my case, so its important to do it now) Now go into admin and check if there aren't any errors and try to log in. It worked for me! Hope it helps some of you! Cheers!1 point
-
I would have thought that nearly all new site developments use PW3. I know I have never contemplated building a new site with the old <= v2.7. And most buyers would be using VPS for new projects rather than retrofitting it into old projects that they are not willing to upgrade, wouldn't they? @kongondo You could run a quick survey. Personally I agree that it is not likely that VPS customers want it for PW 2.7 but it is your decision, of course. I started with ProcessWire 3 so anything before that is history to me. BTW: https://weekly.pw/polls/ see: Which versions of ProcessWire are you currently hosting or managing? (146 votes)1 point
-
1 point
-
Hey guys, the current state of VPS is a great start, I think. Let's just be productive as always Calling products "Pro" and "Professional" is just a marketing mambo-jumbo we started to use because we are following suit. I'm sure @kongondo is just as passionate about his modules as @Robin S.1 point
-
Thanks for all the positive feedback and support on Medim Folks!1 point
-
In that case: $artist = ''; foreach($pages->find("template=work, work_exhibition=$page, sort=work_artist.title") as $work) { if($work->work_artist->title !== $artist) { $artist = $work->work_artist->title; echo "<h3>$artist</h3>"; } echo "<p>$work->title</p>"; }1 point
-
I read your post a few times but wasn't able to grasp exactly how you have this set up. In case it helps, here is how I would tend to approach this... Work template: has Page Reference field for Artist Exhibition template: has Page Reference field for Works Then in your Exhibition template file: $artist = ''; foreach($page->works->sort('artist') as $work) { if($work->artist->title !== $artist) { $artist = $work->artist->title; echo "<h3>$artist</h3>"; } echo "<p>$work->title</p>"; }1 point
-
If I was actively developing a site, I would take the time to fix any plugin dependencies - you are missing out on so much by being on such an old version. I have updated many site from 2.3/2.4 to 3.x with minimal problems. Sometimes errors pop up that look bad, but only take a few minutes to fix. Just my 2cents worth!1 point
-
1 point
-
1 point
-
These are the articles we need! So many thanks @noelboss! We need more articles like this. We have built a great application for an international corporate using ProcessWire with over a million (1.000.000) pages and counting and hundreds of concurring users all over Europe and the United States. We built it right in the back-end of ProcessWire using ListerPro and +/- 20 custom Process Modules. Unfortunately I can't write a showcase (I'm dying too ...) due to legal stuff. I could not agree more with one of the disadvantages: Thanks again! I clapped 50 times1 point
-
Currently no. I will look into this, maybe start with text fields. In the code, I see I had this previously. I cannot remember why I commented it out; will look into it. Good idea; Will add to next version Thanks for catching this. Will amend. Sorry, I don't understand this one. Please clarify, an illustration maybe? Thanks. They do, in my case. See GIF below. I've tested in PW 2.7. Will need to do further tests in PW 3.x Looks fine here. Must be some CSS issue. Will investigate. Looks fine to me (in different resolutions); see below. Must be your browser. What browser are you using? Ditto. Strange. I'm not seeing that here (see my demo) nor have any other users reported this; you are the first one. Must be your browser, so let's start from there. Ditto. See the screenshot below from ProcessWire 3 Test. I'll have to have a think about this one. My guess is that the editor already know the aspect ratio of that image? I think this is a matter of (stylistic) taste. Absence of rounded corners in Thumbs view Table (Thumbs view has two layouts; grid and table; List view is the other view without images) was just an oversight. I'll have a think about this one. I agree with the idea about making the modal load faster, although I would add, 'initially load faster' since once thumbs are created, they do not have to be recreated. As for 260px high thumbs, unless I am mistaken, that's a ProcessWire 3 feature. I have to take into account prior versions of ProcessWire. Meaning, they would still need their thumbnails to be created at 260px, so nothing gained for them. I have no empirical evidence, but it seems to me, PW 2.x users are still the majority. In addition, given that we have VPS in use out there already using 100px high thumbs, switching to 260px high thumbnails will lead to some disruption. As for too small, that is also a matter of taste? I don't like large thumbs . Incidentally, ProcessWire 2.x has been using 100x100 thumbs. Maybe if we made this configurable? Disconcerting? I'm not sure how to respond to this one to be honest . RE layout, I will do further tests. Will also look into the label line height. Will look into this, thanks. Good idea. Will make it configurable, thanks. Yes, there is no easy way around this. Users will just need to be taught that hitting save will implement the changes they've made. I'll have a think. Again, I haven't seen the overflow here, nor text cramped against the margins. I understand border radius are not everyone's cup of tea. I tried to replicate ProcessWire's System Notification notices. Apart from the white border, they are virtually identical, in my opinion. I'll look into this. Good catch. Will address this in next version. You are probably going to guess what I am about to say. I can't see that here. So, browser issue? Erm...what would you suggest? I see where you are coming from. I try to do my best to make sure what I put before clients works well but also looks nice. It seems some issues are browser specific. Others are a matter of taste, but certainly not trivial. Thanks for the detailed feedback.1 point
-
AFAIK you don't need to check $page->editable when using FEEL.1 point
-
Tankä, as we say in Zurich Frontend editing comes bundeled with the Processwire core! In addition we use Front-End Edit Lightbox (FEEL) like this; echo $page->feel( [ 'text' => $page->template->get('label|name').' '.ukIcon('pencil'), 'class' => 'uk-button uk-button-small uk-button-default cp-editpage', 'fields' => null, ]);1 point
-
Maybe this can help? //https://github.com/FlipZoomMedia/ProcessWire-AIOM-All-In-One-Minify/issues/64 $_timestamp = ((int)$_timestamp + $file['last_modified'] + hexdec(md5(basename($file['absolute_path']))));1 point
-
Thank u, It's worked method with JS. and still the problem with css files.1 point
-
1 point
-
I have also written the login/logout system on my own (I needed UIKit Markup and some other customizations). To prevent spam I use this Honeypot class and I have no problem since then. It make several tests before letting the user go further. I have installed it via composer so updating is also no problem. So its a look worth while. Best regards1 point
-
One very easy and effective solution is to use honeypots. Ryan also uses this technique for Formbuilder and has (like me) very good results. Just remember to turn off the autofill option for the input to prevent the browser from filling your hidden field and marking it as spam.1 point
-
There's native `Fieldset in Tab` for creating editor tabs, but sometimes it could make more sense to put a field that's not directly related to `Content` into `Settings` or `Children` tab (such as for body class or some toggles that I see being used often). You can use the hook below to move fields between the tabs. // site/ready.php wire()->addHookAfter('ProcessPageEdit::buildForm', function (HookEvent $e) { // make sure we're editing a page and not a user if ($e->process != 'ProcessPageEdit') return; // RESTRICT BY TEMPLATE // $page = $e->object->getPage(); // if ($page->template != 'home') return; // RESTRICT BY ROLE // $user = $e->user; // if (!$user->hasRole('editor')) return; $form = $e->return; $contentTab = $form->children->get('id=ProcessPageEditContent'); $settingsTab = $form->children->get('id=ProcessPageEditSettings'); // $childrenTab = $form->children->get('id=ProcessPageEditChildren'); // if page template is set noSettings = true, $settings will not exist if (!$settingsTab) return; // MOVE TITLE FIELD TO SETTINGS TAB $title = $contentTab->get('title'); if (!$title) return; $contentTab->remove('title'); $settingsTab->prepend($title); });1 point
-
Install LazyCron (core module) and add a hook for a certain time period, say LazyCron::everyHour. Something like this should work: wire()->addHookAfter('LazyCron::everyHour', function (HookEvent $e) { $closables = $e->pages->find('closed=0, enddate>now'); foreach ($closables as $p) $p->setAndSave('closed', 1); $openables = $e->pages->find('closed=1, startdate>now, enddate<now'); foreach ($openables as $p) $p->setAndSave('closed', 0); });1 point
-
Hi, I Installed the "AutoExportTemplatesAndFields" and when creating repeater fields the module was affecting the fields editing. I had two repeater fields: "repeater1" and "repeater2", the "repeater1" should repeat the "images1" field and the "repeater2" should repeat the "images2", the problem was each time I edited one of them and change the repeated field the other assumed that modification. Example: editing the "repeater1" and change the field to "image3" the "repeater2" instead of having the "image2" has the field to be repeated assumed the field "image3". After uninstall the "AutoExportTemplatesAndFields" module I could edit each repeater and assign different fields to them. I hope you can find the issue it is a great module to use. Thank you.1 point
-
$page->created …will give you the unix timestamp, or you can use PHP to format it however you want: <?php echo date("F j, Y, g:i a", $page->created); // October 10, 1974, 11:28 pm http://www.php.net/manual/en/function.date.php1 point