-
Posts
807 -
Joined
-
Last visited
-
Days Won
10
Everything posted by kixe
-
The following code snippet wraps an image with an anchor tag, if the first word of the image description matches a pagename of a page in your page tree $image = $page->images->first(); $selector = strstr($image->description,' ',true)?strstr($image->description,' ',true):$image->description; $selector = trim($selector,"\W"); // trim punctuation $linkpage = $pages->get('name='.$selector.',has_parent!=2'); // modify selector for your needs $anchor = $linkpage->id?"<a title=\"go to $linkpage->title\" href=\"$linkpage->url\">":null; echo "$anchor<img src=\"$image->url\" alt=\"$image->description\"/>".($anchor?'</a>':''); to get all siblings of your page use $pages->siblings($selector);
-
Hello Juergen, please try to make a backup directly from ProcessDatabaseBackups. And restore from this backup. Did you get the same error? Thanks regards
-
@Juergen Thanks for reporting. You cannot open or restoring a backup from CronjobDatabaseModule but in ProcessDatabaseBackups which is a module made by Ryan. I couldn't reproduce your error in PW 2.6.21. You maybe could post a new topic in general support forum. Some more information would be helpful: is CronjobDatabaseBackup still doing its job? Could you try to restore from a backup created in the 2.6.21 environment? Thanks.
-
was the superuser. Thanks for the hint.
-
Strange behaviour (lack of security?) Using selector $pages->get('title=""') results in admin/access/roles/guest/ Result should be 0 (nullPage). /*unexpected return*/ var_dump($pages->get('title=""')->id); // return 37 var_dump($pages->find('title=""')->each('id') //return array(4) { [0]=> int(37) [1]=> int(38) [2]=> int(40) [3]=> int(41) } /*expected return*/ var_dump($pages->get('id=""')->id); // return 0 var_dump($pages->get('name=""')->id); // return 0 Workaround var_dump($pages->get('title="",has_parent!=2')->id); // return 0 var_dump($pages->get('name=""')->id); // return 0
-
Trying to restore database from backup with Module ProcessDatabaseBackups PW 2.6.21 throws the following Fatal error: Call to undefined method WireDatabaseBackup::trackException() in .../wire/core/WireDatabaseBackup.php on line 1098 (backup is from version 2.6.10) After reloading the page I get the following error notices: Modules: Configurable module check failed for SessionHandlerDB, retrying... Modules: Configurable module check failed for FieldtypeRepeater, retrying... Modules: Configurable module check failed for FieldtypePage, retrying... Modules: Configurable module check failed for PageRender, retrying... Modules: Configurable module check failed for SessionHandlerDB, retrying... Modules: Configurable module check failed for MarkupCache, retrying... Modules: Configurable module check failed for LanguageSupport, retrying... Modules: Configurable module check failed for LoginNotifier, retrying... Modules: Configurable module check failed for AdminThemeDefault, retrying... Modules: Configurable module check failed for InputfieldSelector, retrying... Modules: Configurable module check failed for ProcessPageSearch, retrying... Problem solved: Divergence in database settings in $config (using 2 different installation dev/master). Apart from this I would expect another Error message in this case.
-
Choose 'Fieldtype File' and set allowed format under details tab to mp3 or wav. call the file via API. Here a code snippet I used once $playlist = "<ol id=\"playlist\">\n"; foreach($page->audio as $file) { $playlist .= "<li><a href=\"$page->path?src=$file->url\" data-src=\"$file->url\">$file->description</a></li>\n"; } $playlist .= "</ol>\n"; $body = <<< _OUT <!-- Media Page --> <section id="basic"> <div class="container"> <div class="col-lg-12 text-center"> <h2 class="section-heading">$page->title</h2> <h3 class="section-subheading text-muted">$page->subheader</h3> </div> <div class="col-sm-8 col-sm-offset-2 audio-player"> <audio$src preload="auto" controls> $html5error </audio> $playlist </div> </div> </section> _OUT;
-
I recommend the following steps: make a new clean install of PW put your templates, assets, modules in the site folder download Ryans Module Database Backups here: http://modules.processwire.com/modules/process-database-backups/ go to Setup > Database Backups > Upload upload your sql If necessary reset admin password with the following code in your home template $users->get("admin")->setOutputFormatting(false)->set('pass', 'newpassword')->save(); look what happens. If needed switch on debug mode to clean-up your templates $config->debug = true; // in config.php Add your IP adress to HTTP hosts whitelist $config->httpHosts = array('xxx.xxx.xxx.xxx'); // in config.php
-
Another topic about letsencrypt: https://processwire.com/talk/topic/8338-free-ssl-from-q2-2015/ If needed I create my own certificates and tell the browser to allow it. Useful for webmaster access and really secure. (Even the NSA will take some time to crack it. ) I am not sure if low budget hosters accept letsencrypt. Any experiences? And finally I don't really trust: https://raindog308.com/the-problems-with-the-lets-encrypt-project/
-
Latest dev 1.1.8 supports external databases and hosts now. Please download and test from github
-
Under 'Details' Tab in your field settings you could define the Inputfield Type. Select 'CKEditor'. Done
-
Assuming your artworks have a template named 'artworks' and a select/ multiselect field 'subjects' of type page, where you define the type (subject) you could do the following: $subjects = $pages->find("template=subject, sort=title")->each('title'); // get the titles of subjects (pages) foreach ($subjects as $subject) $artworks = $pages->find("template=artworks, subjects=$subject"); echo $subject.' — '.$artworks->count; }
-
You can try to disable ACF Filter and/or HTML Purifier in the Field settings of your Inputfield (CK Editor).
-
page-> find the same roles (in child pages) as the active user has
kixe replied to Ralf's topic in Getting Started
$events = $pages->find('template=event, children.select_group=1045, sort=date'); echo $events; This selector will find all pages with template 'event', where childpages have a field 'select_group' with the fieldvalue '1045'. -
How to import table of data into ProcessWire
kixe replied to Tony Carnell's topic in General Support
To select/ provide any data of any table in your database which does not belong to processwire use module FieldtypeSelectExtOption. No need to import or transform data in a processwire format. -
page-> find the same roles (in child pages) as the active user has
kixe replied to Ralf's topic in Getting Started
Could you post a more clear page tree. It looks like your jobs are child pages of an event foreach($event->children as $child) . Looking at your selector string I would expect a page tree more like this, which should return all events selected the job 'turn the light on'. /*Home |- events (template events) | |- event | |- event (template event -> title, date, jobs (PageTable of 'jobs') | |- tasks |- places |- jobs | |- 'turn the light on' (template=job, select_group = 1045) | |- 'clean staircase' ... -
One more supported Inputfield. Could get InputfieldSelectMultipleTransfer working with FieldtypeSelectExtOption >= 1.1.3 You just need to remove the '>' in the selector string line 3 and 19 of InputfieldSelectMultipleTransfer.js.
-
How to set a fieldvalue via API: /* Inputfieldtype Select */ $page->of(false); $page->myfield->value = 3; $page->save('myfield'); /* Inputfieldtype SelectMultiple (add a value) */ $v = new SelectExtOption; $v->value = 3; $page->of(false); $page->myfield->add($v); $page->save('myfield'); /* this works for both, but will replace existing values */ $page->of(false); $page->myfield = array(3,7,9); // in case of single select only 1 item in array $page->save('myfield');
-
Your example works only with echo. echo $page->myfield; // return the string value, in your case '3' $page->myfield->value; // return (int)3 $page->myfield->label; // return (string)'Bob'; any value of another column of you table is accessible too with $page->myfield->columnname;
-
If you use latest dev https://github.com/kixe/FieldtypeSelectExtOption/tree/dev you could use the following code (since version 1.1.3) $news = $pages->find("template=news_detail"); $arr = []; foreach($news as $n) { echo $n->tag; // returns a string with all values separated by pipe, example: '45|67|89|22' $arr = array_merge($arr,explode('|',$n->tag)); } or (since version 1.1.5) $news = $pages->find("template=news_detail"); $arr = []; foreach($news as $n) $arr = array_merge($arr,$n->tag->getKeys()); var_dump(array_unique($arr)); // or foreach($news as $n) var_dump($n->tag->each('yourPropertyOfSelectExtOption')); // all table columns are provided as property except those named with reserved words foreach($news as $n) var_dump($n->tag->each('row')); or simpler $news = $pages->find("template=news_detail"); var_dump($selected->each('tag.label')); // return multiple array of each label of field 'tag' of each page in the PageArray
-
@starter welcome first! $news = $pages->find("template=news_detail"); $arr = array(); foreach($news as $n) { $tags = $n->tag; // <- TYPO CORRECTED foreach($tags as $tag){ $arr[] = $tag->row['data']; // will fill the array with each value of multiple value field of each page in page array } ... $news is an pageArray $n is a single page of this array $n->tag is afield which returns a wireArray, because you choosed a multiple value field //call a single value $n->tag->first()->value $n->tag->last()->value $n->tag->eq(4)->value or loop like you did. Maybe you prefer a multiple array (pages/ multivalues)?
-
My wife kindly asked why it isn't possible to type tabulators in an inputfield. Here is the answer: Inputfield which allows using the tab key to write tabulators in an Inputfield. Disables switching field focus functionality of the tab key. Use the mouse to get to the next input. Against some principals module doesn't respect minimum accessibility guidelines. Download from github https://github.com/kixe/InputfieldTextareaTabKey Tested in Firefox and Safari on Mac.
-
- 6
-
-
Since I am logging 404 requests I recognize very often requests searching for potential security gaps (mostly targeting at other CMSs like wordpress). I am not a specialist in this complex theme. Beside the security docs: https://processwire.com/docs/security/ I would like to have a subforum 'security' where tried or real attacks, potential lack of security, prevention etc. could be discussed.
-
Update to Version 1.1.3 (dev) Download from github https://github.com/kixe/FieldtypeSelectExtOption/tree/dev Changes hook in Inputfield render() replaced by adding magic toString() method to SelectExtOption class (which helped teppo and dsdb) @Teppo Thanks! filter() method is now hookable to define more complex SQL WHERE clauses. whole usage description available in module settings. from now all column values are populated as a property if the column is not named by a reserved word. Reserved words are: 'value','label','row' and 'data'. $page->myfield->value $page->myfield->label $page->myfield->row // associative array of all values of the selected datatablerow $page->myfield->columnname-1 $page->myfield->columnname-2 // ... I tested the Module with PW 2.6.17. Please give me feedback if the module works in your surroundings.
-
@dsdb thanks for reporting this. It looks similar to teppos problem, which I couldn't reproduce in my surrounding. I don't have the time now. I will have a deeper look asap. If there is anybody out there. Help is welcome.