-
Posts
4,956 -
Joined
-
Last visited
-
Days Won
100
Everything posted by LostKobrakai
-
Best read about categorization in processwire: https://processwire.com/talk/topic/3579-tutorial-approaches-to-categorising-site-content/
-
$resizer = $event->object; $filename = $resizer->filename;
-
You could still create a simple module to implement the functionality without using ready.php. Just replace the hook and the function in the save snippet you linked. Further information about hooks are also to be found here: http://processwire.com/api/hooks/
-
The ready.php is so nice. No more tons of mini modules just to enhance the admin.
-
@horst That sounds definitely clumpsy. What about some buttons in the page editor? Put this as is in /site/ready.php: $wire->addHookAfter("ProcessPageEdit::buildForm", function(HookEvent $event){ $process = $event->object; $form = $event->return; $page = $process->getPage(); // Update to fit your fieldnames $imageFields = array("images"); $multiple = $page->fields->find("name=" . implode($imageFields))->count() > 1; foreach ($imageFields as $field) { if($page->fields->has($field) && $page->editable($field)){ if(wire('input')->post("hook_sort_$field")){ $page->of(false); $page->set($field, $page->get($field)->sort("basename")); $page->save($field); } $button = wire('modules')->get("InputfieldSubmit"); $button->attr("id+name", "hook_sort_$field"); $button->value = __("Bilder Sortieren"); $button->value .= ($multiple ? " (" . $field->get("label|name") . ")" : ""); $button->icon = "sort-alpha-asc"; $button->addClass("ui-priority-secondary"); $form->insertBefore($button, $form->get("id")); } } });
-
Setup a ProcessWire environment on a fresh MacOS X install
LostKobrakai replied to Martijn Geerts's topic in Tutorials
I just never use system resources, but either mamp or a vm. It's just so much more portable and resistant to changes on the host system. -
Multi-language with Beginner Default Profile ?
LostKobrakai replied to Neo's topic in Getting Started
I think replacing files is quicker than enabling multi-language, but in the end it doesn't really matter. The result will most likely be the same. -
This is what would need to be in the afterSaveReady function. But keep in mind that this will deny any attempt to sort images in the backend manually. // Get the soon to be saved page object from the given event $page = $event->arguments[0]; // Sample condition and changes if($page->fields->has("images")){ $page->images = $page->images->sort("basename"); // Page will be saved right after this hook, so no need to call save(). // Every other page you load and edit here needs to be saved manually. $this->message("Images have been sorted"); }
-
Multi-language with Beginner Default Profile ?
LostKobrakai replied to Neo's topic in Getting Started
Just replace the whole /site/template folder with the files from the beginner template. The should be interchangeable. -
The module is working quite nicely, but I cannot click on the file in the backend anymore even though I'm superuser and editor, which I gave download from admin rights. Edit: Would it be possible to look at the ListerPro styling for the field?
-
You said your urlSegment2 was '6bc', but somehow pages2pdf is searching for just 'bc'. But the version change could also be the culpit.
-
Page select for URL redirect in templates
LostKobrakai replied to kiennguyen1101's topic in Wishlist & Roadmap
You can just put the ID of the page in that field. And to clarify the possible confusion. It may be the case you want to redirect to an url, that isn't a page managed by processwire, therefore it's not a page select field from the beginning.- 1 reply
-
- 2
-
- redirect
- permission
-
(and 1 more)
Tagged with:
-
German (de-DE) not maintained
LostKobrakai replied to Nico Knoll's topic in ProcessWire Language Packs
It would be nice to update the system notification settings for the order with other descriptions. With the current translation it's really hard to differ what means what. I'd rather use something like "newest first" or "oldest first", which makes clear which notifications will be above others. -
Does updating to the newest stable version (2.6.1) resolve the issue? If not would it be possible to get the full stack trace as the error is probably rooted far earlier in the stack then what the error message is showing. To get the full trace you'd need to add a line at the bottom of the index.php file. Maybe you also need to comment out the other lines, not sure as I haven't tested it. … } catch(Exception $e) { echo $e->getTraceAsString(); //Add this line /* * Formulate error message and send to the error handler * */ if($process) $process->failed($e); $errorMessage = "Exception: " . $e->getMessage() . " (in " . $e->getFile() . " line " . $e->getLine() . ")"; if($config->debug || ($wire && $wire->user && $wire->user->isSuperuser())) $errorMessage .= "\n\n" . $e->getTraceAsString(); trigger_error($errorMessage, E_USER_ERROR); }
-
Which version of processwire are you running? Also what are your urlSegments settings for that template?
-
Just add another option to the selector, where you check for cases, where the start is before the searched date and the end is after the searched date. $selector = ""; // Start date inside $selector .= ", range=("; $selector .= "datefrom>=".$input->whitelist("datefrom"); $selector .= ", datefrom<=".$input->whitelist("dateto"); $selector .= ")"; // End date inside $selector .= ", range=("; $selector .= "dateto>=".$input->whitelist("datefrom"); $selector .= ", dateto<=".$input->whitelist("dateto"); $selector .= ")"; // range overspans searchrange $selector .= ", range=("; $selector .= "dateto>=".$input->whitelist("dateto"); $selector .= ", datefrom<=".$input->whitelist("datefrom"); $selector .= ")";
-
To be able to help we would rather need to see how you resolve those url segments instead of the raw concatenation of the url, which isn't the part that produces the error.
-
Then your already on the right track with hooking Pages::find or maybe even PageFinder::find.
-
What exactly do you mean by quick fix? Getting rid of those characters? Getting rid of the html encoding? Removing the ability to add those characters?
- 10 replies
-
- HTML Entity
- HTML
-
(and 2 more)
Tagged with:
-
How about simply hiding the products, so they are only shown when adding "include=hidden".
-
Exactly, you could even replace a whole function with hooks. You can read more about this in the docs about hooks.
-
It very much depends on how the numbers are gathered. Here in Germany we have a saying that states: "Never trust a statistic you didn't forge by yourself". So do your own research. It's useless to go with a most used tool (e.g. wordpress) if it doesn't fit your needs. And nobody does know what you need but yourself. You can always use contributor counts or surveys as guidelines, but taking them for facts is in my honest opinion just stupid. Any single dedicated contributor is worth much more than any 100 contributors that issued/fixed a typo in the code at some time. These numbers aren't more than hints on how well a project is doing.
-
$this->addHookAfter('Pageimage::size', $this, function(HookEvent $event){ $thumb = $event->return; // Replace thumb file with optimized one. });
-
The maxlength attribute on textareas is an html5 attribute and the inputfield's implementation is older than html5. It does support maxlength only in conjunction with an fieldtype textarea, which would ensure the max length on the server side.