Leaderboard
Popular Content
Showing content with the highest reputation on 08/14/2014 in all areas
-
u will.go 2 admin ...modulos ... ...core ... ... ...process ... ... ... ...search i accept.s paypal mom.sayd no5 points
-
I'm not sure what PW version you are referencing but in the current dev version the search box makes use of the new Lister. By default the search box will only search 'title' fields, which in my opinion is a sane default. If you want 'advanced' search you can go directly to 'Find' via the top navigation. From there you can comprise a very detailed 'find' by applying filters. So 1-step is available. As an extra shortcut i wouldn't be against an 'advanced find' icon/link to the right of the default searchbox but i'm not sure this is needed. See screens for details:4 points
-
3 points
-
This isn't currently supported and needs a new option for CKEditor module to work. CKEditor itself has support for custom config file. So far I can't see why this wouldn't be doable, either. This is how config load order is explained in the CKEditor docs: An editor instance is created. At this point all its default configuration options are set. If the customConfig setting has been set "in-page", that file is loaded, otherwise the default config.js file is loaded. All settings in the custom configuration file override current instance settings. If the settings loaded in step 2 also define a new customConfig value, another custom configuration file is loaded and its settings override current instance settings. This happens recursively for all files until no customConfig is defined. Finally the settings defined "in-page" override current instance settings (except customConfig, which has been used in step 1). I'll also have to agree that this is very important option to have. Config.js (in one form or another) is meant to be customised.3 points
-
Update: Minor version bump to 1.2.1 after some minor styling issues updates. Documentation: I am taking a short break from writing code to write some badly needed documentation for Blog (and some other PW tutorials if I get time ). I am writing this documentation as tutorials which I will post on my website soon. I'll keep you updated. I haven't forgotten any Blog features pending requests3 points
-
Update: Apertus is abandoned in favor of a fork of the far more advanced Admin Theme Reno, "SuperReno". Download the current version on GitHub: https://github.com/marcus-herrmann/AdminThemeSuperReno An AdminTheme meant for developers Still en route to an enhanced version of the Knowledge Base Site Profile I'm now releasing an AdminTheme suited for said profile, sharing its design. This is, as usual, an early, not yet heavily tested release. It is intended to be activated for superusers only, since other themes such as Modesta or the default one are much more apt to customers and editors. Requirements Current ProcessWire 2.4.X Developement version A modern browser (but I think that's the last thing a developer is missing) Download | Project on GitHub Features Some of us work on a large number of ProcessWire installations at once. The following options aim to customize your backends to that extent that you can tell them apart within miliseconds and without looking at the URL. Therefore, within the theme's configuration (meaning: the module's settings), you can change the following: Environment indicator When using a development, staging and production version of a project, use this little switch in the theme's setting to indicate which installation you're currently on. Set main color In order to not confuse installations using Apertus, "color brand" them. Use hex, rgb(a), hsl(a), or named CSS values to your liking, but remember to apply a relatively dark color to prevail contrast. Set project name Lastly, name project backends. Shortcuts Search the forums from within every page of your ProcessWire backend Have all the important API documentation links at hand Check for new modules from every page using the tools upper right (refresh icon) Installation Copy all files from the ZIP archive to your /site/modules/ApertusAdminTheme/ directory. Click "Check for new modules" in ProcessWire Admin Modules screen. Click install for the module labeled: "Apertus Admin Theme". Background The design of this Admin Theme is based on my Knowledge Base Site Profile. Also, it is created to accompany a newer version of said Site Profile. This is the first version of Apertus, not yet heavily tested and therefore bleeding edge. Please use with caution. I named it "Apertus" (latin for open, uncovered) because of the default state of the main navigation (Page, Modules, Access,...). This is a pre-release (0.0.1) needing current dev version of PW to prepare for ProcessWire 2.5. Please help me improving the theme by reporting bugs on GitHub. Thanks! Roadmap Things I intend to implement/change in future versions: Making useful links configurable Proper responsive behaviour Refactoring JS Remove Compass dependency when compiling theme's CSS /edit: Added screenshots clarifying where to find theme's settings1 point
-
Disclaimer This is not a step by step tutorial, but the script posted serves as an example of how easy it is to bootstrap ProcessWire(PW), query an external API (in this case, Strava) and import stuff into PW pages using the PW API. To the import! So i wanted a quick, easy and automated way to import someones Strava activities into his/her own 'activity feed' on a certain PW website. Strava has an API which you can use to -amongst other things- get your own activity data. After setting up my Strava app i had access to the API. Next step was to import the JSON data i wanted into PW pages. This was as easy as creating a PW bootstrapped script (see code below) and using the PW API to import the data into Pages. For convenience in talking to the Strava API i used a library that is available on Github. To keep track of what was happening i decided it would be nice to log the import results to a log file. Luckily, PW had me covered by using the WireLog class (/wire/core/WireLog.php). Result With some googling on Strava and a (very) basic knowledge of PHP and the PW API i was able to get things working in no-time. With no other CMS i've worked with -and i've had dealings with quite a few- it would have been so easy to get the desired result. Some notes about the script: PW version used: 2.4.12, but should work in earlier versions as well. It does not create templates, fields and pages for you. If you would want to use it (maybe as a starting point), create templates, fields and pages for your own needs and adjust the script accordingly. Also remember to adjust script paths. In the posted example i don't do any sanitizing on the Strava data. You maybe should In production you would maybe call these kind of importers via a cronjob, and make it non-accessible from the outside. It served my purposes. There might be better ways of handling this stuff. All suggestions and/or questions are welcome. In this case the script was/is called importer_strava.php , located at mydomain/importer/importer_strava.php and requested manually. See notes above, number 3. <?php /** * Strava Importer * * This crude script will import your own Strava activities into newly created * PW pages under a given parent page. The import result will be logged in: * /site/assets/logs/importer_strava.txt, using the WireLog class. * * For this to work you first need to create an app via http://www.strava.com/developers * Strava API reference: http://strava.github.io/api/ * * The PHP library used for working with the Strava v3 API can be found at: * https://github.com/iamstuartwilson/strava * */ // Bootstrap Processwire include __DIR__ . '/../index.php'; // Include the PHP Library for working with the Strava v3 API include __DIR__ . '/StravaApi.php'; // Strava credentials (you can get these from the Strava app page you've created) $clientId = "Your clientId"; $clientSecret = "Your clientSecret"; $accessToken = "Your accessToken"; // Connect to Strava $api = new StravaApi( $clientId, $clientSecret ); // Set the parent where activities will be stored as child pages $activity_parent = wire('pages')->get("/activities/"); // Get new activities $results = $api->get( 'athlete/activities', $accessToken, array( 'after' => $activity_parent->strava_last_checked ) ); // Uncomment if you want to inspect the $results response onscreen // echo "<pre>"; // print_r($results); // echo "</pre>"; // Import new Strava activities to PW Pages if (empty($results)) { // Log that no activities have been imported $text = "No new activities have been imported"; $options = array('showUser' => false, 'showPage' => false); wire('log')->save('importer_strava', $text, $options); } else { $numImportedPages = 0; // Start counter for number of imported pages foreach ($results as $result) { $p = new Page(); // Create new page object $p->template = 'activity'; // Set template $p->parent = $activity_parent; // Set the parent // Assign $result data to the corresponding Page fields $p->name = $result->id; $p->title = $result->name; $p->act_distance = $result->distance; $p->act_moving_time = $result->moving_time; $p->act_elapsed_time = $result->elapsed_time; $p->act_total_elevation_gain = $result->total_elevation_gain; $p->act_type = $result->type; $p->act_start_date = substr($result->start_date_local, 0, 10); $p->act_average_speed = $result->average_speed; $p->act_start_lat = $result->start_latlng[0]; $p->act_start_long = $result->start_latlng[1]; $p->act_end_lat = $result->end_latlng[0]; $p->act_end_long = $result->end_latlng[1]; $map = $result->map; $p->act_map_polyline = $map->summary_polyline; $p->save(); // Save the Page object $numImportedPages++; // Increment counter } // Log the number of activities that have been imported $text = ($numImportedPages == 1) ? "$numImportedPages new activity imported" : "$numImportedPages new activities imported"; $options = array('showUser' => false, 'showPage' => false); wire('log')->save('importer_strava', $text, $options); // After the import, update Field 'strava_last_checked' to current Unix timestamp // This could also be placed outside of the 'else' to update on each script run $timestamp = $activity_parent; $timestamp->of(false); // Turn off output formatting before saving things $timestamp->strava_last_checked = time(); $timestamp->save('strava_last_checked'); }1 point
-
new german updates for actual PW dev 2.4.12 (14 August 2014). Zip contains only updated/added files (in comparison to the default 2.4 lang pack). updated files: wire--modules--inputfield--inputfieldckeditor--inputfieldckeditor-module.json wire--modules--process--processforgotpassword-module.json pw-lang-de-dev-update.zip1 point
-
Glad you got things sorted, apart from number 2. About number 2: I don't think this is possible using the out-of-the-box admin tools. I have not needed something like this, so i can't do anything for you apart from digging up a quite old thread about just such a question: https://processwire.com/talk/topic/1176-hiding-uneditable-pages-from-users/ It's a good read, with comments from Ryan himself. If since then, new (admin) options have been introduced i'm sure someone else will guide you to a better solution.1 point
-
I guess that's somehow a javascript / jQuery thing (404 instead of 403). Maybe it just recognized that the page is not accessible and therefore can not be found. http://stackoverflow.com/questions/17509717/jquery-returns-status-code-404-instead-of-4031 point
-
1 point
-
Good to know. I have marked Nico's post as the best answer given his solution worked for you. Btw, I am curious why you were getting 404s as opposed to 403s?1 point
-
Handling the PHP file as a PW template worked like a charm! Thanks a lot for your help!1 point
-
This weekend is full with time killers but until i've the chance i 'all make a screenshot...1 point
-
believe me... I'm neither using Foundation (as framework) nor javascript for sticky footers1 point
-
There is also Soma's Template Notes module - http://modules.processwire.com/modules/template-notes/1 point
-
I think you might have found a hidden feature there Actually not hidden - the instructions mention you can do that - the ability to create multiple templates with space separated names But Nico is saying to use the Label field - this is collapsed by default and only available once the template has already been saved.1 point
-
This is going to be really useful for me too - on larger sites I often remember to upload changes to template files but miss a critical change I made in one field or forgetting to add a field to a template. Obviously it's not going to stop me being absent-minded from time to time, but it will help ensure I've got things configured the same over dev and live1 point
-
Yup, you can temporarily add it to a page, or you could bootstrap a special file for running scripts like this, or you could use the "Save and Test" option in Hanna Code, or even my Code Tester module.1 point
-
Yes got it Adrian. What you said in your post before me put me on the right track. It´s working Add a new blog post and on the bottom there is a drop down list where you can chose the category and also what you said before add a new category !! Thanks a lot. Edit: yes, sorry forgot to click best answer.1 point
-
Hello everybody, we've just released PassiveCron & cron.pw as a beta version. Also check out the PassiveCron demo module, to learn how to integrate cron.pw inside a module. Follow @cronpw on Twitter to get notified about downtimes and updates. Thank you in advance for your feedback! Marvin1 point
-
I see that Hani has merged Nico's fixes so should be all good: https://github.com/Hani79/Processwire_FieldType_Select_Drop_Down/commit/d2f3a15da5690b535b908dc7fe4644201ebd6eed1 point
-
Stop the presses! I must not have been thinking clearly yesterday. I pulled in the latest changes, updated the PW instance in question and went on to test it on the wrong domain, which still had the old code I guess this is a good lesson to not have too many quite similarly named test domains. So long story short: Latest dev has fixed the issue for me. As for the other one, this also seems to have to do with me exporting from an old install and importing that in a new (current dev) install. So everything is looking fine running the dev where the latest commit is '6ee2d96737fa64681fd3aefc65529ffca194f987'. I'm gonna go away now and hide in shame1 point
-
One way is to well redirect to another page that is only a text page instead after sending email... // if no errors, email the form results if(!$error) { $msg = "Full name: $form[fullname]\n" . "Email: $form[email]\n" . "Comments: $form[comments]"; mail($emailTo, "Contact Form", $message, "From: $form[email]"); $session->redirect("/some/thankyoupage/"); // populate body with success message, or pull it from another PW field // $page->body = "<h2>Thank you, your message has been sent.</h2>"; // $sent = true; }1 point
-
Maybe in beginning of your prepend template (ie. _head.inc) something like this: if ($page->is("template=rss|specialtemplate")) return;1 point
-
There's really not much to it, as json_encode() and json_decode() built-in to PHP provide everything you need to go to/from an array to JSON. So the main thing you have to do is just provide the data to FullCalendar in the format it is looking for. Most of your work will just be translating the format that the events come to you in, to a format that is useful to FullCalendar. In my case, my calendar template looks something like below. This is not the actual code I'm using, but it gets across all the important parts. Note that the getEventById(), getEventsByDateRange() and renderEvent() functions referred to below are fictional functions that do exactly what they say. I don't know what your event data source is, so how those functions are implemented would depend entirely on where the data is actually coming from. So think of them as placeholders for your implementation. /site/templates/cal.php function eventsToJSON(array $events) { $items = array(); foreach($events as $event) { // translate events from some source to a format recognizable by fullCalendar $items[] = array( 'id' => $event['id'], 'title' => $event['description'], 'start' => "$event[start_date] $event[start_time]", 'end' => "$event[end_date] $event[end_time]", 'url' => "./$event[id]", // event ID is the url segment ); return json_encode($json); } if($input->urlSegment1) { // event ID provided as a URL segment to this page $event = getEventById((int) $input->urlSegment1); include("./head.inc"); echo renderEvent($event); include("./foot.inc"); } else if($config->ajax && $input->get->start && $input->get->end) { // fullCalendar making an ajax request of events $start = (int) $input->get->start; $end = (int) $input->get->end; $events = getEventsByDateRange($start, $end); echo eventsToJSON($events); } else { // display the calendar $config->scripts->add($config->urls->templates . 'scripts/fullcalendar/fullcalendar/fullcalendar.min.js'); $config->styles->add($config->urls->templates . 'scripts/fullcalendar/fullcalendar/fullcalendar.css'); $config->scripts->add($config->urls->templates . 'scripts/cal.js'); include("./head.inc"); echo "<div id='calendar'></div>"; include("./foot.inc"); } FullCalendar gets instantiated by javascript, something like this: /site/templates/scripts/cal.js $(document).ready(function() { $("#calendar").fullCalendar({ theme: false, editable: false, events: "./", defaultView: 'month', aspectRatio: 4, header: { left: 'today prev,next', center: 'title', right: 'month,basicWeek,basicDay' }, eventClick: function(event) { window.location.href(event.url); // or load it in a modal } }); });1 point
-
Soma, sounds like you've got it right. If you want the default language to be German, then just throw in the German files into the default language. There's nothing English about the default language except for the name "default" (which you uncovered the reasons for). But if you want to connect the language to a code like "de", then I suggest creating a new field called language_code and adding it to the language template. When you want to select a language, just use "language_code=de" in your selector. When you create your English language as an alternate, you won't need to upload any JSON files for the admin side of PW unless you want to change the English that is already there. I don't think there's any reason to gravitate towards keeping 'default' as English, unless it really is your site's default language. But if you want to do that for some reason, then you would just edit the 'guest' user account and change guest's language to to be 'de' or whatever you want your site's default language to be.1 point
-
For security reasons, PW forces a "403 forbidden" if someone tries to directly access any PHP files in the /site/templates/ dir, as well as several other locations in PW's file system. So it's best not to put any PHP files that you need to directly access in any of ProcessWire's directories, because there's a good chance it'll block access to them. Here are a few alternatives: Option 1. Place your sendemail (and optionally phpmailer include) files somewhere outside of PW's directories. For instance, maybe you could create a dir called /form/ off your web root and place them in there. Then set your form to: action='/forms/sendemail.php' Option 2. Use your sendemail.php as a ProcessWire template. Create a page using that template, and make your form post to that page. Option 3. (the one that I use most often) Make your form post to the same page that it's on (i.e. action='./'). When you see one of your POST vars present, include your form processing script. i.e. <?php if($input->post->submit) { // process contact form include("./includes/sendemail.php"); } else { // output contact form }1 point
-
Double check what you're calling size() on. This sort of error happens [mostly], when: You have an error in your code – chance is, your field is called 'images' and you're calling 'image' You have another type of error in your code – calling image function on ImageArray, for example [rather than $images->size, you want something like $images->eq(0)->size() There is nothing uploaded yet. This happens, when your code is okay, but isn't prepared to receive no data, and, in fact, does receive no data Also, there might be problem with what Ryan posted, but if history taught us anything, it's that Ryan's code is mostly ok.1 point