Leaderboard
Popular Content
Showing content with the highest reputation on 01/21/2016 in all areas
-
@tpr - I have just added an option to modify the breadcrumbs to remove pages that are outside the restricted branch. It seems to be working well here, but please let me know if you notice any problems. It's a new config setting option that needs to be checked. This example is for a user restricted to "Branch One" Modified Breadcrumb: Full / Unmodified Breadcrumb:4 points
-
// You need to to have the setting set: return null page if none selected. // When there's no page, a nullpage is returned, that page has ID 0, thus evaluates to false if ($myVariable->pageField->id) echo "<a href='{$myVariable->pageField->url}'>Link to Selected Page</a>";3 points
-
2 points
-
https://processwire.com/talk/topic/3429-how-to-set-text-linecharacter-limits-in-templates/#entry33748 regards mr-fan2 points
-
The docs says: $page->of(false); // outputFormatting must be OFF https://processwire.com/api/multi-language-support/multi-language-fields/#getting-and-setting "The value of a multi-language or language-alternate field is affected by the "outputFormatting" setting of a page. On the front-end of your site, outputFormatting is always turned on, unless you've turned it off." "When outputFormatting is ON, the value of a multi-language field is a string (as it shows in most examples on this page). That string reflects the value from the current user's language. If the value is blank in the current user's language, the value from the default language will be there instead. However, when outputFormatting is OFF, the value of a multi-language field (like $page->body) will instead return an object of type LanguagesPageFieldValue, rather than a string. That object contains all of the translations available for the given field." I'm not sure that this solves anything, I'm just guessing. Sorry if I'm mistaken.2 points
-
/* Using regular expression */ $firstTwenty = trim(preg_replace('/^\s*((?:\S+\s+){20}).*/', '$1', $inputText)); /* Using split and combine */ $firstTwenty = implode(' ', array_slice(explode(' ', $inputText), 0, 20));2 points
-
Just wanted to wrap this up and let folks know that the problem that @Christophe discovered with AdminRestrictBranch has been fixed.2 points
-
You could possibly use a PageField and using "Custom selector to find selectable pages" with the custom selector parent=page. I asked this recently and that's the best way to do it. For the actual dates - Is the date used as the title? if so that should be fine. If not use "Label field" and use your date field. This should give you a drop down with all the dates and selecting them will create that relationship with the cruise page.2 points
-
will media manager support, beside self-uploaded videos, how about video content provider like youbue. For instance, add a youtube link in media manager Such that I can browse youtube videos added in the media repository2 points
-
Video clip showing latest development...(note: previews of other types other than images are still a work in progress...)2 points
-
Wire Mail SMTP An extension to the (new) WireMail base class that uses SMTP-transport This module integrates EmailMessage, SMTP and SASL php-libraries from Manuel Lemos into ProcessWire. I use this continously evolved libraries for about 10 years now and there was never a reason or occasion not to do so. I use it nearly every day in my office for automated composing and sending personalized messages with attachments, requests for Disposition Notifications, etc. Also I have used it for sending personalized Bulkmails many times. The WireMailSmtp module extends the new email-related WireMail base class introduced in ProcessWire 2.4.1 (while this writing, the dev-branch only). Here are Ryans announcement. Current Version 0.8.0 (from 2024-09-25 -- initial version 0.0.1 was pushed on 2014-03-01) Changelog: https://github.com/horst-n/WireMailSmtp/blob/master/CHANGELOG.md Downlod: get it from the Modules Directory || fetch it from Github || or use the module-installer in PWs admin site modules panel with its class name "WireMailSmtp". Install and Configure Download the module into your site/modules/ directory and install it. In the config page you fill in settings for the SMTP server and optionaly the (default) sender, like email address, name and signature. You can test the smtp settings directly there. If it says "SUCCESS! SMTP settings appear to work correctly." you are ready to start using it in templates, modules or bootstrap scripts. Usage Examples The simplest way to use it: $numSent = wireMail($to, $from, $subject, $textBody); $numSent = wireMail($to, '', $subject, $textBody); // or with a default sender emailaddress on config page This will send a plain text message to each recipient. You may also use the object oriented style: $mail = wireMail(); // calling an empty wireMail() returns a wireMail object $mail->to($toEmail, $toName); $mail->from = $yourEmailaddress; // if you don't have set a default sender in config // or if you want to override that $mail->subject($subject); $mail->body($textBody); $numSent = $mail->send(); Or chained, like everywhere in ProcessWire: $mail = wireMail(); $numSent = $mail->to($toEmail)->subject($subject)->body($textBody)->send(); Additionaly to the basics there are more options available with WireMailSmtp. The main difference compared to the WireMail BaseClass is the sendSingle option. With it you can set only one To-Recipient but additional CC-Recipients. $mail = wireMail(); $mail->sendSingle(true)->to($toEmail, $toName)->cc(array('person1@example.com', 'person2@example.com', 'person3@example.com')); $numSent = $mail->subject($subject)->body($textBody)->send(); The same as function call with options array: $options = array( 'sendSingle' => true, 'cc' => array('person1@example.com', 'person2@example.com', 'person3@example.com') ); $numSent = wireMail($to, '', $subject, $textBody, $options); There are methods to your disposal to check if you have the right WireMail-Class and if the SMTP-settings are working: $mail = wireMail(); if($mail->className != 'WireMailSmtp') { // Uups, wrong WireMail-Class: do something to inform the user and quit echo "<p>Couldn't get the right WireMail-Module (WireMailSmtp). found: {$mail->className}</p>"; return; } if(!$mail->testConnection()) { // Connection not working: echo "<p>Couldn't connect to the SMTP server. Please check the {$mail->className} modules config settings!</p>"; return; } A MORE ADVANCED DEBUG METHOD! You can add some debug code into a template file and call a page with it: $to = array('me@example.com'); $subject = 'Wiremail-SMTP Test ' . date('H:i:s') . ' äöü ÄÖÜ ß'; $mail = wireMail(); if($mail->className != 'WireMailSmtp') { echo "<p>Couldn't get the right WireMail-Module (WireMailSmtp). found: {$mail->className}</p>"; } else { $mail->from = '--INSERT YOUR SENDER ADDRESS HERE --'; // <--- !!!! $mail->to($to); $mail->subject($subject); $mail->sendSingle(true); $mail->body("Titel\n\ntext text TEXT text text\n"); $mail->bodyHTML("<h1>Titel</h1><p>text text <strong>TEXT</strong> text text</p>"); $dump = $mail->debugSend(1); } So, in short, instead of using $mail->send(), use $mail->debugSend(1) to get output on a frontend testpage. The output is PRE formatted and contains the areas: SETTINGS, RESULT, ERRORS and a complete debuglog of the server connection, like this one: Following are a ... List of all options and features testConnection () - returns true on success, false on failures sendSingle ( true | false ) - default is false sendBulk ( true | false ) - default is false, Set this to true if you have lots of recipients (50+) to ($recipients) - one emailaddress or array with multiple emailaddresses cc ($recipients) - only available with mode sendSingle, one emailaddress or array with multiple emailaddresses bcc ($recipients) - one emailaddress or array with multiple emailaddresses from = 'person@example.com' - emailaddress, can be set in module config (called Sender Emailaddress) but it can be overwritten here fromName = 'Name Surname' - optional, can be set in module config (called Sender Name) but it can be overwritten here priority (3) - 1 = Highest | 2 = High | 3 = Normal | 4 = Low | 5 = Lowest dispositionNotification () or notification () - request a Disposition Notification subject ($subject) - subject of the message body ($textBody) - use this one alone to create and send plainText emailmessages bodyHTML ($htmlBody) - use this to create a Multipart Alternative Emailmessage (containing a HTML-Part and a Plaintext-Part as fallback) addSignature ( true | false ) - the default-behave is selectable in config screen, this can be overridden here (only available if a signature is defined in the config screen) attachment ($filename, $alternativeBasename = "") - add attachment file, optionally alternative basename send () - send the message(s) and return number of successful sent messages debugSend(1) - returns and / or outputs a (pre formatted) dump that contains the areas: SETTINGS, RESULT, ERRORS and a complete debuglog of the server connection. (See above the example code under ADVANCED DEBUG METHOD for further instructions!) getResult () - returns a dump (array) with all recipients (to, cc, bcc) and settings you have selected with the message, the message subject and body, and lists of successfull addresses and failed addresses, logActivity ($logmessage) - you may log success if you want logError ($logmessage) - you may log warnings, too. - Errors are logged automaticaly useSentLog (true | false) - intended for usage with e.g. third party newsletter modules - tells the send() method to make usage of the sentLog-methods - the following three sentLog methods are hookable, e.g. if you don't want log into files you may provide your own storage, or add additional functionality here sentLogReset () - starts a new LogSession - Best usage would be interactively once when setting up a new Newsletter sentLogGet () - is called automaticly within the send() method - returns an array containing all previously used emailaddresses sentLogAdd ($emailaddress) - is called automaticly within the send() method Changelog: https://github.com/horst-n/WireMailSmtp/blob/master/CHANGELOG.md1 point
-
1 point
-
Let says , return first 20 words of a paragraph1 point
-
------------------------------------------------------------------------------ This is officially released now with some fixes and a second storage handler based on SQLite3. ------------------------------------------------------------------------------ WireQueue WireQueue is a module that allows easy creation and usage of Queues in ProcessWire. It is based upon a basic (parent) module that can or should have one or multiple StorageHandler modules. This alpha pre release contains a basic plain text storage module, WireQueueTextfile. The base module creates the needed: FIELDS (wire_queue_type, wire_queue_state, wire_queue_storage_options) TEMPLATES (wire-queue-container, wire-queue-storage, wire-queue-tools) PAGES (wire-queues = container for all Queuepages, wire-queue-storages = container for StoragetypePages) ROLE (wire-queue-admin) Each storage module creates one page under wire-queue-storages. New Queues can be created in the backend by adding a new page under "Wire Queues". After creation one have to select a Storage type from availables list and publish the page. After that, there are some buttons available to start / pause / and close the queue. Putting and getting data to and from the queue is done via API calls. First you have to get the page that holds the queue object. // get and validate the queue handle if($queue = $pages->get(SELECTOR_TO_DESIRED_PAGE)->WireQueue()) { // wrap your data into an array and pass it into the queue $success = $queue->addItem($data); ... } // get and validate the queue handle if($queue = $pages->get(SELECTOR_TO_DESIRED_PAGE)->WireQueue()) { $data = $queue->getItem(); ... } Thats basically all what you want from a queue. Following are a few conveniences: $queue->getPage()->title gives you the title of the queue, ($queue->getPage() returns the page object) $queue->className() shows the StorageType of the queue $queue->getState() and $queue->getStateStr() returns the current state of a queue: 1 = new / empty 2 = enabled / running 3 = paused 4 = closed / archived $queue->itemCount() gives the total number of all pending items in the queue Here is code that gives an overview of all Queues in the system: $container = $pages->get('template=wire-queue-container'); $bodyContent = "<h1>$container->title</h1>"; $bodyContent .= "<p>There are currently {$container->numChildren} Queues defined:</p>"; $bodyContent .= "<ul>"; foreach($container->children() as $p) { if(! ($queue = $p->wireQueue())) continue; $bodyContent .= "<li>{$queue->getPage()->title}<ul>"; if(!$queue->ready2use()) { $bodyContent .= "<li>{$queue->className}</li>"; $bodyContent .= "<li>This Storagetype is not ready to use! The System seems not to provide all requirements.</li>"; $bodyContent .= "</ul></li>"; continue; } $bodyContent .= "<li>{$queue->className}</li>"; $bodyContent .= "<li>{$queue->getStateStr()} ({$queue->getState()})</li>"; $bodyContent .= "<li>Currently are {$queue->itemCount()} items pending!</li>"; $bodyContent .= "</ul></li>"; } $bodyContent .= "</ul>"; Following are a screenshots of the backend The module is on Github: https://github.com/horst-n/WireQueue Would be nice if someone has time and can test it a bit and report back.1 point
-
Yep - hover links are now default in the core although it can be disabled with a config setting: https://processwire.com/blog/posts/processwire-core-updates-2.5.26/#pagelist-now-supports-hover-actions They do work a little differently in the core than with that custom css. In the core you have to mouseover the Title of the page, but with that CSS you can mouseover anywhere on the line which I actually prefer.1 point
-
I know you are looking for a simple solution. I have not tried, but have heard some greatness about Caddy Server https://caddyserver.com/ > Available for Windows, Mac, Linux, and BSD. > https://caddyserver.com/developers Their page shows lots of great features. May be the simplest way for you. I will also give it a shot on another computer of mine as I currently run a full LAMP stack on my desktop. Please let us know how it works for you!1 point
-
Ah yes, now it works. I didn't realize you had to save the other page. Thanks!1 point
-
1 point
-
Yes...there's the (commercial) module Padloper... You would have to do some work to get your shop to look just the way you want but Padloper comes with very good documentation Welcome to the forums1 point
-
I'm guessing that some new rewrite rule the SEO guys added caused it to start using those ?it= URLs, revealing them when it usually wouldn't. For instance, maybe they setup a rewrite rule that makes /index.php redirect to "/" without getting it quite right, thereby interfering with PW's own rewrite rules. I would suggest removing whatever rule they added that's causing the interference, and then putting your own alternative in a /site/ready.php or /site/templates/_init.php (if using one), like this: if(preg_match('/(index\.php|[?&]it=/!', $_SERVER['REQUEST_URI'])) { throw new Wire404Exception(); } Or if you just want to make it redirect to the homepage, replace the exception line with $session->redirect($config->urls->root); I will add something similar to the core ProcessPageView module to prevent that possibility too.1 point
-
You could set two image fields - one for the CKE main content block and separate image fields for stuff like gallery... Here is a example screenshot and the question on the upload field buttons in CKE: https://processwire.com/talk/topic/11516-is-it-possible-to-specify-an-image-upload-field-for-uploading-images-in-ckeditor/ In general you have to assing a imagefield on the template and then the image should uploaded to that field while using it in CKE... https://processwire.com/blog/posts/processwire-core-and-profields-updates-2.5.22/ regards mr-fan1 point
-
If you only have to support modern browsers, look into CSS Column Layout http://caniuse.com/#search=columns http://webdesign.tutsplus.com/tutorials/an-introduction-to-the-css3-multiple-column-layout-module--webdesign-49341 point
-
I think what you are looking for are chained/dynamic/dependant selects. ...http://www.appelsiini.net/2010/jquery-chained-selects There's been some talk before in the forums, e.g. this one: https://processwire.com/talk/topic/8729-how-to-create-a-form-with-dynamic-select-list-filtering-available-values-by-multiple-fields/1 point
-
Thank you for taking the time to look into this. Unfortunatley this doesn't apply to my situation because I already switch off output formatting right before the foreach loop $editpage->setOutputFormatting(false); foreach($form as $field) { // here is where I need to get the multi language values $editpage->set($field->name, $field->value); }1 point
-
When using the Forms API $form->processInput($input->post); will proces the input, but also pre-populate the ->value(s) of the fields.1 point
-
I guess you have an up-to-date version of MAMP (which I do not have at the moment since I do not upgrade MAMP too often) https://www.mamp.info/en/downloads/ And reading the sidebar, it ships with PHP 7.0.0 too. Do you happen to use it? I run ProcessWire 3.0.5 on PHP 5.6 and do not have any "deprecated notices". Anyway, since it is just a "deprecated notice", it should not be the cause of a 500 Internal Server error, but you might want to try switching to PHP 5.6. Have you tried to install ProcessWire from scratch, so that you can see if that works? Edit: PHP 7 maybe just an optional addon, and it does not yet ship with it.1 point
-
What sort of errors are you getting? You can find the log files here: /Applications/MAMP/logs/apache_error.log /Applications/MAMP/logs/mysql_error.log /Applications/MAMP/logs/php_error.log or just use MAMP's Log menu.1 point
-
As adrian's answer shows you'll need to save the member page, not the user. The user page just holds the reference to the member page, but the fielddata of both pages are fully unrelated to one another.1 point
-
This works for me: $user->of(false); $user->member->gender = 123; $user->member->save("gender"); EDIT: or for something even simpler using the new method introduced in 2.6.9 (https://processwire.com/blog/posts/processwire-2.6.9-core-updates-and-new-procache-version/#new-page-gt-setandsave-method): $user->member->setAndSave('gender', 123);1 point
-
Here is the link to Soma's post about: https://processwire.com/talk/topic/2089-create-simple-forms-using-api/ Or topic / hint about session saved values https://processwire.com/talk/topic/8488-form-api-store-data-in-session-and-repopulate-hint/ I use an extended InputfieldForm object with FormHelper module: https://processwire.com/talk/topic/7860-module-formhelper/1 point
-
Have you seen this as well? https://processwire.com/talk/topic/4451-menu-builder/?p=95415. For such sites, you can also pass the $page object or an array of menu items. This is also mentioned in the readme PS: Moving this topic to MB support forum...1 point
-
A dummy button for sorting items with JavaScript wouldn't work? Then use the default save button to save the page. This could be automatized adding a Js event to the save button.1 point
-
I see that PW is using the procedural date() in many places, rather than Datetime() which supports dates before 1901: http://stackoverflow.com/questions/18579567/change-the-format-of-dates-before-1900-without-using-explode I wonder if this should be a Github issue? EDIT: https://github.com/ryancramerdesign/ProcessWire/issues/16241 point
-
Example for a use case with importing things. This is a raw draft with a bit pseudo code: // you have created a queue in PW, the ID of the page is 2000 for example // here is some skeleton code for an importer that uses this queue // get and validate the queue handle if(! ($queue = $pages->get('id=2000')->wireQueue())) exit(); // we could not get the Queue page // now start to scan / read data for your imports, wrap each record into an array and put it into the queue foreach($pages->find(YOURSELECTOR) as $p) { $data = array($p->field1, $p->field2); $queue->addItem($data); } // now start to process your items by pulling one after the other from the Queue while($timer < $maxtime) { $data = $queue->getItem(); // process the $data ... } $session->redirect('./');1 point
-
I am also one of those weirdos without a Facebook or Twitter account - I'd much rather read the PW forum or Github activity. That said I am often accused of staring at my wife's computer when she is looking at friend's photos on FB, so I guess I am a social media voyeur rather than exhibitionist.1 point
-
u.mite alsos check admin->modulos->site-> langoges tabs if u.see it.it is old modulo { cluck->uninstall->delete echo"thanksu willyc" ; }1 point
-
Hi Peter, Did you clear your browser cache? That my help. If not, check the javascript console for any errors. Cheers1 point
-
my beginners guide is now live on Tuts+: How to install and setup PW CMS http://webdesign.tutsplus.com/tutorials/how-to-install-and-setup-processwire-cms--cms-25509 I also saw that Francesco Schwarz post went live today: 4 Reasons to Choose ProcessWire as Your Next CMS http://code.tutsplus.com/articles/4-reasons-to-choose-processwire-as-your-next-cms--cms-250621 point
-
Must say, I'm still quite a fan of 7 - very efficient system. Never really got used to the whole start screen concept, and can't say I'm too fond of the win10 start menu. As much as I use both 8 and 10, I'll always regard 7 as one of the best releases of Windows.1 point
-
Update: Version 4 Up on GitHub Changes In addition to the using a custom selector to filter for selectable page markers, you can now also use custom PHP Code. NOTE: (a) Custom PHP code will only work with the Asm Select page selector option. (b) Custom PHP code overrides custom selector if set Will submit to Modules Directory once I have done the README (might take a while...) ps: Updated first post to reflect current status...1 point
-
I just noticed, that this might actually be a great option for packing offline, html+js only apps for clients (e.g. localstorage needs an server to function). Just let them double-click the thing and it's working.1 point
-
Conclusion, we are weird anti social people. Ok, jokes asides, it seems to be the trend with the type of developers Processwire attracts as diogo stated. I also think that also the very nature of Processwire makes it a bit "anti marketing buzz". We just won't be seeing: "10 MODULES YOU CAN'T LIVE WITHOUT" and I think that because this "markets" don't really exist in the PW related dev world. I wonder if we should take a look at what other frameworks more like Laravel are outputting to the social media. Ironically, I started using Twitter a lot more recently to basically get more involved with anyone out there who is using Processwire.1 point
-
Depending on the setup of the server as subdomain might need another rewritebase in the .htaccess file.1 point
-
I have a model field that depends on the selected manufacturer. Its options update upon manufacturer selection (both are page select fields). In my model field > Input tab > Selectable Pages > Custom selector, I have: parent=page.make, template=model, sort=title, include=all Where 'make' is the name of my manufacturer field. Try that?1 point
-
Thanks Sinmok and netcarver. It would be really useful when we are using a front-end framework like Bootstrap. <?php $list = $pages->find("template=basic-page"); // Returns 5 pages $chunked = array_chunk($list->getArray(), 3); ?> <?php foreach($chunked as $i => $row): ?> <div class='row'> <?php foreach($row as $item) : ?> <div class="col-md-4"> <?php echo $item->title; ?> </div> <?php endforeach; ?> </div> <?php endforeach; ?>1 point
-
What Martijn said!! And sshaw has also given you some great advice, and a great list from teppo. As mentioned above, you will learn everything you need to know about Processwire from the API documentation, and from posting on the forums here. We're a friendly bunch That said, it never hurts to learn some PHP, and it will stand you in good stead in PW and beyond, when you want to extend and expand things. Lots of good resources posted here, here's one more: http://devzone.zend.com/6/php-101-php-for-the-absolute-beginner/1 point