Jump to content

Search the Community

Showing results for tags 'api'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

  1. I'm sorry if this is dumb question, but I've been trying to find out what gets executed each time PHP serves a page. The specific scenario is that I'm implementing a LazyCron hook and can put it multiple places - an autoload module, init.inc, site/ready.php, etc. It has a fair amount of logic to load that I'd prefer not be in every page. The only way I can see to prevent that code from being loaded and interpreted (not necessarily executed) is to create a special page for it and use a cron job to kick it off only in that page's template. It seems like ALL autoload modules, init.inc, main.inc, site/ready.php, etc. get loaded and interpreted every page load (unless init.inc is disabled for that template, etc.) So 1. does everything get loaded and interpreted every page load or is caching of code done in some way (not just the file)? 2. is there a better way to avoid loading significant amounts of code than associating it with a specific page? Let me know if this isn't clear.
  2. I'm trying to find all comments for a small group of pages using the API. The pages, in this case, all have the same author. I'm extending ProcessCommentsManager to accomplish this, by adding the following code at line 167 of ProcessCommentsManager.module (inside ___executeList()): $posts = $this->pages->find("template=post,author=" . $this->author); $selector .= ", pages_id=" . $posts; $selector, at this point, has the following value: start=0, limit=10, sort=-created, status=1, pages_id=4287|4304|4307|4314 And then we resume with the existing code at line 168: $comments = $field->type->find($field, $selector); However, I'm only getting comments for page #4287, the first one in the list. I've tried this with several data sets and it's always the same. Is there something about pages_id that doesn't like the usual pipe format for multiple values? Is there a better way to solve this problem? I'd also welcome feedback about whether this is generally a good approach to displaying comments only for certain pages.
  3. I need to write a lazy cron job that goes through a list of files and deletes those that are associated with expired sessions. Our session information is stored in the DB table sessions. Is there a Wire API call that allows me to do one of: 1) fetch all expired sessions? 2) hook the session expiration event? 3) fetch all active sessions? 4) do direct DB access to lookup sessions? (least preferred as I have to directly tie to session implmentation). My logic can either flow: Find active sessions delete files NOT in active sessions Get files if session_id associated with file NOT in sessions (or has expired) delete file.
  4. Hi all, I am using Processwire to synchronize Albums form a Facebook Page into Processwire. Works like a charm! I'm using two loops to synchronize the albums One loop that creates a page that stands for the "album" One loop that stores every image within the album as a child of the "album" I experienced that this loop however only synchronizes the first 25 images. I was wondering, is there any kind of limitation that comes with the page creation API? I used the following script as posted before by Ryan if I'm not mistaking $p = new Page(); $p->template = "fb_image"; $p->parent = $pages->get("name=$id"); $p->title = $hash; $p->name = $hash; $p->save(); $p->fb_image = $image["images"][0]["source"]; $p->save(); Hope someone has the answer!
  5. I have made the following module that automatically grabs images from Youtube and Vimeo URLs and adds them to an image field ('article_visual_snippet'). public function init() { $this->pages->addHookBefore('save', $this, 'getvideoimage'); } public function getvideoimage($event) { $page = $event->arguments[0]; $url = $page->article_snippet_video; if ($page->parent_id == 1023) { if (strpos($url, 'youtube') > 0) { parse_str( parse_url( $url, PHP_URL_QUERY ), $id ); $ytURL = 'http://img.youtube.com/vi/' . $id['v'] . '/maxresdefault.jpg'; if($page->article_visual_snippet->count() < 1){ $page->of(false); $page->article_visual_snippet = 'http://img.youtube.com/vi/' . $id['v'] . '/maxresdefault.jpg'; $page->save(); } } if (strpos($url, 'vimeo') > 0) { $id = substr( parse_url( $url, PHP_URL_PATH ), $id ); if($page->article_visual_snippet->count() < 1){ $page->of(false); $response = file_get_contents("https://vimeo.com/api/oembed.json?url=https%3A//vimeo.com$id"); $jsonobj = json_decode($response); $page->article_visual_snippet = $jsonobj->thumbnail_url; $page->save(); } } } } } It's all working perfectly but for one slight problem. The image field ('article_visual_snippet') is a required field and when the page is saved I get 'Missing required value' error even though the image has successfully uploaded to the field. Does anyone know how I can circumvent this error?
  6. I have just delivered this website: Into Nature (Dutch only), about an 'Art expedition' through the province of Drenthe, in The Netherlands. I built the site for Vandejong. The site is made using two distinct parts/techniques: Processwire for the back-end (through a RESTful json api) and the front-end is built on Ember.js. This is my third large site built this way, and the first I am completely happy about. A page called 'API' is the main interface between the two: it uses urlSegments and parses the content from the PW pages into Ember-friendly JSON data. As Ember is very strict (heavily based on the Convention over Configuration concept), and Processwire is extremely versatile, the way Ember requires its data dictates the way I shaped the API. Both @clsource's REST-helper and ProCache are used to format and cache the API responses, making the API very responsive. Something that was initially hard to wrap my head around was how to deal with the site's routing/pagetree. While Google now indexes modern 'single-page' web applications, for instance Facebook still scrapes their opengraph from the raw HTML pages. I dealt with this by giving the Ember app and the PW page-tree use the exact same routes / pages. Every Processwire page is a valid starting point for the Ember app, while also including the scrapeable meta tags belonging to that exact URL. As a result, the whole thing is nicely CURL-able and bot-friendly.
  7. So I created a settings page in the admin (process set to PageEdit and chose a page from the tree with the desired template), but now I am a little confused of how to actually pull out the data that I need. I had tried: <?php echo $page->settings->body; ?> but this produces nothing. I am sure I have overlooked something very easy here, but for the life of me I cant figure it out.
  8. So, here I am, working at the weekend again to get this site done. I'm hoping someone can help me get over this hurdle. I'll try to explain it as best as I can. I have notes pages using a template 'note'. Children of those pages are comments, using a template 'comment'. When a comment is posted, their username is recorded in the field comment_username attached to the comment template. There is one particularly important commenter. Let's call him John. What I need to do is select new comments where at least one of the comments before that was from John. I'm trying all kinds of crazy $pages->find things, but going around in circles!
  9. My site has three language, default, chs, eng. Default language is cht (traditional chinese) I have an order template (no output template). Structure look like An order will be created after a successful paypal transaction has been made. When I'm on default language, the order creation is working properly. However, if I switched to chs or eng The order number field i.e. title field cannot be inserted. I just saw an empty title field. All other fields are populated values properly, except the order number Here is my page creation code $p = new Page(); $orderByUser = $user; $p->template = "order"; $counter_name = $order_number_prefix . date('Y'); $number = $this->modules->get('DatabaseCounters')->next($counter_name, 1, 5000); $ordernumber = $counter_name . '-' . sprintf("%06u", $number); $p->title = $ordernumber; $p->member = $orderByUser; $p->payment_method = $session->get("payment_method"); $p->order_time = $session->get("order_time"); $p->paypal_transaction_id = $session->get("paypal_transaction_id"); foreach($session->get("cart_item") as $cart_item) { // create order items $item = $p->order_items->getNew(); $item->product_id = $cart_item['id']; $item->product_name = $cart_item['name']; $item->product_price = $cart_item['price']; $item->product_quantity = $cart_item['quantity']; $item->save(); $p->order_items->add($item); $transaction_amount += ($cart_item['price'] * $cart_item['quantity']); } $p->transaction_amount = $transaction_amount; $p->of(false); $p->save();
  10. Hello, as an example imagine this structure: Templates: CarManufacturerTemplate Name: String CarTemplate Name: String Owner: String CarManufacturer: Page(where Template == CarManufacturerTemplate) Pages: CarManufacturers Manufacturer 1 [Template = CarManufacturerTemplate] Name = "Toyota" Manufacturer 2 [Template = CarManufacturerTemplate] Name = "Ford" Cars Car 1 [Template = CarTemplate] Name = "Car 1" Owner = "Steve" CarManufacturer = Manufacturer 1 (Shown as "Toyota") Car 2 [Template = CarTemplate] Name = "Car 2" Owner = "Bob" CarManufacturer = Manufacturer 1 (Shown as "Toyota") Car 3 [Template = CarTemplate] Name = "Car 3" Owner = "Jack" CarManufacturer = Manufacturer 2 (Shown as "Ford") So there are multiple manufacturers, multiple cars, and every car has a reference to its manufacturer. On the page mysite/cars/car-1/ I want to be able to present the data in a manufacturer-specific way but without doing something like this: <?php if ($page->CarManufacturer->Name == "Toyota") { //Show Toyota specific formatting } else if ($page->CarManufacturer->Name == "Ford") { //Show Ford specific formatting } ... ?> Instead I want to be able to give every child-page of the CarManufacturers-page some code which takes the required data as parameters and creates the formatted output on its own. This way, whenever I add a new manufacturer, I don't have to go through all the places which output manufacturer-specific data and add another if-statement. Instead I want to be able to write code on a per-manufacturer basis. A possible way of doing this would be a FieldType which allows me to enter PHP code in the backend. I'd add another field to the CarManufacturer-template: Templates: CarManufacturerTemplate Name: String CustomFunctions: MyCustomTypeWhichExecutesPHP And the backend page for Manufacturer 1 (Toyota) looks like this: |------------- | Name: | |-------- | | Toyota | |-------- | CustomFunctions: | |------------------------------------------------------ | | public function OutputCarData($SomeCarData) { | | //Show Toyota specific formatting | | } | |------------------------------------------------------ And in the template-code of CarTemplate I can just do this: <?php $SomeCarData = $page->whatever; $page->CarManufacturer->CustomFunctions->OutputCarData($SomeCarData); ?> And I don't need to change that code at all when I add another car manufacturer. I just type in another function OutputCarData which does the formatting appropriately. I hope there is a simpler way for this than creating a custom FieldType. If you have any further questions feel free to ask and I will try to answer them or provide more details in what I want to achieve. Many thanks, _NameLess_
  11. Hi everybody! I'm trying to figure out how to do what is mentioned into the title but I'm stuck into this issue and can't get a valid idea, still Let me to explain better what I'm looking for. I've seen some module (and I can't remember the name ) that asks to the user to fill a field and save the data before to come back to the module settings with other fields enabled and (maybe) pre-compiled using the previously filled field. What I'm trying to do is to make a module using the new PW 2.5.x syntax (the one which separates the module from its configuration via <module_name>Config.php file) that at installation time asks the user to select from the available templates, then submit the choice. Once submitted, the module should provide more setting fields based on the previously choosen template. It would be a great help if someone could help me to figure it out and/or point me at some module which implements this kind of logic. Thanks in advance!
  12. Hello again, while I evaluated possabilities around reusing the image dialog outside of CKE (https://processwire.com/talk/topic/10009-image-field-select-image-from-another-page/) I did a introspektion of CKE's pwimage plugin (indeed I reused a lot of the given logic). Because I don't like the way, the plugin grabs its image information in a big bulk of code, I started to refactor the code and ended in something like this (excerpt): [..] this.config = { uri : ProcessWire.config.urls.admin + 'page/image/' , selectors : { image : '#selected_image' , captionWrapper : '#wrap_caption' , cbLink : '#selected_image_link' , cbHiDpi : '#selected_image_hidpi' , cbCaption : '#selected_image_caption' , inDescription : '#selected_image_description' , inRotation : '#selected_image_rotate' , inPageId : '#page_id' } [..] }; [..] , getImageProperties : function (jImage , jIframeContent) { var that = this; var jImage = jQuery (that.config.selectors.image , jIframeContent); var jCheckboxLinkToLarger = jQuery (that.config.selectors.cbLink , jIframeContent); var jCheckboxHiDpi = jQuery (that.config.selectors.cbHiDpi , jIframeContent); var jCheckboxCaption = jQuery (that.config.selectors.cbCaption , jIframeContent); var jInputDescription = jQuery (that.config.selectors.inDescription , jIframeContent); var jInputRotation = jQuery (that.config.selectors.inRotation , jIframeContent); var jInputPageId = jQuery (that.config.selectors.inPageId , jIframeContent); var flipHorizontal = jImage.hasClass ('flip_horizontal'); var flipVertical = jImage.hasClass ('flip_vertical'); var src = jImage.attr ('src'); var cls = jImage .removeClass ('ui-resizable No Alignment resizable_setup') .removeClass ('rotate90 rotate180 rotate270 rotate-90 rotate-180 rotate-270') .removeClass ('flip_vertical flip_horizontal') .attr ('class') ; var imageProperties = { 'identifier' : jImage.data ('idname') , 'pageId' : jInputPageId.val () , 'src' : src , 'file' : src.substring (src.lastIndexOf ('/') + 1) , 'origin' : jCheckboxLinkToLarger.val () , 'width' : jImage.attr ('width') , 'height' : jImage.attr ('height') , 'widthAuto' : jImage.attr ('width') == 0 , 'linkOrigin' : jCheckboxLinkToLarger.is (":checked") , 'alt' : jInputDescription.val () , 'caption' : jCheckboxCaption.is (":checked") , 'hidpi' : jCheckboxHiDpi.is (":checked") , 'editing' : { 'rotate' : parseInt (jInputRotation.val ()) , 'flip-h' : flipHorizontal , 'flip-v' : flipVertical , 'crop-x' : 0 , 'crop-y' : 0 } , 'class' : cls }; if (! imageProperties.width) { imageProperties.width = jImage.width (); } if (! imageProperties.height) { imageProperties.height = jImage.height (); } return imageProperties; } As you can see, I started to put selectors into configurations und tried to build a literal of the significant image data (which was the goal). I thought it would be nice, if the Image modal page itself could implement an interface like this. So that every derived operation (including CKE) could simply ask for image properties instead of scratching data from markup and input element status all by itself. In result there would exist a future proof approach for times when UI elements, possible image modifications etc. change.
  13. Hey, I'm currently working on a script that automates the import of certain Facebook posts. The script basically requests all the Facebook posts (combined with Images). It loops through all the posts and stores these within Processwire. I did this because I experience the Facebook API as very slow. I will run a Cronjob on this "hidden page" that imports the posts every 10-15 minutes. These posts are then loaded directly from Processwire so the API doesn't affect the loading speed of the page. I experience a minor issue that keeps me from importing all posts correctly. Some images (from the Facebook API) are given through some kind of "safe-image url" - like this: https://external.xx.fbcdn.net/safe_image.php?d=xxxxx&url=https://www.facebook.com/ads/image/?d=xxxxx Regular images (in comparison to this one) are given like this: https://scontent.xx.fbcdn.net/hphotos-xtp1/v/t1.0-9/s720x720/xxxxxx.jpg?oh=xxxxxx&oe=xxxxx Processwire has no problems with storing the images with the url as stated above this line. The "safe-images" however are causing some problems as I experience the following error: Error: Exception: Unable to copy: https://external.xx.fbcdn.net/safe_image.php?d=xxxx&url=https://www.facebook.com/ads/image/?d=xxx-xxxxx-xxxxx=> C:/wamp/www/abelle/site/assets/files/1335/d_aqksuwuaixz-djme44retrvs0th_wzpccib0ojqqb9lknelwusfkjvchyncx0pywb4q8k6iac9rf25kolvgy7nczw96myatyf8u6ap4gi2_cvdj-escwqhmb8dgb.com_ads_image__d_aqksuwuaixz_djme44retrvs0th_wzpccib0ojqqb9lknelwusfkjvchyncx0pywb4q8k6iac9rf25kolvgy7nczw96myatyf8u6ap4gi2_cvdj_escwqhmb8dgbafl1ikir_cs1gmmxhwwwfo_nlxez (in C:\wamp\www\abelle\wire\core\Pagefile.php line 117) I'm wondering if anyone has experienced this same problem before. I am using the following little script to store the image within the back-end of my project. foreach ($array["posts"] as $post): // Get the specific id $id = $post["id"]; // See if there is any pages with the ID yet $spider = $pages->find("title=$id"); if ($spider->count() != 1): // Set the counter echo "<li>$i: New record found</li>"; // Set all the information $new = new Page(); $new->template = "news"; $new->parent = $parent; $new->save(); // Parse the variables, check valid if needed $new->title = $post["id"]; $new->post_id = $post["id"]; // Check for these if (!empty($post["message"])): $new->post_message = $post["message"]; endif; // Check for these if (!empty($post["story"])): $new->post_title = $post["story"]; else: $new->post_title = $post["id"]; endif; // Declare the time $new->post_date = date_format($post["created_time"], "d-m-Y H:i:s"); // Check for these if (!empty($post["message"])): $new->post_message = $post["message"]; endif; // Check for these if (!empty($post["full_picture"])): // Grab the url $url = rawurldecode($post["full_picture"]); // Parse it to the backend $new->post_full_picture = $url; echo $url; endif; // Save the page $new->save(); else: // Set the counter echo "<li>$i: Original record found</li>"; endif; // Increment the counter $i++; endforeach;
  14. Hey All. I am currently writing a very small module to accomplish the following: - I have a Page "Service Types" with multiple childs "Service Type". Whenever a new "Service Type" is added, a Field (in my case FieldtypeRangeSlider) should be generated, eg "servicetype_communication_rangeslider" and added to an existing template ('case') at a specific position. I have little experience with modules but managed to get it done till the successfull creation of the range-field. But now I am struggeling with adding it to the template. First, I havend managed to get a list of templates in the module..just a workaround via pages and selector template=case. I think this would work, but only of there are pages with this tempalte. If not, this solution fails and in general, I don't know how to get the templates in a module. Second, I have no clue how to add a field at a specific position to an existing template (to an existing Fieldset in my case). Here is my code so far: class AddServiceTypesByPage extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Add ServiceTypes By Page (Didhavn)', 'version' => 1.0, 'summary' => 'Add the ServiceTypes by getting Pages with Template "service-type"', 'singular' => true, 'autoload' => true ); } public function init() { $this->pages->addHookAfter('added', $this, "hookAdded"); } public function ready() { // PW API is ready, Controllers go here } public function hookAdded(HookEvent $event) { $page = $event->object; if (!$page->template) { $page = $event->arguments[0]; } if($page->template == 'service-type') { $f = new Field(); $f->type = $this->modules->get("FieldtypeRangeSlider"); $f->name = 'servicetype_' . $page->name; $f->label = 'Service-Type ' . $page->get('title')->getDefaultValue(); $f->set('suffix','%'); $f->set('tags','servicetype'); $f->set('icon','fa-sliders'); $f->save(); /* * now add the field to existing template with name 'case' */ } } } I am thankfull for any help or suggestion! Thanks a lot!
  15. Is there something wrong with the following redirect syntax ? <?php $session->redirect($page->get(1184)->url); ?> I've used this (below) to successfully redirect to a child URL so thought I was on the right track. <?php $session->redirect($page->child->url); ?>
  16. I have a page that has a field that contains a page. How do I use the API to update a page select field in the page's page? Example: User page has field "member" which points to a member page. Member page has field "gender" which points to page for selecting gender. How do I change the page the gender points to from the user page? I've tried $user->member->gender = 123; where 123 is the new page ID. Also, $user->member->set("gender", 123); Both of these seem not to work.
  17. How can I achieve something like this where I can add more Conditions or delete them: Inside this Form where I create Segments for a Mailchimp Account Form processing looks like this: if($this->input->post->createSegment) { $form->segmentnameParam->required = 1; $form->fieldParam->required = 1; $form->operatorParam->required = 1; $form->searchParam->required = 1; $form->match->required = 1; $form->processInput($this->input->post); if(!$form->getErrors()) { $segment_name = $this->sanitizer->text($form->get("segmentnameParam")->value); $field_name = $form->get("fieldParam")->value; $operator = $form->get("operatorParam")->value; $search_value = $this->sanitizer->text($form->get("searchParam")->value); $match = $this->sanitizer->text($form->get("match")->value); $res = $this->mailchimp->call("/lists/segment-add", array( "id" => $list_id, "opts" => array( "type" => "saved", "name" => $segment_name, "segment_opts" => array( "match" => $match, "conditions" => array( array( "field" => $field_name, "op" => "eq", "value" => $search_value, ) ) ) ) )); if($res){ $this->message(sprintf($this->_("Created new Segment called: '%s'"), $segmentnameParam)); } $this->session->redirect("../edit/?id=$list_id"); } }
  18. Hi, I build a new module and try to convert data into WireArray to get the PW API benefits (find('selector'), get('selector'), ...). Some code to my tests... Define a custom WireArray class class CustomWireArray extends WireArray { public $toStringString = ''; public function __toString() { return $this->toStringString; } public function __get($key) { return $this->$key; } public function __set($key, $value) { $this->$key = $value; } } Create a new CustomWireArray $customWireArray = new customWireArray(); Create a new array item $item = new customWireArray(); // set properties to $item... $customWireArray->add($item); // add to the customWireArray So far it works fine. No problem to find() / get() properties from the $customWireArray, but I need sub-items Tested it with a sub-customWireArray and also a simple stdClass, but it won't work with PW find() / get(). Is there a way to get sub-properties work with something like that? $result = $customWireArray->find('property.subfield=MyValue');
  19. I was struggling a bit getting all subfields of a field if type is unknown. I made a small function for use in templates which returns an array() of all properties of (maybe any?) pagefieldvalue. If there is something similar in core (which I couldn't find) please let me know. Tested it with Fiedtype Options, Page, ProfieldsTable. Feel free to use it. /** * ProcessWire UsefulSnippets * * How to get all properties, subfields of any field if you don't know the type only if value is set * @return array */ function getProperties($fieldvalue) { // multiple value field if ($fieldvalue instanceof WireArray) { $result = array(); foreach ($fieldvalue as $subfieldvalue) { $result[] = getProperties($subfieldvalue); } return $result; // single value field with subfields } else if ($fieldvalue instanceof WireData) return get_object_vars($fieldvalue->getIterator()); // single value field else return $fieldvalue; } // Example var_dump(getProperties($page->myfield));
  20. I'm using a repeater field for holding stock levels of different items and when all the rows' quantity columns equal 0, I want to set another stock checkbox field to off. I'm doing this in the template that displays the product: foreach($page->inventory as $stock) : $stock_total += $stock->qty; if($stock_total==0) : $page->of(false); $page->stock = false; $page->save(); endif; endforeach; but it's setting $page->stock to off whenever the page is refreshed regardless of whether $stock_total = 0 or not. Why is that?
  21. Hi Guys, I am running into a bit of an odd problem. I have setup a landing pages section for another site without any issues. Therefore instead of having a ton of landing pages they all reside under /landing-pages/ and will redirect to the short URL. Example: Instead of root/landing-page/page it will be root/page. In my first site it works perfect! In repeating the same setup for another site I encounter the following problem: ERR_TOO_MANY_REDIRECTS Here is what I am doing: Created a Landing Pages Section Landing Pages Reside Under this Section with the landing-page template In the home template I have turned on segments, in landing-page template I have also turned on segments. In the top of the home template I have placed the following code: <?php if(strlen($input->urlSegment2)) { // we only accept 1 URL segment here, so 404 if there are any more throw new Wire404Exception(); } else if(strlen($input->urlSegment1)) { // render the landing page named in urlSegment1 $name = $sanitizer->pageName($input->urlSegment1); $post = $pages->get("/landing-pages/")->child("name=$name"); if($post->id) echo $post->render(); else throw new Wire404Exception(); } else { ?> In the top of the landing-page template I have placed the following code: <?php // Redirect to the fake URL if real URL is accessed if(!$input->urlSegment1) { $session->redirect($page->url); } include("inc/head.inc"); ?> If I go to the shorter url it works fine, if I attempt the /landing-pages/page url it wont redirect, it just causes the error. Now I tested replacing $session->redirect($page->url); with throw new Wire404Exception(); and then it will work with showing the 404 therefore my conclusion is the session is not catching the short url. Any help? I have checked htaccess, index and config, all are setup right. Running: PW 2.7
  22. Allow easy move & change order with $page API Semething like: $page->moveAfter($page); $page->moveBefore($page); $page->move($parent); // at end of collection
  23. I'm creating a general function for batch import, for a site migration, and while looping through fields (field names) to be imported for a page, I need to check whether the field is an image (or other file type), so that it can be imported after the first pave save. What would be the recommended way to check this, with PHP code?
  24. Hi Guys, I have a site that I built for a software company. The site has someone that will be managing the blog which is in ProcessWire now. Here is my question, I need to give the user's role the ability to change the created user for a page however, ProcessWire template settings only allows me to add this capability to the superuser. Any suggestions? Workaround ? Thanks.
  25. Hi all, I wonder if PW allows for a custom sort order of pages? I would like to render my page tree custom sorted for a mobile menu, e.g. not in "reverse sort order" or "sorted by date" and so on but completely customized. My current page tree in the admin looks as follows (numbers are page ids): / |- page 1006 |- page 1058 |- page 1062 But for my mobile menu I try to render the following order: / |- 1062 |- 1006 |- 1058 $entries = $pages->get("id=1|1006|1058|1062, sort=??"); Any ideas how to achieve this? Many thanks!
×
×
  • Create New...