Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/22/2017 in all areas

  1. Let's focus on solving the problem without making too many assumptions.
    6 points
  2. I am glad that this project is helping ProcessWire getting more devs on board :). I just want to say that I wouldn't have been able to finish ProcessVue if it wasn't for the amazing ProcessWire community. I believe that the community truly is the biggest selling point for new users (like me). Before trying ProcessWire I used OctoberCMS for a while but when I was stuck I got 0 support from the forums, so...althought the CMS is based on the amazing Laravel framework, I just left! I think that ProcessWire is extremely powerful and flexible and with time will become the tool of choice for frontend developers, the new GraphQL module will also help on this direction. Droves of frontend developers are looking for a CMS like this, they just don't know it exists! The usual keywords they use when looking for a SPAs CMS is "Decoupled CMS" or "Headless CMS", and I believe that that's exactly what ProcessWire is for! Some frontend developers prefer to use NodeJS, but the learning curve is huge if you need it for a non trivial project, and the worst thing of all is that after two weeks ANY js tool you may have used is outdated. See for example how Angular has been replaced with React or Vue, and Gulp with Webpack. That doesn't mean that I am against improvements in this regard, I just feel that it's just too much for us poor frontend devs to cope with! ProcessWire is stable, easy to use and won't change API every week. BTW, after that I migrate ProcessVue to GraphQL I am also planning to add Auth0 login integration with JWT, as I think that login/signup is a common feature in SPAs. I am sure I'll have to annoy @Nurguly Ashyrov and the rest of ProcessWire community for getting it in sync with ProcessWire users, but the result should be quite useful
    5 points
  3. "Everything has to be a thing, even if you don't use it as a thing"
    4 points
  4. The most UAs, regarding your screenshot, are a Facebook Browsers: FB_IAB/FB4A So, you first should check why / which Facebook-Apps are polling your site, and if they properly send session-cookies with each following request, or if they open a new session with every poll.
    3 points
  5. The person who marked this as CON did not understand Processwire... And they left out the same in the case of WordPress: "Everything has to be a 'custom post' even if you don't use it as a post". Same for Drupal: "Everything has to be a 'node' even if you don't use it as a node" This is just the chosen terminology, so the person who made it up does not understand too much
    3 points
  6. If you do not assign a title the autogenerated ID (Inputfield) will be taken. $inputfields->attr('title', 'Weird name'); To put the Inputfields (Tabs) in the right order you could use InputfieldWrapper::insertBefore() or InputfieldWrapper::insertAfter() instead of InputfieldWrapper::add(). Unfortunately this doesn't work in case of ProcessPageEdit. To get it working you need to add another hook to ProcessPageEdit::getTabs() The following code snippet should work. Place it in your /site/ready.php wire()->addHookAfter('ProcessPageEdit::buildForm', function ($event) { $page = $event->object->getPage(); if ($page->template == "bewerbung") { $form = $event->return; $inputfields = new InputfieldWrapper(); $inputfields->attr('title', 'Weird Name'); $inputfields->attr('name+id', 'WeirdTabNameAndId'); // we need both unique ID and Name $markup = wire()->modules->get('InputfieldMarkup'); $markup->label = 'Custom Lable'; $markup->value = '<p>Just a placeholder for any custom markup</p>'; $inputfields->add($markup); $pageEditTab = $form->find('id=ProcessPageEditContent')->first(); $form->insertAfter($inputfields, $pageEditTab); // inserting in the right place is not enough to set the tab order // we need the following hook wire()->addHookAfter('ProcessPageEdit::getTabs', function ($event) { $event->return = array_merge( array_slice($event->return, 0, 1, true), array('WeirdTabNameAndId' => __('Weird Name')), // should be identical to the weird name/title above array_slice($event->return, 1, null, true) ); }); $event->return = $form; } });
    3 points
  7. The person who marked this as CON did not understand Processwire...
    3 points
  8. For ages I used an admin helper module to do this. I finally decided to try this module, and whaddya know — works like a charm. Thanks Adrian!
    2 points
  9. The world is a sum of all its things.
    2 points
  10. Everything has to be something!
    2 points
  11. @kixe Your solution works perfectly fine. Thank you a thousand times Kudos! Thanks to @adrian as well.
    2 points
  12. PW #1 on Slant - never heard of Slant and none of the CMS options have many votes yet, but still https://www.slant.co/topics/5409/~php-cms
    2 points
  13. Hi @microcipcip - thanks for a really great commentary on PW, what frontend devs are looking for, and how PW can fit those needs. I am really excited to see your integration of GraphQL into your ProcessVue site profile - definitely planning on using it on an upcoming project. Thanks again for all your great work on this.
    2 points
  14. Hey AndreaPT, Do you have superuser access to the admin? Do you have FTP access to the server (or via a cPanel file manager type interface). Let me know about those and I'll see what I can do to put you on the easiest track to make the changes you need.
    2 points
  15. Hi all, My first – hopefully useful – ProcessWire related tutorial: http://szabesz.hu/blog/install-processwire-in-a-subfolder-on-shared-hosting-cpanel_ins-sub/
    2 points
  16. This module adds CSV import and export functionality to Profields Table fields on both the admin and front-end. http://modules.processwire.com/modules/table-csv-import-export/ https://github.com/adrianbj/TableCsvImportExport Access to the admin import/export for non-superusers is controlled by two automatically created permissions: table-csv-import and table-csv-export Another permission (table-csv-import-overwrite) allows you to control access to the overwrite option when importing. The overwrite option is also controlled at the field level. Go to the table field's Input tab and check the new "Allow overwrite option" if you want this enabled at all for the specific field. Please consider limiting import overwrite option to trusted roles as you could do a lot of damage very quickly with the overwrite option Front-end export of a table field to CSV can be achieved with the exportCsv() method: // export as CSV if csv_export=1 is in url if($input->get->csv_export==1){ $modules->get('ProcessTableCsvExport'); // load module // delimiter, enclosure, file extension, multiple fields separator, names in first row $page->fields->tablefield->exportCsv('tab', '"', 'tsv', '|', true); } // display content of template with link to same page with appended csv_export=1 else{ include("./head.inc"); echo $page->tablefield->render(); //render table - not necessary for export - just displaying the table echo "<a href='./?csv_export=1'>Export Table as CSV</a>"; //link to initiate export include("./foot.inc"); } Front-end import can be achieved with the importCsv() method: $modules->get('TableCsvImportExport'); // load module // data, delimiter, enclosure, convert decimals, ignore first row, multiple fields separator, append or overwrite $page->fields->tablefield->importCsv($csvData, ';', '"', true, false, '|', 'append'); Please let me know if you have any problems, or suggestions for improvements. Enjoy!
    1 point
  17. FieldtypeFileS3 https://github.com/f-b-g-m/FieldtypeFileS3 The module extends the default FieldtypeFile and InputfieldFile modules and adds few extra methods. For the most part it behaves just like the default files modules, the biggest difference is how you get the file's url. Instead of using $page->fieldname->eq(0)->url you use $page->fieldname->eq(0)->s3url(). Files are not stored locally, they are deleted when the page is saved, if page saving is ommited the file remains on the local server until the page is saved. Another difference is the file size, the default module get the file size directly from the local file, while here it's stored in the database. There is an option to store the files locally, its intented in case one wants to stop using S3 and change back to local storage. What it does is it changes the s3url() method to serve files from local server instead of S3, disables uploading to S3 and disables local file deletion on page save. It does not tranfer files from S3 to local server, that can be done with the aws-cli's through the sync function. Files stored on S3 have the same structure as they would have on the local server. -------------------------------------------------------- -------------------------------------------------------- Been struggling with this for quite a while, but i think i finally managed to make it work/behave the way i wanted. All feedback is welcome!
    1 point
  18. Since I'm doing a lot of detailed logging in our internal PW-based systems, that has become a bit of a bottleneck under heavy load and I was missing a centralized view with the growing number of separate PW instances. So I dug into the core a bit, namely WireLog.php and FileLog.php as well as ProcessWire.php. I managed to whip up my own WireLogDatabase and DbLog classes mimicking the behaviour of the regular logging classes, but not without a little bit of tweaking to the ProcessWire class itself to replace the regular logger. Now I'm logging to a MySQL server instead of plain files and ProcessLogger works smoothly with it without tweaking. I thought it would be shame to keep this all to myself, but a release-worthy version would need or could benefit from: a bit of polishing in regards to error handling and proper treatment of conflicting concurrent operations without too much lock overhead (drop table vs. insert especially) more source code documentation a little more abstraction so all csv operations are deprecated in favor of database columns where avaible last but not least, an approved way to configure the substitute logger and load it early on, which means touching the core ProcessWire class Before I invest too much into that, I'd love to hear all thoughts on this, especially if you think such a module may fit your requirements, and I would be especially happy to hear from @ryan - could you see such a mechanism in the core?
    1 point
  19. Introducing Variations, an Input- and Fieldtype for product variations and their attributes. Product variations is a topic that has been coming up now and then, especially in the recent past. This module seeks to fill this gap. Though it's in its early stages of development, it is already functional and can be used as is. I decided to make an early announcement (modules development forum) in order to get early feedback from potential users. The module is an alternative take on how variations can be built for a product. Imagine the ubiquitous T-Shirt. The product could vary by ...Size, Colour, Material, etc...These variations could in turn have internal variations, i.e. attributes....so, Size [Small, Large], Colour [Red, Blue]...etc; you get the drift. The usual approaches to building variations have been either to use Multiple pages, Repeaters, Page Table, Table or Matrix (limited to 1x1 variations). In this module, we do it a bit differently. First, the variations occur not at the Field level (meaning all product pages would have the same variations and attributes for each template) but at the page level. Secondly, there are no multiple pages for each variation and/or attributes; a product is a single page. The variations and their attributes are defined by site editors at the page level. Once a variations configuration has been defined, it is applied to the page and all possible combinations are generated (i.e. the Red,Small,Cotton; Red,Large,Cotton, etc) in the Inputfield. There is no limit to the number of variations and attributes that can be defined, although you will be amazed at how quickly the combinations grow! Prices are entered for each combination when editing the page. Combinations without prices are not saved to the database. Please note that prices cannot themselves vary at the page-level. Meaning, you cannot have ONE variation configuration that has different price inputs per product in the same FieldtypeVariations field. The module ships with an API for outputting variation combinations in the frontend. Search, database and in-memory work as normal in the frontend. In the backend, DataTables provides a nice paginated, filterable table. Prices can be entered on any pages (of the table) without loss of data (meaning you can enter prices on page 1, scroll to page 10, enter more prices, filter or search the products table, enter more prices and finally save; no data will be lost). I still have a couple of ideas and plans pending but would love to hear from you, thanks. Below is a short video demo of the module in its current state. Things may/will change, both UI and features. Btw, the Fieldtype, although primarily targeted at commerce applications, is by no means limited to this. Other uses requiring combinations of whatever number of variables are very much within the remit of the module. Planned/Hoped for features Import/Export product variations and attributes (Excel, etc) Full integration with Padloper (I will have to discuss with @apeisa) SKU fields for each product variation Add/Remove extra subfields, e.g. multi-currency prices (currently there is only 1 input for each product variations' price) Product variation images? Etc... Please not this module is not related to this other planned module (but it may eventually). Sneak Peek Demo
    1 point
  20. Thanks @rick I get what you meant. I use if sendMe=1 for validation on submission of my contact form. The input submit code in this post is a different site where I'm filtering buildings on a page (after form submit). I literally just got into manually creating forms a week or so ago (I used to use a Drupal module for this). I took that for granted, but I've learned so much in the past two days building this small test site, it's been well worth it. Used str_replace, rtrim, strtolower, in_array, learned about creating/adding to/looping php arrays, differences between post and get, getting input after form submissions, building PW selectors from dynamic data. Been a great couple of days! Finally graduating to more dynamic things now.
    1 point
  21. Your post variable for the button is sent as, sendMe=1, whereas the input field is sent as, submit=Search. You can test the post variables and retrieve the values in order to perform whatever logic you require: IF sendMe == 1 THEN ..., or IF submit == 'Search' THEN ... I don't have access to the skyscrapers code at the moment, so I can't comment on the differences you are seeing. However, in general, all completed fields; hidden, input, options, arrays, whatever, have their field names and values posted back to the script defined in the action attribute of that form. The field names can be whatever name you want (allowed characters) and the values can be whatever you want. So my previous post was slightly incorrect, in that you don't need to 'change' the value (you can if you want), you only need to test that field's name for the value you expect then perform whatever task you want.
    1 point
  22. Czech Language Pack for PW 3.0 Pre-release version is online. Check it at github. https://github.com/PavelTajdus/ProcessWire-Czech-Language-Pack/releases
    1 point
  23. Hi guys, Czech lang pack is on github, and pre-release version for PW 3.0 will be uploaded soon. So you can download, test, update, and hopefully colaborate on Github. You will find all releases on GitHub repo. And again, thank you Radek for your work on this. We all really appreciate that.
    1 point
  24. The name is returned with the associated value assigned, as so: Change it to: name='submit' value='1'
    1 point
  25. @horst Thanks. Didn't know about that. Will have a look inside asap.
    1 point
  26. @Wanze any success on this?
    1 point
  27. I am sending the NEW version of Simple Contact Form. This new version uses module MarkupGoogleRecaptcha in order to render the captcha. If you have downloaded Valitron validator through composer then add the following line to your _head.php: include(dirname(__FILE__) . "/../../vendor/autoload.php"); or include the old-way on the top of "partials/contact/_controller.php": require(dirname(__FILE__) . "/../../vendor/vlucas/valitron/src/Valitron/Validator.php"); There are 3 files currently: contact.php (template) partials/contact/_controller.php partials/contact/_email.php First file contact.php: <?php namespace ProcessWire; include('partials/contact/_controller.php'); ?> <h2><?php echo __('Contact Form') ?></h2> <?php if($session->flashMessage):?> <div class="alert <?php echo $session->sent ? 'alert-success' : 'alert-danger'?>" role="alert"> <?php echo $session->flashMessage;?> </div> <?php endif;?> <form id="contact-form" action="<?php echo $page->url;?>" method="post"> <div class="form-group <?php echo $v->errors('name') ? 'has-error' : ''?>"> <div class="input-group"> <span class="input-group-addon"><i class="fa fa-user"></i></span> <input required class="input-lg form-control" name="name" id="name" type="text" value="<?php echo $name?>" placeholder="<?php echo __('Name') ?>"> </div> </div> <div class="form-group <?php echo $v->errors('email') ? 'has-error' : ''?>"> <div class="input-group"> <span class="input-group-addon"><i class="fa fa-envelope"></i></span> <input required class="input-lg form-control" name="email" id="email" type="email" value="<?php echo $email?>" placeholder="<?php echo __('Email') ?>"> </div> </div> <div class="form-group <?php echo $v->errors('phone') ? 'has-error' : ''?>"> <div class="input-group"> <span class="input-group-addon"><i class="fa fa-phone"></i></span> <input class="input-lg form-control" name="phone" id="phone" type="tel" value="<?php echo $phone?>" placeholder="<?php echo __('Phone') ?>"> </div> <div class="field-notice" rel="phone"></div> </div> <div class="form-group <?php echo $v->errors('message') ? 'has-error' : ''?>"> <div class="input-group"> <span class="input-group-addon"><i class="fa fa fa-quote-left"></i></span> <textarea rows="7" class="input-lg form-control" placeholder="<?php echo __('Message') ?>" name="message" id="message"><?php echo $message?></textarea> </div> </div> <div class="form-group"> <?php echo $captcha->render()?> </div> <button id="contact_send" class="btn btn-default" type="submit"><i class="fa fa-paper-plane" aria-hidden="true"></i> <?php echo __('SEND') ?></button> </form> <?php $session->remove('flashMessage'); $session->sent = false; echo $captcha->getScript(); ?> Then file partials/contact/_controller.php: <?php namespace ProcessWire; use Valitron\Validator; $captcha = $modules->get("MarkupGoogleRecaptcha"); $name = $sanitizer->text($input->post->name); $email = $sanitizer->email($input->post->email); $phone = $sanitizer->text($input->post->phone); $message = $sanitizer->text($input->post->message); $v = new Validator([ 'name' => $name, 'email' => $email, 'message' => $message, ]); $v->rule('required', ['name', 'email', 'message']); $v->rule('email', 'email'); $contactFormRecipient = 'your@company.com'; if ($input->post->name) { if ($v->validate()) { if ($captcha->verifyResponse() === true) { $subject = 'Contact Form'; $messageHTML = include_once('partials/contact/_email.php'); $mail = wireMail() ->to($contactFormRecipient) ->header('Reply-To', $email) ->subject($subject) ->bodyHTML($messageHTML); if ($mail->send()) { $session->flashMessage = __('Thank you for your message! We will get back to you.'); $session->sent = true; $session->redirect($page->url); } else { $session->flashMessage = __('Mail not sent. Error occured.'); } } else { $session->flashMessage = __('Recaptcha Validation Error'); } } else { $session->flashMessage = __('Please correct the errors and try again.'); } } ?> And finally partials/contact/_email.php: <?php ob_start();?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?php echo $subject; ?></title> </head> <body> <h1>New message from <i><?php echo $name; ?></i></h1> <p><?php echo $message; ?></p> <hr> <h3>Contact Info:</h3> <p><strong>Name:</strong> <?php echo $name; ?></p> <?php if(!empty($phone)):?> <p><strong>Phone:</strong> <?php echo $phone; ?></p> <?php endif;?> <p><strong>Email:</strong> <a href="mailto:<?php echo $email; ?>"><?php echo $email; ?></a></p> </body> </html> <?php return ob_get_clean();?> Hope you like it!
    1 point
  28. Not tested: http://modules.processwire.com/modules/inputfield-textarea-markup/
    1 point
  29. @jmartsch - you can see how I have done this in the BCE module when the editor interface is added in a new tab: https://github.com/adrianbj/BatchChildEditor/blob/4cd7f64e28d166b1f78eb02e83167cd7af031e87/BatchChildEditor.module#L374-L421
    1 point
  30. @jmartsch - I have a mostly working hack for you: $this->wire()->addHookAfter('Page::viewable', null, function (HookEvent $event) { if(!$event->return) return; $page = $event->object; if (strpos($_SERVER['REQUEST_URI'], "admin-actions") === false && $page->name == "admin-actions") { $event->return = false; } }); With this, non-superusers won't see the Setup > Admin Actions menu item unless they are already on an Admin Actions page, eg: http://mysite.dev/processwire/setup/admin-actions/options?action=CopyContentToOtherField I was trying to limit the return false to a specific process, but couldn't make it work as expected. Honestly, I feel like the right way to do this would be to ask Ryan to make: AdminThemeDefaultHelpers::renderTopNavItems (https://github.com/processwire/processwire/blob/35df716082b779de0e53a3fcf7996403c49c9f8a/wire/modules/AdminTheme/AdminThemeDefault/AdminThemeDefaultHelpers.php#L416) hookable, but without that, I think this is the best option, but maybe someone else has a better idea. PS - If you are running the Reno theme, it turns out that AdminThemeRenoHelpers::topNavItems is hookable. Might be a good argument for making it hookable in the Default and new UiKit themes as well. It think that approach would make this much easier.
    1 point
  31. Also check this code example where Ryan shows how to create pages using the API. It's pretty simple!
    1 point
  32. I don't have a code example for this, but if you look at these two modules by Ryan, you can do it: http://modules.processwire.com/modules/markup-rss/ http://modules.processwire.com/modules/rss-feed-loader/ And schedule the export/import with http://modules.processwire.com/modules/lazy-cron/ Also check this module: https://processwire.com/blog/posts/introducing-iftrunner-and-the-story-behind-it/#iftrunner-release
    1 point
  33. i guess the browser strips your form because it is inside the processwire form that contains all the inputfields and a form inside another form is not valid html. the inspector shows you the code after browser and javascript manipulations. if you view the raw sourcecode you maybe see your form element. http://stackoverflow.com/questions/555928/is-it-valid-to-have-a-html-form-inside-another-html-form
    1 point
  34. Sorry if it seems like I am hijacking this, but I used to be in the same boat - I would often use a "Testing" Hanna Code for testing code. Now I just use the Console Panel in Tracy - you can even save snippets that you use regularly. This might solve your problem without needing to hide codes from the HC Helper interface. If not, please excuse my interference
    1 point
  35. @Doc - the other option in Tracy is the ability to edit the page's template directly - you don't even need to post a different version: https://processwire.com/blog/posts/introducing-tracy-debugger/#template-editor-panel Just edit through the Tracy interface and click "Test". That will reload the page with the changes you have made without affecting how it looks/works for other users. Whether I use this or the Template Path Panel that tpr mentioned depends on the complexity of the changes I am making. The Template Path Panel option allows you to swap between various versions similarly to diogo's code, but through the Tracy debug bar GUI.
    1 point
  36. Database errors are always logged. You will find entry in your /site/assets/logs/errors.txt file 2017-03-18 16:05:27 ? http://example.org/?/ Error: Exception: SQLSTATE[HY000] [1049] Unknown database 'example' (in .../wire/core/ProcessWire.php line 375) Depending on your config.php settings an Email will be sent /** * Admin email address * * Optional email address to send fatal error notifications to. * * #input email * @var string * */ $config->adminEmail = ''; In case of fatal errors the following html file will be send <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html> <head> <title>500 Internal Server Error</title> </head> <body> <h1>Internal Server Error</h1> <p>The server encountered an internal error or misconfiguration and was unable to complete your request.</p> <p>{message}</p> </body> </html> You can modify it. You'll find the file (default installation) in /site/templates/errors/500.html
    1 point
  37. I am happy that you like it @Sebastian, thank you for your support. I started the thread here because I thought this would be more like a discussion on how GraphQL and ProcessWire could fit together and wanted to get some feedback first. But this thread quickly become this module's official place here in the ProcessWire forums. Also @teppo included the link to this thread as the "dedicated support forum thread" in the 143 issue of the weekly.pw (which I was flattered to see ). Now I don't really know how to go on with this thread. Should we abandon it and start new thread in the modules section? Or maybe this thread could be moved to modules section? What @moderators think of this? Meanwhile, for those who are following this thread I wanted to mention that there are some additions in the dev branch, such as mutations that allows you to create/update pages and there is also support for FieldtypeMapMarker field. I stopped developing the module for some time because I thought that it needed a good testing before moving further with it and decided to built an SPA using this module, to see if there is something that need to be added or changed. But then I got carried away and started to make usage of third-party APIs such as Wikipedia and GoogleMaps. As a result the app does not make heavy usage of the ProcessGraphQL module, but it is still relevant to showcase the module's abilities. It is a US Skyscrapers app, duh... You can see it live here and the source code here (though I doubt that the code will interest you if you are not a React developer). I was finished with this demo SPA just couple of days ago. Now I will be back to continue to work on this module again.
    1 point
  38. There is a monolog plugin for Tracy: https://componette.com/nextras/tracy-monolog-adapter/ so if you're already using Tracy for logging errors in production mode (no debug bar), this might be an option. If people are interested in that approach, I'd be willing to add. PS - @BitPoet - not meaning to take away from your approach - just throwing another option out there.
    1 point
  39. The most flexible version would probably be a monolog (or compatible) implementation, just because how ubiquitous it's in the php community and all it's adapters to various logging backends.
    1 point
  40. Hey, @microcipcip! I actually do not know if it is possible to do with the profile exporter via setting . Though I am sure it should be. Removing node_modules should be easy - you can do it before the export (or temporary prefix the folder with a dot ). Adding .config type files is probably only possible the way you suggest. But as I said I think all those things should be eventually possible to do with the module options, as it is very powerful way to share one's work in PW. Please list the issues you cannot overcome in the module support board or even better on github. Edit: Seems like a .file issue is already present. I am going to add my voice to it. Please do too if you think it deserves it.
    1 point
  41. Ooh, that's right. Now I get what you mean. Thank you for clarifying that for me. That's true, with this module it gets available to the public without echoing it explicitly. So you will have to setup extra permissions to make it closed to the guest user. This was the initial intention of this module really. The goal is to build a tool that will allow you to quickly bootstrap an AJAX api of your ProcessWire content to build SPA out of it. For cases like you guys describe, this module might have some drawbacks. But you could always cook your own GraphQL api and make it behave however you want. It's fairly easy after you learn a bit about it. Here is the library I use for this module.
    1 point
  42. Just wait for about an hour, and @adrian will extend it too Thank you, BTW!
    1 point
  43. Just to add to @kongondo's code, if your site is not in English, you may want to consider: $p->name = $sanitizer->pageName($p->title, true); You can read more about that sanitizer option here: https://processwire.com/api/ref/sanitizer/page-name/ or: $p->name = $sanitizer->pageNameUTF8($p->title); https://processwire.com/api/ref/sanitizer/page-name-utf8/
    1 point
  44. You might find the Page Rename Options module useful - you can set it to keep page names in sync with page titles when they change.
    1 point
  45. foreach ($pages->find('template=basic-page, limit=50') as $p) { $p->of(false); $p->title = "My New Title";// if using a new title...otherwise comment out this line $p->name = $sanitizer->pagenName($p->title); $p->save(); $p->of(true); } If renaming in the thousands let us know so that we can adjust the code...
    1 point
  46. support plain text string and string with html tag function _t($text, $context = 'general', $textdomain = '/site/templates/_strings.php') { return html_entity_decode(_x($text, $context, $textdomain)); }
    1 point
  47. I have installed this module however, I have some pages that are hidden from the navigation, in which I still want them added to the sitemap. I have added a checkbox field called sitemap. This field allows the user to add to the /sitemap page. Here is what I use for the sitemap template: foreach($page->children("include=hidden, sitemap=1") as $child) sitemapListPage($child); I need to do the same thing but for the sitemap module. I am having some trouble accomplishing this. Any help would be great.
    1 point
  48. try $hassidebar = array('home','project','projects','posts','partners'); if (in_array($page->template->name, $hassidebar) { //... } EDIT: adrian was quicker. Either of it should work.
    1 point
×
×
  • Create New...