Leaderboard
Popular Content
Showing content with the highest reputation on 11/24/2017 in all areas
-
Sure diff features: If you have a local version of a PW site you can compare it to the production one in seconds (depending on the connection speed usually in 4-40 seconds), benefits: dead easy to spot new log entries, such us: errors.txt, sessions.txt, etc... easy to apply changes both directions, after all, it is a diff tool helps when doing upgrades: it is possible to compare updated index.php to .index-3.0.x.php, for example. Same goes for wire folder and .htaccess, of course. You can delete what is no longer needed, rename what should be changed right form the diff view window. I usually also delete previous module directories renamed and left over by the upgrade module. You can batch select changed/new files, expand the tree view to see only changed/new files/folders, temporarily see "files/folder hidden by you" etc... all in all it is very fast to manually sync a site. It is possible to temporarily exclude and/or hide files/folders, excluding can be saved as a "permanent session" (can be changed later on, of course) I'm just scratching the surface with this sort description, it has tons of other features, but most importantly if configured properly it is the fastest (by far) of all similar GUI diff tools I've ever tested. Automatic file sync features are good too but I use those less often. I want to write a blog post about my workflow that heavily relies on all the above. I just need to find the time to do that3 points
-
Inside a hook in admin.php, you have to use $this or wire() to return an object. So $this->fields->get("sport_categorie"); will return your field. About the option field, look at the following code : $this->addHookAfter('Pages::saved', function($event) { $page = $event->arguments[0]; //set the page if($page->template == 'sport-verenigingen-overzicht') { //get the subcategories from the parent textarea, split on newline $subcats = preg_split('/[\n\r]+/', $page->subcats); //(also tried without imploding and adding the array, also doesnt work) //$subcats = implode("|",$subcats); $subcats = implode("\n",$subcats); //get the children $children = $page->children(); foreach ($children as $child) { //set the options(sport_categorie is the options field) //$child->sport_categorie = $subcats; //$child->save('sport_categorie'); $field = $this->fields->sport_categorie; $this->modules->get('FieldtypeOptions')->manager->setOptionsString($field, $subcats, true); $child->save($child->sport_categorie); } //if i use a normal textfield instead of an optionsfield, //all the children have the correct data e.g: test1|test2|test3 //how to get the values into the options field?? } });2 points
-
@adrian These additions are great. I think the new console function is very useful. Thank you for all your efforts.2 points
-
Hello @flashmaster, First thing that caught my eye, you should edit your post to remove the database password. This appears to be a stand-alone php script designed to restrict access to specific pages, and not one normally associated with ProcessWire. ProcessWire has it's own built-in functions and supporting modules for governing access to pages or by certain roles, etc. Have a look: https://processwire.com/talk/topic/15261-best-method-for-restricting-page-access/ Or Adrian's excellent module https://processwire.com/talk/topic/11499-admin-restrict-branch/ The point is that you don't need to spend time converting a script to work with ProcessWire, when ProcessWire has the features either built-in or readily available. And should you have any questions the support forum is the place to be.2 points
-
I left this for a while, and have just come back to it. @BitPoet That creates the user okay, but doesn't allow to change the name, email, pass etc (in my testing anyway), it just created the user with today's date and time. For anyone who is interested, this is my solution. $u = $pw2->wire(new User()); $u->of(false); $u->name = $username; $u->email = $email; $u->pass = $password; $u->addRole("client"); $u->admin_theme = ("AdminThemeUikit"); $u->save(); $u->of(true); Credit from2 points
-
If you and your site editors have fixed IP addresses you could use mod_rewrite to redirect away from the Admin page based on IP address. In .htaccess, after RewriteEngine On # Define allowed IP addresses RewriteCond %{REMOTE_ADDR} !^111\.111\.111\.111 RewriteCond %{REMOTE_ADDR} !^222\.222\.222\.222 # Adjust to suit the name of your Admin page RewriteCond %{REQUEST_URI} ^/processwire/ # Redirect to home page. Use 302 redirect until finished testing. RewriteRule ^ / [L,R=301]2 points
-
I think this is totally justified. The amount of data that is being stolen these days is just crazy, and it has real impacts on real people. One of the worst incidents to date is the Equifax hack: https://en.wikipedia.org/wiki/Equifax#May.E2.80.93July_2017_data_breach John Oliver did a good piece on it: Automatic encryption just has to become the new normal, and I'm confident it won't be that big a deal to implement once the code wizards out there turn their minds to the challenge.2 points
-
Just wanted to share what I recently used to create forms in modules and in frontend using the API and Inputfield modules PW provides and uses on its own. I think many newcomers or also advanced user aren't aware what is already possible in templates with some simple and flexible code. Learning this can greatly help in any aspect when you develop with PW. It's not as easy and powerful as FormBuilder but a great example of what can be archieved within PW. Really? Tell me more The output markup generated with something like echo $form->render(); will be a like the one you get with FormBuilder or admin forms in backend. It's what PW is made of. Now since 2.2.5~ somewhere, the "required" option is possible for all fields (previous not) and that makes it easier a lot for validation and also it renders inline errors already nicely (due to Ryan FormBuilder yah!). For example the Password inputfield already provides two field to confirm the password and will validate it. De- and encryption method also exists. Or you can also use columns width setting for a field, which was added not so long ago. Some fields like Asm MultiSelect would require to also include their css and js to work but haven't tried. Also file uploads isn't there, but maybe at some point there will be more options. It would be still possible to code your own uploader when the form is submitted. Validation? If you understand a little more how PW works with forms and inputfields you can simply add you own validation, do hooks and lots of magic with very easy code to read and maintain. You can also use the processInput($input->post) method of a form that PW uses itself to validate a form. So getting to see if there was any errors is simply checking for $form->getErrors();. Also the $form->processInput($input->post) will prevent CSRF attacks and the form will append a hidden field automaticly. It's also worth noting that processInput() will work also with an array (key=>value) of data it doesn't have to be the one from $input->post. Styling? It works well if you take your own CSS or just pick the inputfields.css from the templates-admin folder as a start. Also the CSS file from the wire/modules/InputfieldRadios module can be helpful to add. And that's it. It's not very hard to get it display nicely. Here an code example of a simple form. <?php $out = ''; // create a new form field (also field wrapper) $form = $modules->get("InputfieldForm"); $form->action = "./"; $form->method = "post"; $form->attr("id+name",'subscribe-form'); // create a text input $field = $modules->get("InputfieldText"); $field->label = "Name"; $field->attr('id+name','name'); $field->required = 1; $form->append($field); // append the field to the form // create email field $field = $modules->get("InputfieldEmail"); $field->label = "E-Mail"; $field->attr('id+name','email'); $field->required = 1; $form->append($field); // append the field // you get the idea $field = $modules->get("InputfieldPassword"); $field->label = "Passwort"; $field->attr("id+name","pass"); $field->required = 1; $form->append($field); // oh a submit button! $submit = $modules->get("InputfieldSubmit"); $submit->attr("value","Subscribe"); $submit->attr("id+name","submit"); $form->append($submit); // form was submitted so we process the form if($input->post->submit) { // user submitted the form, process it and check for errors $form->processInput($input->post); // here is a good point for extra/custom validation and manipulate fields $email = $form->get("email"); if($email && (strpos($email->value,'@hotmail') !== FALSE)){ // attach an error to the field // and it will get displayed along the field $email->error("Sorry we don't accept hotmail addresses for now."); } if($form->getErrors()) { // the form is processed and populated // but contains errors $out .= $form->render(); } else { // do with the form what you like, create and save it as page // or send emails. to get the values you can use // $email = $form->get("email")->value; // $name = $form->get("name")->value; // $pass = $form->get("pass")->value; // // to sanitize input // $name = $sanitizer->text($input->post->name); // $email = $sanitizer->email($form->get("email")->value); $out .= "<p>Thanks! Your submission was successful."; } } else { // render out form without processing $out .= $form->render(); } include("./head.inc"); echo $out; include("./foot.inc"); Here the code snippet as gist github: https://gist.github.com/4027908 Maybe there's something I'm not aware of yet, so if there something to still care about just let me know. Maybe some example of hooks could be appended here too. Thanks Edit March 2017: This code still works in PW2.8 and PW3.1 point
-
Hello, Upon reading these articles https://dev.to/maxlaboisson/an-introduction-to-api-first-cms-with-directus-open-source-headless-cms-9f6 https://snipcart.com/blog/jamstack-clients-static-site-cms I was thinking that PW can be used for a Jamstack or Headless CMS with no changes at all. You can easily create REST Api with PW or use the GraphQL module https://github.com/dadish/ProcessGraphQL So ProcessWire is an Open Source Headless CMS since 20101 point
-
Are there already European developers implementing GDPR in their websites ? The European regulation will be obliged by 28/05/2018. What is it? https://www.eugdpr.org https://en.wikipedia.org/wiki/General_Data_Protection_Regulation It will be obliged to encrypt all personal data fields (name, email, phone, address, ... ) from users, and communicate about it. It would be interesting to implement an encryption setting for fields, just like the password field. That way all data in a database will be useless, unless you have a decryption key. I Think it's some stuff to think about, too meet the European regulation and to make Processwire even more secure.1 point
-
I like to showcase my new website acniti on the forum here. History Building and managing a website is a hobby, over the years, making websites got more complicated and more technologies, knowledge and wisdom are required. I started building my first website around 1997. It started out with a static site built with FrontPage, a WYSIWYG HTML editor. A few years later it was time for the first content management system, I looked at Joomla but settled for MediaWiki. I run those websites for 2 years on the MediaWiki platform and then moved on to WordPress. WordPress was good, it did a good job but over time, it became more complicated to make something out of the box, if it's not a blog, it becomes complicated and to have a feature rich website requires a lot of plugins. Little by little it became less fun and more and more hassle juggling the various plugins. In 2014 I became interested in learning PHP programming, I wanted to do this already for many years, but never had enough time to bite the bullet and work my way through the basics. At the end of the courses I though and now what have I learned, how to put this into action? To built modern website with PHP only is difficult, it also requires knowledge of html, MySQL, CSS, java-script etc. I started looking for a framework experimented a little with CakePHP and then came across Processwire via a CMS Critic blog post. Development setup I developed the acniti website on a Linux Ubuntu 16, with PHP 7 and MySQL as the development server. For the IDE I use PhpStorm, before using Storm I have used and tried some other IDE's such as Zend, Eclipse, Netbeans, Aptana but none of them I liked, some were feature poor, Zend and Eclipse were slow and use a lot of memory. PhpStorm not free but definitely worth the investment. I make use of the free tier Git repository of AWS called CodeCommit, I still use GIT Cola to commit the changes, I could also use PhpStorm for this but I never took the time to change my workflow. For project management I am a big fan of Redmine, Redmine is a web-based open-source project management and issue tracking tool. I use this also for my other work so it easily integrates with the website building flow as well. It's easy for maintaining lists of features you want to carry out per version, it supports a wiki which is easy for making notes and keeping a log of the activities. I use it everyday and it runs on Ruby. For images and graphics I switch back to Windows for some Photoshop. Processwire The acniti website runs on the latest stable Processwire version at the time of writing 3.0.62, the website has 4 languages including an Asian language. The Japanese language URL's are implemented with their 3 alphabets kanji, hiragana, katakana i.e. https://www.acniti.com/ja/インレットフィルタ. Some images on the site have text and image language tags help to select the correct language, the Processwire blog post from 30 June was helpful to get this running. The main site has a bootstrap theme, for the mobile version of the site the google AMP specification is implemented. This was really fun to do but challenging at times as the AMP specification is still a little limited. To visit the AMP pages type /amp/ behind any URL like https://www.acniti.com/amp/ for the homepage. The Google webmaster portal is really easy to troubleshoot and check for the correct AMP implementation. Finally structured data according to schema.org is added to the site via the JSON-LD markup. The commercial modules ProCache and Formbuilder are installed. The ProCache module is really amazing and makes the website lightning fast. Besides the commercial modules around eleven open-source modules are used, Database Backups, Tracy Debugger, Wire Mail SMTP, Protected Mode, Batcher, Upgrades, PublishAsHidden, URL (Multi-language), Twitter Feed Markup, Email Obfuscation (EMO), Login History, Selector test. During development the Processwire forum is really helpful and checked often. The forum is good for two reasons, most of the questions, I had during development of the site, are already on the site. Secondly the only 6 questions I posted over the last 2 years, are quickly and accurately answered. The downside I didn't become a very active member on the forum but see that as a compliment. An open issue on the acniti site is the AMP contact form with Formbuilder, the restricted usage of java-script for the AMP specification requires some more in-depth study. Hosting setup For the hosting services the acniti site uses Amazon EC2, I use AWS already many years to manage my cloud office so it was easy to decide to use it for the web hosting as well. The site is running on a micro instance of EC2 and with the ProCache module CloudFront is serving webpages worldwide fast. Updates from the development server are sent to CodeCommit and from there to the production server. From a site management point of view it would be nice to use AWS RDS to manage the MySQL databases, but from a cost perspective I decide not to do that for now. Via a cron I have set up automatic MySQL backups and these are via another cron job uploaded to AWS S3. To make sure the server is safe, a cron job runs daily snapshots of the server, this is getting initiated via AWS Lambda. Lambda also removes older snapshots because during creation a delete tag is attached for sevens days after their creation. It's important to make a separate MySQL backup as with snapshots the database often gets corrupted and its easier to restore a database backup than to fix a corrupted database. Another nice feature to use AWS Lambda for is a simple HTTP service health checker, which reports to you by email or sms when the website is down. Making use of all these Amazon services cost me probably somewhere between 10 - 15 $ a month, I have to estimate a little since I am running a lot more things on AWS than only the website. The site is running on a Comodo SSL certificate but next year I will change to the free LetsEncrypt, as it is easier to add and will automatically renew after 90 days. The Comodo certificate requires manually copy pasting and editing the certificates in place. Writing Content The content for the site I write in the Redmine wiki, most of the content I write requires research and it takes about two weeks before I publish the content to the Processwire site. For writing content I use the google spell checker with the grammar checker, After the Deadline. To ensure catchy headlines they are optimized with the Headline Analyzer from CoSchedule Social Media Now the site is running, it needs promotion. The robots.txt files shows the search engines the way as does the sitemap.xml both of these I have made in a template file. Most of the blog articles I promote are republished on social networks like, LinkedIn, Tumblr, Google+, Twitter, and some branch specific networks as the Waternetwork and Environmental XPRT. To check, the search engines index the site well, Google webmaster and Bing webmaster check for any problems with the site. For statics on the same server there is an instance installed of Piwik. Piwik is a leading open alternative to Google Analytics that gives full control over data. The Piwik setup works very well and gives a good overview of the site usage both on the desktop via the site or via a mobile app. As a part of a test I have installed the open-source SEO-panel on the same server to manage keywords and to further improve the scores in the search engine, a nice feature is that you can also track your competitors. I am still new to SEO panel and have to learn more how to use the tool effectively.1 point
-
Actually check here how you can easily do it.1 point
-
Hi Robin, thanks for your reply. I think it‘s exactly what I‘m looking for. I will try it in the next few days... Thanks, Robert1 point
-
v0.0.4 released - adds support for the new password field option that requires the old password to be entered.1 point
-
Best and fastest diff+sync tool ever . Period Windows, Mac or Linux Monday, November 27th only. Applies to new licenses and upgrades: https://www.scootersoftware.com/shop.php?zz=shop_promo https://www.scootersoftware.com/features.php?zz=features_list I'm waiting for it...1 point
-
I have some subtle issues between my dev environment (OS/X) and my production environments (Unix Hosted). I always suspected the subtle difference between the 2 file systems (1 is semi strict on spelling, the other is super strict) that could be a potential contributor. Have you looked out for any subtle spelling mistakes, case changes or encoding changes that could be contributing to this?1 point
-
1 point
-
Hi everyone, Relatively major new version just released: 1) New run on init, ready, finished option in Console panel I am not sure how popular this will be, but it lets you inject code from the Console panel into the PW process at init, ready, or finished. This lets you test hooks and other code that you would normally add to the init.php, ready.php, or finished.php files without having to edit files, and also without affecting anyone else viewing or working on the site. This screenshot should give you the idea: As you can see, I have added a hook to change the page title on saveReady. The way it currently works is that you: enter your code click Run to "register" the code for the next page request select "init", "ready", or "finished" as the place to have it injected In this example, you would then save the current page and the hook would be injected into init() and the page title will change If you don't switch back to "off" when you are done testing, it will expire in 5 minutes. The Console panel icon will also change to a red color to provide a visual indicator that you have an injection running on each page request. Please give me feedback on this feature - if you guys are annoyed by having those options visible and you never plan on using this, I'll make it an option that can be turned off completely. 2) Make User Switcher available without setting to "DEVELOPMENT" mode When I initially built the User Switcher I was a little paranoid about the possible security implications so went a little overboard by making it only available when hardcoded to DEVELOPMENT mode. But in reality this didn't make any difference and just made it more difficult to use, so now you'll find it easier to use - it's such a great feature! If you haven't used it, give it a go! 3) Options to hide debug bar from Form Builder iframe Having the debug bar in a Form Builder iframe can be useful, but also a visual annoyance so now you can disable if you want. 4) Hide User Bar from Form Builder iframe This is automatic as there is no reason for the User Bar to appear in a Form Builder iframe and it is confusing for users and ugly. 5) Restricted panels now works with "tracy-restricted-panels" role as well as permission (needed due to recent PW core change) Due to a recent change in the PW core, it is no longer possible to edit the permissions for the superuser role, so I have now added support for assigning a "tracy-restricted-panels" role to a user. The "Restricted Panels" defined will then be applied to users with this role. The permission option will continue to work for other non-superusers. 6) ACE editor update 7) Other bug fixes / tweaks1 point
-
@msavard have you seen this post? https://processwire.com/talk/topic/3706-how-to-blockredirect-one-user-role-away-from-admin-pages/?do=findComment&comment=46421 Also, there are these modules: http://modules.processwire.com/modules/auth2-factor-ppp/ http://modules.processwire.com/modules/session-login-alarm/1 point
-
This sounds familiar: https://www.magnolia-cms.com/blogs/christopher-zimmermann/detail~&hybrid-headless-cms~.html.1 point
-
I upgraded jQuery from 1.8.3 to 1.12.1, jQuery UI from 1.10.4 to 1.12.1, datepicker.js from 1.6.1 to 1.6.3 and updated longclick.js from 0.3.2 to 0.4.0 and it works just fine (after few quick tests). Then I tried jQuery 3.2.1 and jQuery Migrate 1.4.1 and it's working too (Migrate is required). jQuery 1.8.3 is released in november 2012. It's nothing wrong with that old version, but it just doesn't fit in the incoming new stable version of PW...1 point
-
PulsewayPush Send "push" from ProcessWire to Pulseway. Description PulsewayPush simply send a push to a Pulseway instance. If you are using this module, you probably installed Pulseway on your mobile device: you will receive notification on your mobile. To get more information about Pulseway, please visit their website. Note They have a free plan which include 10 notifications (push) each day. Usage Install the PulsewayPush module. Then call the module where you like in your module/template code : <?php $modules->get("PulsewayPush")->push("The title", "The notification message.", "elevated"); ?> Hookable function ___push() ___notify() (the two function do the same thing) Download Github: https://github.com/flydev-fr/PulsewayPush Modules Directory: https://modules.processwire.com/modules/pulseway-push/ Examples of use case I needed for our work a system which send notification to mobile device in case of a client request immediate support. Pulseway was choosen because it is already used to monitor our infrastructure. An idea, you could use the free plan to monitor your blog or website regarding the number of failed logins attempts (hooking Login/Register?), the automated tool then block the attacker's IP with firewall rules and send you a notification. - - - 2017-11-22: added the module to the modules directory1 point
-
Do you mean you want to get the current day of the week and use it in the selector? Maybe this is what you want: $day = date('l'); $events = $pages->find("template=weekly-event, day_in_week=$day'");1 point
-
Maybe I miss-understanding, but you have a day_in_week field, what kind of field is this? Before I can answer the question, as this changes the way you can achieve this. For example if it's just text you can do: $events = $pages->find("template=weekly-event, day_in_week=Monday");1 point
-
hm.. ok i get the point when we are talking about the pagefield in general i agree that it can be limited at some point. i connected it to my datatables module to get a filterable, paginated list of selectable options: but in this case i'm only browsing many pages... i've never had the need to reference a lot of pages in a pagefield. can you give me some examples when you needed this @Robin S ?1 point
-
Hi @gregory Take a look at this https://processwire.com/api/multi-language-support/code-i18n/#translatable-strings and https://processwire.com/api/multi-language-support/ and also we have new Pro Functional field that might suit your needs. https://processwire.com/blog/posts/functional-fields/1 point
-
ProcessWire is even more, it has capabilities to be a conventional CMS with highly configurable Administration Interfaces, Templatesystem, Database Mangement/ Access and render tools for the output of dynamic markup headless CMS providing content data via API (JSON, GraphQL) and optionally static HTML + JavaScript (HUGO/ Jekyll) WAF (Web Application Framework) a platform to build a headless CMS or other App/ SaaS on top of fit Make your choice!1 point
-
I'd say that technically ProcessWire probably isn't a headless CMS – but it can of course be used as one, and quite effectively for that matter ProcessWire is very much a border case, but my impression is that if you can build a front-end with(in) a CMS, it's no longer strictly speaking a headless CMS. And you can build a front-end with ProcessWire. Sure, you interact with an API, but it's a "local" or "in-app" API, not (only) an external one. Hope that makes sense. And, mind you, I'm not saying that ProcessWire is worse than a "real" headless CMS – in fact I'd argue that it's a better choice for many use cases, but that's obviously up to debate1 point
-
Maybe I don't fully understand the term headless, but I would have thought that PW is ALWAYS headless, even with our typical way of using the API. Surely headless doesn't just mean delivery via JSON etc, but rather simply no forced output. I have used PW in the "regular" way for websites, but also as a JSON source for SPA web apps and mobile apps. In my mind, these are all headless, but maybe I I still don't get it, or maybe that is actually what you are saying anyway1 point
-
Thanks @abdus Relating to the topic, there are other code snippets lurking in the Forum, like: Have a different title of a field across multiple templates? Hook to hide inputfield in Admin Custom Field in Page SettingsTab Remove a fieldset tab from specific pages of a template1 point
-
I have setup two websites, A and B. A can read pages from B using the multi-instance API. But how do I get A to save a new page to B? I have this simple test setup: $path = "C:/Users/Marc/Documents/development/www/siteB/"; $url = "/siteB/"; $siteB = new ProcessWire($path, $url); $np = new Page(); $np->template = "my-template"; $np->parent = $siteB->pages->get('/forms/'); $np->title = 'test multi-instance form'; $np->save(); The page is saved to site A instead of B, with no parent. Is this a case of saving it to the wrong instance? If so, how do I save it to the correct instance (site B)?1 point
-
Another option would be: $page = $siteB->wire(new Page());1 point
-
Hi @Marc Not tested $siteB = new ProcessWire($path, $url); $siteB->pages->add('skyscraper', '/skyscrapers/atlanta/', [ 'title' => 'Symphony Tower', 'summary' => 'A 41-story skyscraper located at 1180 Peachtree Street', 'height' => 657, 'floors' => 41 ]); https://processwire.com/api/ref/pages/add/1 point
-
Here's a short snippet for site/ready.php that hooks after ProcessPageEdit::buildForm and moves a regular field (named "testfield here") from the Content tab to Settings. The methods used are from the InputfieldWrapper class. <?php wire()->addHookAfter("ProcessPageEdit::buildForm", null, "moveFieldToSettings"); function moveFieldToSettings(HookEvent $event) { $form = $event->return; $field = $form->find("name=testfield")->first(); if($field) { $settings = $form->find("id=ProcessPageEditSettings")->first(); // Alternatively, find a specific field to insert before/after: // $settings = $form->find("name=template")->first(); if($settings) { $form->remove($field); $settings->append($field); // In the alternative, insert before or after the found field: // $form->insertBefore($field, $settings); } } }1 point
-
Hi @Roman Schmitz - sorry about that! I will commit a fix a little later (I want to clean up some other stuff while I am at it), but for now please change: https://github.com/adrianbj/FieldtypePhone/blob/56ec89e7fc81cdc693ce72f9f9030edf3f49bd63/FieldtypePhone.module#L159 to: if($value['data_extension'] != '') $pn->extension = wire('sanitizer')->text($value['data_extension']);1 point
-
I have a problem with the " Extension-Field". I can not save a single "0" as extension. When i enter a single 0 and save the page the field is empty. Any other number works as expected even when i enter "00" but a single "0" is not saved. Here in germany many phonenumbers use a single "0" as extension: Example: Phone: +49 (421) 123456 - 0 Fax: +49 (421) 123456 - 11 point
-
Rather than trying to hack the url for file_get_contents, you should use ->filename instead and then you can just do: file_get_contents($page->icon->filename);1 point
-
kongondo beat me it may seem complicated in the beginning, but once you get the concept it's really easy and straightforward. you just have to look a bit into the code to know what is going on behind the scenes. take my code example, it's easy: // attach a hook whenever a page edit form is built // this happens in the class "ProcessPageEdit" in method "buildform" // see github how this method looks like: https://github.com/processwire/processwire/blob/master/wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module#L588-L595 $this->addHookAfter('ProcessPageEdit::buildForm', function($event) { // $event is the hookevent object; it holds all necessary data to execute all kinds of actions // https://github.com/processwire/processwire/blob/master/wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module#L591 // here you see that the method gets 1 parameter and this parameter is the form, so if you want to get this form just do this: $form = $event->arguments(0); // to get the field of your form just do the following // see https://github.com/processwire/processwire/blob/master/wire/modules/Inputfield/InputfieldForm.module // or https://processwire.com/talk/topic/2089-create-simple-forms-using-api/ $field = $form->get('yourfieldname'); // now we want to do something based on the page that is edited // that is a bit different than in template context because we are VIEWING an admin page, whereas we are EDITING a different page // we want to know the template of the EDITED page, so let's get it... // $event->object is the class where the hook is attached. in our case "ProcessPageEdit" // to get the edited page this class has an own method: https://github.com/processwire/processwire/blob/master/wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module#L2009-L2019 $page = $event->object->getPage(); if($page->template == 'template_a') $field->label = "this is field label on template a, it is " . date("d.m.Y H:i:s"); elseif($page->template == 'template_b') $field->label = "this is field label on template b, it is " . date("d.m.Y H:i:s"); else $field->label = "other template, it is " . date("d.m.Y H:i:s"); });1 point