Leaderboard
Popular Content
Showing content with the highest reputation on 03/04/2017 in all areas
-
Last week’s post indicated we may have the first [beta] version of the Uikit admin theme ready, and I’m glad to report that we’ve now got it ready for download on GitHub. In this post, we’ll describe what’s new, how to install it, and how to develop with it. https://processwire.com/blog/posts/processwire-3.0.54-and-adminthemeuikit/7 points
-
Looks great! It would be nice to have admin demo updated, so lazy ones like myself can try it too5 points
-
Just a small update: I managed to get the module working without Composer. All SDKs can be downloaded separately and you can choose which one Cloud Service to use or even not use any at all. And some precisions : What is the primary goal of this module and how it works? This module is a backup utility. It make a package which contain a full database dump + full website. The package can be saved locally or/and uploaded to a FTP server, GoogleDrive, Dropbox or AmazonAWS. is it compatible with PW2? Guess not. With 2.8 yes. ProcessWire 2.7 need to be tested as now every SDKs can be downloaded separately. But it already works for saving package to a local folder. I don't use composer. Any other way to install? Just download the SDK you need. I'm on windows. Will PWcron run? Without any problem. Look at this answer to set up it: http://stackoverflow.com/questions/7195503/setting-up-a-cron-job-in-windows What are google/dropbox/AWS needed for? Only needed to upload a package to their service. How can I restore the website? Is it possible to rebuild mine website on a other server? Yes but you have to do it manually. You unzip the package (the zip file), upload your website, import you SQL database, adjust settings in config.php and tadaa, it works. The final goal of the module is to automate this process, but is not yet implemented.5 points
-
Welcome @Schwab, This is already implemented with the „quick-tree“ page list panel. This one is a matter of preference. In my opinion, I find the extra additional clicks for dragging or editing a page alright, because I don't want me or someone else to accidentally move a page. If you want to quickly edit or view a page, you could use the long-click actions. I find them very useful, but they should be promoted more obvious. Regards, Andreas4 points
-
2 points
-
You can have something like this, considering your page field is called "categories". Not tested! <?php $categories = $pages->find('parent=/categories/, sort=name'); ?> <?php foreach ($categories as $category) : if ($pages->count("categories=$category")) > 0 : ?> <li><a href="#" data-name="<?php echo $category->name; ?>"><?php echo $category->title; ?></a></li> <?php endif; endforeach; ?>2 points
-
There is. Use wire('languagues') instead of $languages in function scope. wire() makes all wired variables available to you this way ($page, $templates, $log etc.).2 points
-
Pushed another update with new function added which allows to modify the option labels via hook. Scenario: You want to provide a select drop down for image fields stored in another page as described in this post In the next step we want to provide labels pulled from the description field (default language in multilanguage environment) instead from the data field providing ugly file names. How can we achieve that? The description is stored as a json string. We need to extract the label from it. To do so choose 'description' as option label and put the following hook in your /site/ready.php $this->addHookAfter('FieldtypeSelectExtOption::label', function ($e) { $array = json_decode($e->return, true); $e->return = $array[0]; // image description in default language }); Function label() always provides the default lable, the option value, the page to which the field is assigned and the specific field that uses the field type to facilitate customizations. Default return is the unmodified label pulled from the database column. ATTENTION: Arguments changed since Version 1.3.5 // Version >= 1.3.5 $this->addHookAfter('FieldtypeSelectExtOption::label', function ($e) { $optionLabel = $e->arguments[0]; $optionValue = $e->arguments[1]; $page = $e->arguments[2]; $field = $e->arguments[3]; });2 points
-
Hi and welcome to the forum. You can find some thread in the forum about settings default language if your site is multi-language (?) but I assume here is not the case. How I see the thing : you can develop your front-end in pure Arabic without altering the back-end naturally. I mean the back-end will stay as default in english and writing the front-end (your templates) in all Arabic language is up to you. To help you to get started with RTL front-end, take a look at this series of 2 articles at Mozilla : https://hacks.mozilla.org/author/nefzaoui/2 points
-
Here is the pre-release of the module. https://github.com/outflux3/JqueryIonRangeSlider once it has been tested a bit more, it will be in the directory.. EDIT: In directory: http://modules.processwire.com/modules/jquery-ion-range-slider/2 points
-
@Robin S I fixed this and other stuff you mentioned in this post: It was a bit more complicated than I expected, since PW really doesn't provide '0' as value in a SelectFieldtype.2 points
-
How cool is that! Couple of months before it was on the roadmap and now it is here. Or is time starts going faster as you get older?!2 points
-
This is a very simple module that I put together for @Zahari Majini from a PM request. It allows you to enter a URL to a YouTube or Vimeo video in a specified field and when you save the page, it will grab thumbnails for the video and add them to a specified images field. Check the module configuration options for: the field(s) to search for videos name of the video images field which thumbnail(s) you want grabbed whether to grab the first available or all available thumbnails based on those that you list As always, an feedback for improvements is very welcome! Modules Directory: http://modules.processwire.com/modules/process-get-video-thumbs/ Github: https://github.com/adrianbj/GetVideoThumbs1 point
-
Awhile back, I made an Ajax API for querying pages in the admin via the ProcessPageSearch module. It is used by [for example] the PageAutocomplete Inputfield. I thought this capability would be useful on the front-end too, so this module brings it to the front-end as a page in your site that you can put wherever you want to. The way you use it is exactly the same as the one in ProcessPageSearch, but this one is a little more strict, given that it's publicly available on the front-end. By "more strict" I mean that you have to define what you want to allow in terms of input and output in the module's configuration. The web service takes it's query from GET variables in the URL and returns results in JSON format. It installs a page called /service-pages/ in your site, and you are welcome to move that page wherever you want. Here is the official page at modules.processwire.com: http://modules.processwire.com/modules/service-pages/ Once installed, you should view the /service-pages/ page that it installs because it outputs detailed instructions and examples on how to use it in your own projects. But here's a few excerpts from what you'll find on that instructions page: Input The /service-pages/ page can be queried with GET variables in the URL to return JSON-format results. The query string should follow a ProcessWire selector format ([field][operator][value]), but modified a bit for use in a URL query string. Here are a few format examples: Specify a single value: ?field=value Specify multiple fields and values to match: ?field1=value1&field2=value2&field3=value3 Specify multiple fields where at least one must match the value. Note use of "," rather than "|", something we had to settle for to make it work as a URL key: ?field1,field2,field3=value Specify one field with multiple possible values (it's fine to use "|" as a separator here): ?field=value1|value2|value3 Note that unlike regular ProcessWire selectors, multiple field=value sets are split with an ampersand "&" rather than a comma ",". Allowed Values The allowed values for field are set with the module configuration. You may also specify the following modifier keyword=value pairs: sort=[field] (Specify field name to sort results by) debug=1 (Enables debug mode producing human readable output) limit=[n] (Specify the max number of pages to return) start=[n] (Specify the result number to start with) include=hidden (Include pages that are 'hidden') Allowed operators The operator demonstrated by the "=" sign in the examples above may be replaced with any of the following operators in the query string: = Equal to != Not equal to < Less than > Greater than <= Less than or equal to >= Greater than or equal to *= Contains the exact word or phrase ~= Contains all the words %= Contains the exact word or phrase (using slower SQL LIKE) ^= Contains the exact word or phrase at the beginning of the field $= Contains the exact word or phrase at the end of the field As an example, this ProcessWire selector: template=property, body*=luxury, bedrooms>5, bathrooms<=3 ...would be specified as a query string to this web service like this: ?template=property&body*=luxury&bedrooms>5&bathrooms<=3 Allowed templates For security, the search will only be performed on pages using templates that are defined in the module's configuration. Output The returned value is a JSON format string in the following format (populated with example values): { selector: "title*=something, template=basic-page, limit=50", total: 2, limit: 50, start: 0, matches: [ { id: 1002, parent_id: 4525, template: "basic-page", path: "/test/hello/", name: "hello" }, { id: 1005, parent_id: 4525, template: "basic-page", path: "/test/contact/", name: "Contact Us" } ] } Each of the 'matches' values will also include all the fields you have specified to appear with the ServicePages module configuration. If an error in the query prevented it from being performed, a JSON string in this format will be returned: { errors: [ "Error message 1", "Error message 2 (if there was one)", "And so on..." ] } The web service honors user view permissions. As a result, if you are accessing this service from a superuser account, you are likely to get pages that others users may not see. Superusers get an "include=all" automatically, unless you override it with an "include=hidden". Returned field values The following field values will be returned for all matched pages: id (integer) parent_id (integer) template (string) path (string) name (string) Any other fields may be included from the module's configuration screen. Pagination To paginate, simplify add a "page[n]" url segment to the request URL, i.e. /service-pages/page2/?template=basic-page&sort=name1 point
-
Hi all. For a while now been wondering how many would be interested in a backend and frontend shop catalogue built on top of PadLoper? I've previously spoken to @apeisa about this and his take is that there are no plans to develop PadLoper in this direction but he's happy to support such efforts. The gist of the backend shop catalogue is to provide one place (think ProcessModule) where you can manage your PadLoper products - add, edit, delete, track sales, etc without having to set up the underlying structure yourself. The frontend would be like a shop/webstore profile, a frontend cart basically, that's customisable. The shop would be 100% powered by PadLoper. This means that to use the 'shop catalogue' would require that PadLoper is installed. These are just loose ideas at the moment for a pro module. This might or might not see the light of day depending on feedback. Anyway, would love to hear thoughts, thanks.1 point
-
Hello I made a simple app for reading the main RSS for ProcessWire news. Now you can access ProcessWire Blog, ProcessWire weekly and the Latest Forum Posts in a Single App in your iOS or Android smartphone. Open Source of Course. Made using the http://jasonette.com technology. You can compile your own app if you want. For A Quick Look 1.- Download the Jason App (iOS) https://itunes.apple.com/us/app/jason./id1095557868?mt=8 (Android) https://play.google.com/store/apps/details?id=com.jasonette.jason 2.- Use the Following Url https://raw.githubusercontent.com/NinjasCL/pw-app/master/app.json Source Here https://github.com/NinjasCL/pw-app1 point
-
Welcome @Amr Magdy, if your hoster doesn't allow file permissions 600, you could try the next higher permissions 640: https://processwire.com/docs/security/file-permissions/#potential-permissions-for-writable-directories-and-files Regards, Andreas1 point
-
1 point
-
Look . All you describe here has nothing to do with my question. I added multilingual support to blog scheme and it works perfectly showing multilingual menu. But as I asked I need to integrate it into main menu using build in functionality. And I believe there is a really easy way for that. Secondly why should I use menu builder if I can simply fix a template with pure php. All I need is to pass $languages to function uknavbarnav somehow or decide a function in parts. No idea yet. Buy surely there must be a simple answer1 point
-
I bet the server that is failing has strict error reporting on. The code you are using should return this error: Error: Use of undefined constant pages - assumed 'pages' So it will work with strict error reporting off, but it's not correct code.1 point
-
Shouldn't it be with quotes around pages? Be it in blog/ or talk/, it seems to always be wire("pages") or wire('pages'), wire("page") or wire('page').1 point
-
Thanks, I forgot about that - went looking in the field settings - I still think perhaps it would be best to be configurable at the field level.1 point
-
You can put emoji in the database (use it in text fields), but you need to use the utf8mb4 charset for your tables, which you can choose on install. You can change it later as well, but I think there's no official upgrade path to do so.1 point
-
So, here is the scenario. I am creating my own little advert management system on my new site. Basically, I have pages under a parent each with ad information in them - google ad code, other ad code, my own ads and so on. On the parent page, I have a little ProFields table. The first column is a selector where I can choose a position on the website. "Home Page 1st Ad Position" for instance. In the second column, I have a page select where I select one of the ads. Simple! Now, just to complicate it, one of my choices I want is "Random". Basically, if I choose this one, for a particular position, then it chooses randomly from all my ads. But how to add a "random" choice? Well, it struck me that I just create a blank ad called "random" and then I can choose that one. In my code I just put "if ad name is random then getRandom()" But then, that random selection would also include the random ad. So, that better be unpublished. Now I need to change my selector in the table to include an unpublished item. But then, would the random choice end up choosing the unpublished random ad.... oh god! I could see me causing myself problems. I scratched my head, stared at errors, walked around the house, shouted at the rain, played some solitaire ... And then it came to me. OBVIOUS!!!! Publish the ad page called "random" and just put an advert in it! DUH!!!!!!1 point
-
Hi @MaryMatlow Glad you got it sorted. That's a core module, so check under core/modules/ in the modules page, specifically a process module called 'Comments'.1 point
-
1 point
-
1 point
-
This syntax works fine for me with plain Repeater fields, so it should work for Repeater Matrix fields too: $results = $pages->find("my_repeater.my_nested_repeater.my_textarea%=foo"); So maybe typos are slipping in somewhere else... Testing this did expose a bug where pages are matched when the repeater fields are empty - will file this at GitHub shortly. Done: https://github.com/processwire/processwire-issues/issues/205 There is another way you could do this, but I think the selector with subfields is more elegant... // returns the root container page for any repeater item no matter how deeply nested function getRootContainer($page) { if($page instanceof RepeaterPage) { return getRootContainer($page->getForPage()); } else { return $page; } } $results = new PageArray(); $repeater_pages = $pages->find("my_textarea%=foo, has_parent=2, include=all"); foreach($repeater_pages as $repeater_page) { $results->add(getRootContainer($repeater_page)); }1 point
-
1 point
-
Just do it Kongondo! I would have bought it directly. It would have saved me a lot of time for the project I'm going to work.1 point
-
Got it working, the cron task call the PHP script. Now I am getting another exception, but I suspect my code MariaDB server - I will open a new thread, thanks for your help horst ! @Entil`zha could you update the module ?1 point
-
# exclude the whole big-data-stuff /site/assets /site/assets/* wire /wire/* index.php .htaccess /.*/ /.* Where's the mess?1 point
-
@ivan see Macrura's post that Module is doing exactly that. ( and you should remove the if template statement ) The URL get indexed with search engines and are shared on social media & mail etc. Then changing the title will result in a 301 or in worse case a 404. There are situations where it is desirable that the url changes and thus trowing a 404, but to make this the default behaviour is bad practise in my opinion.1 point
-
i tried Pete's code but it wasn't working; i made some changes based on seeing similar things on other modules, so here is a version that is working for me on latest stable: <?php class BuildUrl extends WireData implements Module { /** * Basic information about module */ public static function getModuleInfo() { return array( 'title' => 'Build URL', 'summary' => 'Builds a URL on page save based on specific fields.', 'href' => '', 'version' => 001, 'permanent' => false, 'autoload' => true, 'singular' => true, ); } /** * Initialize the module and setup hooks */ public function init() { $this->pages->addHookAfter('saveReady', $this, 'buildUrl'); } /** * * @param HookEvent $event */ public function buildUrl($event) { // Accesses the $page object $page = $event->arguments[0]; if($page->template != 'product-child') return; $page->name = $page->title; $this->message("slug changed to " . $page->name); } }1 point