-
Recently Browsing 0 members
No registered users viewing this page.
-
Similar Content
-
By Noel Boss
Hi everyone 🙌
Is there a way to order the language tabs in the backend? Currently, they seem to be ordered based on the created date (or id?) …
( time passes … ⏰ 🚶♂️)
Just answered my own question. One can reorder the languages in the page tree under admin » languages or directly in the DB » pages » template_id=54 » sord field.
Anyone knows if there are side effects when moving the default language from sort 0 to somewhere higher?
-
By VeiJari
Hello forum,
This is really a weird one, because front end editing works in a earlier website we did to a customer.
When I check the source code for current website it does initiate front end edit:
<span id=pw-edit-1 class='pw-edit pw-edit-InputfieldPageTitle' data-name=title data-page=1021 data-lang='1017' style='position:relative'><span class=pw-edit-orig>Tekijät</span><span class=pw-edit-copy id=pw-editor-title-1021 style='display:none;-webkit-user-select:text;user- select:text;' contenteditable>Tekijät</span></span> But when I double click nothing happens (yes I'm 100% sure I'm superuser and logged in)
I also tried to apply the front end with other methods than:
$page->edit('title'); But didn't work either.
We are using jquery 2.2.4, so it should not be a problem.
Is this a bug related to current master or something else?
Someone else having this problem as well?
-
By jom
Hi everyone
It seems that I don't fully understand the wireTempPath() function and I need some help.
I use wireTempPath() to create a new location in assets/cache/WireTempDir and than copy a pdf from the assets/files/page folder to the new folder. I want the file to be accessible only for a limited time, that's why I use wireTempPath.
The file seems to be copied to the right location, but gets deleted right afterwards, according to
As mentioned in the topic above,
$wireTempDir->setRemove(false); prevents the file to be deleted. But I like the file to be automatically deleted after a few days. So, how can I do that?
My code so far (everything works, but the automatic removal of the tempDir folder):
//generate and show download link $folder = time(); // timestamp as temporary folder $maxAge = (int) $settings->options_downloadlink_valid_hours * 3600; //tempDir wants maxAge as seconds $options = array( 'maxAge' => $maxAge ); $wireTempDir = wireTempDir($folder, $options); $wireTempDir->setRemove(false); $src_file = $page->ebook_download->filename; // Create a new directory in ProcessWire's cache dir if(wire('files')->mkdir($wireTempDir, $recursive = true)) { if(wire('files')->copy($src_file, $wireTempDir)){ //get subdirs from tempDir: $pos = strpos($wireTempDir, "WireTempDir"); $subdir = substr($wireTempDir, $pos, 100); $out .= "<p><a href='" . wire('pages')->get('template=passthrough')->httpUrl . "?file=" . $subdir . $page->ebook_download->basename . "' target='_blank'>$page->title</a></p>"; } } I appreciate any ideas - thanks!
Oliver
-
By VeiJari
Hello forum, this is my first security related post, so I'm a bit of a newbie.
I understand that when I have direct front-input from user I should sanitize the input, but how about when I use a secret key for showing a API for a third-party supplier? Should I sanitize the input->get() key?
I've tested this issue and I tried ?key=<?php echo $page->field; ?> And without adding any sanitization it comes back: /?key=<?php%20echo%20$page->field;%20?>
So can I rely on this, or should I still use $sanitizer just in case?
Thanks for the help!
-
By EyeDentify
I have been experimenting with the new $page->meta() method and find it useful.
Once i figured out that the data i "save" with it is tied to the page where i called the method from.
So this is not obvious at least not for me in the documentation:
https://processwire.com/api/ref/page/meta/
So i just wanted to share that revelation with the community so you don´t get as confused as i was.
Happy Coding Everyone.
-