Leaderboard
Popular Content
Showing content with the highest reputation on 12/15/2016 in all areas
-
<?php /** * Add "Siblings" tab to page editor. * */ class PageEditSiblings extends WireData implements Module { public static function getModuleInfo() { return array( "title" => "Page Edit Siblings", "summary" => _("Add siblings tab to page edtior"), "version" => "0.0.1", "autoload" => true ); } public function init() { $this->addHookAfter("ProcessPageEdit::buildForm", $this, "addSiblingsTab"); } public function addSiblingsTab(HookEvent $event) { $edit = $event->object; $form = $event->return; $master = $edit->getMasterPage(); $page = $master ? $master : $edit->getPage(); $wrap = $this->buildFormSiblings($edit, $form, $master, $page); $form->insertAfter($wrap, $form->get("ProcessPageEditChildren")); } public function ___buildFormSiblings($edit, $form, $master, $page) { $wrapper = $this->wire(new InputfieldWrapper()); $id = $this->className(); $wrapper->attr('id+name', $id); if(!empty($settings['ajaxChildren'])) $wrapper->collapsed = Inputfield::collapsedYesAjax; $defaultTitle = $this->_('Siblings'); // Tab Label: Siblings $title = $this->page->template->getTabLabel('siblings'); if(!$title) $title = $defaultTitle; if($page->parent->numChildren > 1) $wrapper->attr('title', "<em>$title</em>"); else $wrapper->attr('title', $title); $this->addTab($edit, $id, $title); if(!$edit->isPost) { $pageListParent = $page->parent; /** @var InputfieldMarkup $field */ $field = $this->modules->get("InputfieldMarkup"); $field->label = $title == $defaultTitle ? $this->_("Sibling Pages") : $title; // Siblings field label if($pageListParent->numChildren > 1) { $field->value = $this->renderPages($pageListParent->children(), $page); } else { $field->description = $this->_("There are currently no siblings of this page."); } if($page->addable()) { /** @var InputfieldButton $button */ $button = $this->modules->get("InputfieldButton"); $button->attr('id+name', 'AddPageBtn'); $button->attr('value', $this->_('Add New Page Under Parent')); // Button: add new child page $button->icon = 'plus-circle'; $button->attr('href', "../add/?parent_id={$page->parent->id}" . ($this->input->get('modal') ? "&modal=1" : '')); $field->append($button); } $wrapper->append($field); } return $wrapper; } public function ___renderPages($list, $cur) { $out = '<div class="PageList" style="display: block;">' . "\n"; foreach($list as $p) { $out .= ($p == $cur) ? "<div class='PageListItem'>{$p->title}</div>\n" : "<div class='PageListItem'><a href='{$this->page->url}?id={$p->id}' title='{$p->name}' class='PageListPage label'>{$p->title}</a></div>\n" ; } $out .= "</div>"; return $out; } protected function addTab($edit, $siblingid, $siblingtitle) { $tabs = $edit->getTabs(); $removed = array(); foreach(array_reverse($tabs) as $id => $title) { if($id == "ProcessPageEditChildren") { break; } $removed[$id] = $title; $edit->removeTab($id); } $edit->addTab($siblingid, $siblingtitle); foreach(array_reverse($removed) as $id => $title) { $edit->addTab($id, $title); } } } Only tested on PW 3.0.34 but should (I hope) work on any 2.7.x / 2.8.x / 3.0.x install. Large parts stolen from ProcessPageEdit::___buildFormChildren.7 points
-
ProcessPageListerUrls Create links to specific ListerPages with predefined selector, column and sort settings. See GitHub for more information. Download ProcessPageListerUrls on GitHub6 points
-
You can use wireshell as well. This is really handy. Just give the following command and grab a coffee wireshell page:emptytrash I'm not really sure if it will delete everything in one run, but I deleted 60k pages the other day without problems. Really fast too and the main advantage is that you are not tied to a PHP session.5 points
-
You can use from the API: $pages->emptyTrash(); It's even better if you can do it by bootstraping PW from the terminal.3 points
-
Yes. It's quite advanced to be in the cheatsheet . Besides the links below, you can Google (forums) $database (or even PDO) to find out more if you wish. Also, just grepping $database in ProcessWire core files, especially Fieldtypes should yield interesting stuff API documentation on ProcessWire site: Class Database More API Docs: Class Database Example usage: Blog and Matrix modules.3 points
-
You can still use your SQL in ProcessWire, either raw or using $database variable. I have done this myself in various modules. Also, maybe not to the extent you want, but Padloper generates sales reports.3 points
-
Add the field to your user template Do what you want ...e.g. $process = wire('process'); $u = $process->getPage();// this is an object $id = $u->id; return $id;// will return 40 for guest, 41 for superuser, etc... //return $process->className();// would return ProcessUser. Useful to know if you are using the field elsewhere and want to do different things based on context // return $u->email;// etc... Edit: But that only works when you are actually editing that page, of course3 points
-
MarkInPageTree New module which does what it says in the title. It adds an icon to a page on the page tree if -> a specific field is true and / or is a specified template. For example I'm using it to add an icon to any page that has a checked (checkbox) exclusive field. This helps with admin clarity as you can see instantly which pages of the same template have differing content (i.e. are exclusive or not). https://github.com/benbyford/MarkInPageTree2 points
-
Been there done that. I proudly present a ProcessWire 3 compatible version with the latest HybridAuth (only tested with Facebook). The code can be found on Github https://github.com/jmartsch/processwire-social-login with installation instructions. Please add your suggestions or create pull requests. The module and its dependencies are installed via composer. Have phun!2 points
-
@adrian Thanks a lot. That was the right track indeed. Yes, I'm experiencing exactly the same strange behavior as described in your bug report. Setting $repeaterItem->status=2048 instead of using addStatus() works for me. For the record, from FieldtypeRepeater.module: @horst Thanks to you, too. Yep, I kept all that in mind.2 points
-
@CalleRosa40 - you may want to look at this: https://github.com/processwire/processwire-issues/issues/36#issuecomment-258702228 Firstly, it shows how to unpublish a repeater, but it also shows that there is currently a bug with this - at least as far as I can tell, but Ryan hasn't responded to my last post, so will have to wait and see. I'd love your feedback on that Issue if you can also confirm what I am seeing.2 points
-
Google is your friend, lots of results in there. Some of the more useful... Ben's beginner's tutorial on tuts+ Teppo's articles on textformatter modules and hooks (you'll need hooks if you are writing modules.) The example "Hello World" module that ships with PW. Other threads from the forum: A, B & C. Hope that helps!2 points
-
Hi Raulyjo, Maybe you can repost the image - it isn't viewable now. Regarding your problem you might consider merging the VirtualHost options into 1 block and using ServerAlias for the www alias; <VirtualHost *:80> ServerAdmin Raul DocumentRoot "/opt/bitnami/apps/mywebsite/htdocs" ServerName mywebsite.es ServerAlias www.mywebsite.es </VirtualHost> Remember to restart Apache again after changing. I hope this works - but just let it know.2 points
-
This module allows the page name to change when the title is edited. Modules directory: http://modules.processwire.com/modules/page-rename-options/ Github: https://github.com/adrianbj/PageRenameOptions I'd love to think that this module was not necessary for me but, especially during development, I find that page titles often change and I'd really rather have the names/urls match the title. I don't think you can expect clients to remember to change the name when they change the title, or even if they do, they still have to get it right which can be a challenge with a long article names with characters not allowed in page names. With none of the config settings checked, the default behavior is to have the page name always match changes to the page title, but allow the user to manually edit if they want. The options allow you to protect initial differences (changes you may have made as a user with an exempt role), completely disable manual changes, or protect manual name changes from subsequent changes to the title while editing. My preferred settings are to set the exempt role as superuser, and check "Initial Differences Protected" and "Prevent Manual Changes". CONFIG SETTINGS Exempt Roles The selected roles will not be subject to any of the rules below. The name will change automatically with the title, but they will be able to manually edit the page name as desired. Excluded Pages Pages that are excluded from the actions of this module. Changing the titles of selected pages will behave as though this module is not installed. For multi-language sites it is recommended to select the site's homepage. Initial Differences Protected If checked, further changes to the name (to match a changing title) will not happen if the name is already different from the title (evaluated on page edit initial load) Prevent Manual Changes If checked, it won't be possible to manually edit the name. If checked, this will disable the "Live Changes Protected" setting since it won't be possible to make any manual changes. Live Changes Protected If checked, further changes to the name (to match a changing title) will not happen if the name field was manually changed at any time during the current page edit. Please test the behavior of each setting thoroughly so you understand what each one does! Please let me know if you have any further requirements around permissions / role access to the module's functionality.1 point
-
ALIF - Admin Links In Frontend EDIT: latest version update with PHP 8 fixes on 05. Nov 2023 (!) The version now is 1.1.9 (!) This module combines some of the admin links that we want to use on the frontpages sometimes. It is a comfortable and easy way to do so. After you have installed and configured the module, you can inject the links into the frontpage with code like this in a template file: echo $modules->isInstalled('AdminLinksInFrontend') ? $modules->get('AdminLinksInFrontend')->render() : ''; . Credits: The comfortable Javascript Color Picker in the Configpage comes from Jan Odvarko (http://jscolor.com). Many thanks for this! * Toolbar The toolbar can be positioned by css values for top/bottom and left/right. It can expand in vertical or horizontal direction. The buttons are links to the PW admin, for logout, or for editing the page in admin, or informational ones. All settings, including the colors, can be defined in the modules config page. This is available for all PW versions from PW 2.3 up to now. Depending on how you configure this part, it can be used for authors and editors too, maybe. * Import / Export Settings It has the possibility to export and import its settings via two textarea fields. When importing settings, you get a second screen where you can select which settings you want to import. * One-click User Account Switcher For PW versions 2.6.8+, there is one really nice function available, that I use when developing / testing sites with different user / roles. A fast User-Account-Switcher that lets you view the same page from different user accounts with only one click. To enter this mode, you need to login as a superuser one time, and the feature needs to be enabled in the module of course. After that, you can log out, login with different user roles, etc. At least the toolbar buttons for the User-Account-Switcher will stay visible for you. This is session based. There is also an extra button with a trash can and the text "Session", that helps you to leave this mode once you are finished. As you can see in the screenshot, after clicking "guest", I was logged out, but a regular login button, a warning for debug mode and my three defined buttons for user accounts are available. When clicking another user button I login with this account. Very handy. ATTENTION! The use of the One-click User Account Switcher is mainly intended for dev sites, not for public sites! You should be aware that there is a huge security risc when using this feature on public reachable sites! We completly leave ProcessWires comfort zone in regard of security, - and the only thing between your site and potentially hackattacks is this module. (Oh mom, - what have I done?) PW 2.6.8+ has a comfortable function for admin tasks, that let us log into different user accounts via API without using passwords. This module uses this function! All data that is needed during a User Account Switcher session is stored in the session data on the server. So, if someone steel your session cookie, there is potentially risc that he can login as a superuser, depending of the user account buttons you have in your admin links collection! To prevent SessionHijacking, the module can be bound to a single IP address, it uses a fingerprint depending of IP(s) and UserAgent string. And you need to define a max time to live in minutes between 2 and 60, a User Account Switcher session may run. A User Account Switcher session only can be initialized by a Superuser who also explicitly has set a permission called 'alif-user-account-switcher', what is defined by the module, when installing it. So, the prefered way to use this module is, to enable and use the User Account Switcher while the site is unpublic, and before it goes public, remove the permission from the superuser role. This way, you can use its menu function, but not the UAS anymore. On a sidenote, for those rare cases where multiple superusers simultaneous developing on a site and want to use the ALIF, but the UAS should be used only by one, you can leave the 'alif-user-account-switcher' permission removed from the superuser role, but need to assign the role 'alif-superuser' to the single user account. This way, only that single superuser has the permission for UAS, whereas all other superusers doesn't have it. . . * The Configpage * Online demo I have pasted it into this old site and enabled it to be present every time (when the site is in demo mode only!). So, it is an earlier state, but the switcher is functional there: http://pwlaf.biriba.de/dbinfo/ * Download From our modules directory or from github repo1 point
-
FieldtypeRuntimeMarkup and InputfieldRuntimeMarkup Modules Directory: http://modules.processwire.com/modules/fieldtype-runtime-markup/ GitHub: https://github.com/kongondo/FieldtypeRuntimeMarkup As of 11 May 2019 ProcessWire versions earlier than 3.x are not supported This module allows for custom markup to be dynamically (PHP) generated and output within a page's edit screen (in Admin). The value for the fieldtype is generated at runtime. No data is saved in the database. The accompanying InputfieldRuntimeMarkup is only used to render/display the markup in the page edit screen. The field's value is accessible from the ProcessWire API in the frontend like any other field, i.e. it has access to $page and $pages. The module was commissioned/sponsored by @Valan. Although there's certainly other ways to achieve what this module does, it offers a dynamic and flexible alternative to generating your own markup in a page's edit screen whilst also allowing access to that markup in the frontend. Thanks Valan! Warning/Consideration Although access to ProcessWire's Fields' admin pages is only available to Superusers, this Fieldtype will evaluate and run the custom PHP Code entered and saved in the field's settings (Details tab). Utmost care should therefore be taken in making sure your code does not perform any CRUD operations!! (unless of course that's intentional) The value for this fieldtype is generated at runtime and thus no data is stored in the database. This means that you cannot directly query a RuntimeMarkup field from $pages->find(). Usage and API Backend Enter your custom PHP snippet in the Details tab of your field (it is RECOMMENDED though that you use wireRenderFile() instead. See example below). Your code can be as simple or as complicated as you want as long as in the end you return a value that is not an array or an object or anything other than a string/integer. FieldtypeRuntimeMarkup has access to $page (the current page being edited/viewed) and $pages. A very simple example. return 'Hello'; Simple example. return $page->title; Simple example with markup. return '<h2>' . $page->title . '</h2>'; Another simple example with markup. $out = '<h1>hello '; $out .= $page->title; $out .= '</h1>'; return $out; A more advanced example. $p = $pages->get('/about-us/')->child('sort=random'); return '<p>' . $p->title . '</p>'; An even more complex example. $str =''; if($page->name == 'about-us') { $p = $page->children->last(); $str = "<h2><a href='{$p->url}'>{$p->title}</a></h2>"; } else { $str = "<h2><a href='{$page->url}'>{$page->title}</a></h2>"; } return $str; Rather than type your code directly in the Details tab of the field, it is highly recommended that you placed all your code in an external file and call that file using the core wireRenderFile() method. Taking this approach means you will be able to edit your code in your favourite text editor. It also means you will be able to type more text without having to scroll. Editing the file is also easier than editing the field. To use this approach, simply do: return wireRenderFile('name-of-file');// file will be in /site/templates/ If using ProcessWire 3.x, you will need to use namespace as follows: return ProcessWire\wireRenderFile('name-of-file'); How to access the value of RuntimeMarkup in the frontend (our field is called 'runtime_markup') Access the field on the current page (just like any other field) echo $page->runtime_markup; Access the field on another page echo $pages->get('/about-us/')->runtime_markup; Screenshots Backend Frontend1 point
-
WireArray's unique method is not what you're looking for, it removes duplicate entries from a WireArray like your images field, and the image list is already unique. But you could shorten the filling of your tags array (the internal steps are basically the same as what your code does): $tagsarray = array_unique($page->images->explode("tag"));1 point
-
Are you sure that you dealing with the right pages / objects in $repeaterItem? Where do you call that, in template scope? How have you set outputformatting, true or false? Have you saved the page after changing the status?1 point
-
I started a tutorial but never got to finish it as Work got more tedious it has enough to get started. hopefully i should finish this off assuming API hasn't changed1 point
-
I don't have time to help out right now, but this would be an easy module to create - either added to the children tab (which you could rename to family) or adding a new siblings tab.1 point
-
Oh yeah, I have googled up... ALOT before I could ask question here in this thread ( I should have made that clear earlier). I always end up with different result like PW for beginner, some thread discussion on something else and etc... I guess, google isn't friendly to me today . Thank you for your help, everything you gave out will do good for me!1 point
-
Thanks Robin. Understood about superuser, and agreed - never let a client have superuser access. Kind regards Nik1 point
-
Would be nice if password field were actually made required by field settings, but thanks a lot for the hook adrian just wanted to unrequire pass field because not all user need a pass as some might only be staff entry to show on the front page and I just confirmed that an empty password wont allow login..I like! maybe it could be deactivatable in advanced mode1 point
-
@Elías Gómez, great that you sorted that out!1 point
-
Just to be sure: You want to redirect to another page after successfully submitting the form data? This is not possible at the moment, but shouldn't be that difficult to implement.1 point
-
Here is what I have done so far: PUT and DELETE is - as already said - very important to tell what should happen with the resource. Which can be compared to CRUD GET - Show content POST - Create content PUT - Update content DELETE - Remove content <?php namespace ProcessWire; ini_set('display_errors', 1); error_reporting(E_ALL); ob_start(); $method = $_SERVER['REQUEST_METHOD']; $json = ['message'=>'NONE']; //$request = explode("/", substr(@$_SERVER['PATH_INFO'], 1)); switch ($method) { case 'PUT': if($user->hasPermission('page-edit', $page)) { $pageFields = json_decode(file_get_contents('php://input')); foreach ($pageFields as $field => $value) { echo $field . " " . $value; $page->$field = $value; //$json[$field] = [$page->${field}]; } $page->setOutputFormatting(false); $page->save(); $json = ['message'=>'RESOURCE UPDATED']; } else { $json = ['message'=>'NOACCESS']; } break; case 'POST': if($user->hasPermission('page-create', $page)) { $pageFields = json_decode(file_get_contents('php://input')); $title = $sanitizer->text($pageFields['title']); if(!$page->children('title != '.$title)) { // create new page, if not already there $p = new Page(); $p->template = $pageFields['template']; $p->parent = $page; $p->name = $sanitizer->pageName($pageFields['title'], true); // URL name $p->of(false); // turns off output formatting $p->title = $title; $p->save(); } http_response_code(201); $json = ['message'=>'CREATED']; } else { $json = ['message'=>'NOACCESS']; } break; case 'GET': $json = []; $additionalFields = [ 'created' => $page->created.'000', 'modified' => $page->modified.'000', 'createdUser' => $page->createdUser->name, 'modifiedUser' => $page->modifiedUser->name ]; foreach ($fields->find('*') as $field) { $json[$field->name] = htmlentities($page->{$field->name}); } foreach ($additionalFields as $field => $value) { $json[$field] = $value; } break; default: //handle_error($request); break; } //ob_clean(); header('Access-Control-Allow-Origin: *'); $content = json_encode($json); //EDIT: My bad! POST is create, PUT is Update1 point
-
Great idea and great module! Saves me some rather ugly additions to the displayed title page in the page tree. One thing for the Christmas wish list: It would be even greater if the module would provide a way to set up several different rule sets. So you could set up different icons to mark different things.1 point
-
My guess why PW isn't listed in the most popular CMS systems is because it ain't visible in HTML right away. In my opinion we're lucky about that so any type of hacking is therefor also very limited (look at WP ).1 point
-
1 point
-
v109 is up - see the readme file on date formattig: PageListTweaks: ability to format unix timestamps in pagelists PageListTweaks: using %field.property% will output the value in the user's language (if available) PageListTweaks: always show extra actions fixed language translator filterbox not appearing possible fix for unclickable select dropdowns in ProDevTools API Explorer (reported by Robin S.) "Always show extra actions" was a client request and removes the need to click on the ">" icon to see the extra actions. This can be handy for power users or when you often need to toggle pub/hidden states of pages. Or simply lazy1 point
-
$page is an API variable, so it's already defined at the time your _init.php runs. $child is not an API variable - it's a variable that you have defined yourself. So you need to make sure it is defined before you try and do anything with it such as $child->created. I don't see $child being defined in your _init.php. I tried both the renderPager() examples you gave and they execute fine. There must be something else that is causing the 500 error. Check your error logs to see if that sheds any light. Are you developing locally or on a live server? If it's a live hosting you may be getting false positives from mod_security if that is installed, so ask your host to disable mod_security in that case.1 point
-
@Elías Gómez, can you post the code you are using to loop over your event pages? It's hard to offer much advice without seeing that. Also let us know what you have selected for the "Formatted value" in the settings of your image field. As a general tip, if you spend a little time getting to know the Tracy Debugger module you will find it very valuable for investigating these kinds of issues. https://processwire.com/blog/posts/introducing-tracy-debugger/ http://modules.processwire.com/modules/tracy-debugger/1 point
-
I think maybe you are already onto this idea (saw your posts in another thread), but you could use RuntimeMarkup to create a non-editable table view in Page Edit showing the payments.1 point
-
Hi NikNak. That's correct - think of the role dropdown as a required field. Come to think of it, I will set the that config inputfield as required in a module update. While it would be possible to restrict PageTables for superusers with this module, I deliberately excluded superusers from the role dropdown. My view is that it is part of the PW philosophy that the superuser role is not subject to any access restrictions and I want the module to be consistent with that. IMHO the only user that should have the superuser role is the site developer - you shouldn't give superuser access to a client. Better to create new role for the client with whatever access is needed.1 point
-
Welcome to the forums and ProcessWire . Oh, we are very kind to everyone, especially those coming from the nightmare that is WordPress. Just kidding. Former MODx-er myself. Nothing wrong with using the variable $features. What I suspect is that your image field is set to hold (and return) more than one image, i.e. an array. So, calling the resize function on an array won't work. Edit Been beaten by others who are faster at typing/thinking...so will stop typing now1 point
-
This should work: <?php $features = $pages->find("template=newsitem, limit=3, sort=-date"); foreach($features as $feature) { $img = $image->first()->size(320, 180)->url; echo " <div class='column is-4' >" . "<img src='$img' alt='' />" . "<h3 class='title is-4'><a href='{$feature->url}'>{$feature->title}</a></h3>" . "<p><span class='date'>{$feature->date} • </span>" . "{$feature->summary}</p>" . "</div>"; } You can read more in the docs. On why you should use first() - or not.1 point
-
Hi, thank you for reply. I decided to build this module in another way. I think this works nice and is efficent for projects with hundreds of images, like Product-Catalogs. Ok, here is my brand new version module: image upload to another page upload and add to pages field image comparison to prevent duplicates basename comparison and pixel comparison search images by text (or show all) no more autocomplete-clone. A built a own Javascript to api logic to get images back. select images in an easy way drag n drop the imagepages like in imagefield to sort Because its extensive stuff, i decided to take a screen capture. I dont know how add a videocontainer here, so you have to download or open the following link in browser: Screen Capture http://download.frech-und-artig.de/selectOrUpload.mp4 (mp4, 91 MB) 3:35 = upload and select images 5:48 = image comparison 7:18 = image comparison with new page 8:00 = testing change of LibraryParent Image Preview Things that i have done: extended Image configuration fields hook in Page::saved to push uploaded images to new/other page ans check if page and image fields connected right to each other extended Page configuration fields hook in PageField::saved to control PageField Config hook in ProcessPageSearch to provide image thumbs instead of boring labels created new InputField "InputfieldPageSelectOrUpload" without pageAutocomplete cloning i added own logic to sortable / add / remove events etc I focused all the time to simplynes for user comfort. But one thing is anoying: that i have to use two fields: the image and the pagefield. I'd loving it, if there is a way, to setup only one field which is presenting two fields in one. How can i merge this? I leaved the bunch of $this->messages("...") in the module for now, because they explain some things and reports errors. What do you think? See zip in attachement. I hope you understand my amazing english skills. SelectOrUpload-0.0.1.zip1 point
-
unfortunately not. But you may find a good startingpoint here: https://processwire.com/talk/topic/14072-add-image-from-input-typefile-possible-or-must-it-be-wireupload/#comment-126476 look at the $filename = myImageExtract($data, $basename); part, - specially the function myImageExtract with the WireTempDir class.1 point
-
I've just submitted a pull request to you Rudy, based on Robin's code, to add the ability to compile all updated sass files. You then include your style sheets as you normally would, pointing to the generated .css file. You can now either use the SassifyAll() function anywhere or head to the admin and click 'compile sass' to compile all your assets at once. This is my first input to a Processwire Module so let me know if I've done anything wrong, or if I've stepped on anybody's toes!1 point
-
https://github.com/ryancramerdesign/ProcessWire/blob/master/README.md https://github.com/ryancramerdesign/ProcessWire/blob/master/README.md#upgrading-from-processwire-241 point
-
Just an addition. You could use the range() function from PHP to create the array. For example like this: range('A', 'Z')1 point
-
It might be that MySQL and PHP differ in the opinion what localhost should resolve to. If MySQL treats localhost as ::1 (ipv6) and PHP thinks of localhost as 127.0.0.1, that would explain this behavior. Though it's also possible that the user is defined as user@% instead of user@localhost and ipv6 loopback access is treated like a remote access. It's hard to say without taking a peek into the system.1 point
-
Thanks for the tip! Turns out my host had to add https URLs to the list of allowed URLs for Hotlink protection option. All is good now!1 point
-
Glad to hear it's working with 2.8. Sorry about the issue with 2.7 - I think perhaps the "noLang" template setting must have been introduced in 2.8/3.x I'll update the modules directory to reflect this. Thanks for the help debugging!1 point
-
Ok, the problem is that you are running PW 2.5.3. Please try updating to 2.8 or 3.x. I don't think there is any way to make this module work with 2.5.3.1 point
-
Hey OpenBayuo, You can just use something like the following? <body class="<?= $page->template ?>"> Hope this helps.1 point
-
@adrianmak - thanks for that. Sorry about the problem. Can you please try the new version I just committed. I have updated the modules directory, so it should be available from the update check.1 point
-
Now that you mentioned @Soma's Page Edit Soft Lock module, the question is: why hasn't this been added to the core since 2012? It is just a few lines of code wich can even be shotened (the module config part of it), but it sounds like a must have feature....1 point
-
The speed will most likely be far more dependent on the actual machine the thing (the db) is running on. As soon as the mysql query is constructed it's not in the hands of processwire (or any framework) to influence the speed of a query. But to say that I've no real stats about how fast the selector to mysql query conversion of processwire is. It's fast enough that nobody here seems to have issues with it.1 point
-
Adrian, I don't think that does what was asked. $fields will will get all the fields that you created, not the ones that are in the pages. hsanabria, you have to identify which fields represent other pages. Using your example: foreach($page->fields as $field) { $fieldValue = $page->get($field->name); echo $field; foreach($fieldValue as $innerPage) { // if value of the field is a page array, we can iterate it foreach($innerPage->fields as $innerPageField) { $innerPageFieldValue = $innerPage->get($innerPageField->name); echo $innerPageFieldValue; } } } Of course it would be much simpler to create a general function that iterates the fields of a page and call it recursively if that field is a page array. But I hope this serves as an example.1 point