-
Posts
6,808 -
Joined
-
Last visited
-
Days Won
159
Everything posted by Soma
-
Are you sure you did everything correct? I also installed a new latest master PW3.0.123, and added 2 multisites to test. Works fine here. Can you show the config or tell more about what you did? The allowed httpHosts should be entered in the config as well. And the multisite config is as shown in the readme. The default 404 page has always been the basic-page template in PW, and the ID is what you enter in the multisite config. This works fine.
-
Yeah those search fields are something you wanna change to your needs or remove them. It's still something that is not configurable.
-
Read here what name() does https://processwire.com/api/ref/sanitizer/name/
-
I'm not sure if it's the user that has output formatting off by default. I'm using this module in a project and have many page fields and image field on the user template and registering works great (though i made some change to the module and made a custom one extending it). I have also a $user->of(true); in the templates/_init.php Could be worth trying?
-
I must agree as well with all those alternatives and multiple ways for the same thing.... should really stop. I lost track long time ago and 99.99% never use any of them and really don't care at all. It's utterly confusing and I completely don't understand the reason behind it. It makes it harder than it should be. So many things goes against it...
-
So back to your first post and what is the problem? It's hard to say as it depends what you want to do. I think it's once you $mymodule = $this->wire('modules')->get('MyModule'); The module is loaded and init()'d , unless it's a autoload module. So the fullname is already set. So you want to set the fullname after you set the names or when you call execute. Or have a getter method for fullname. There's lots of ways... <?php namespace ProcessWire; class MyModule extends Process { public static function getModuleInfo() { return array( 'title' => "My Module", 'version' => 1, ); } public function __construct() { $this->set('firstName', 'Han'); $this->set('lastName', 'Solo'); } public function init() { } public function getFullName() { return $this->firstName . ' ' . $this->lastName; } public function ___execute() { return $this->getFullName(); } }
-
Well set() sets a property to the data property which is PW specific. I think it's mostly used to make it distinct data for a module or object and set data to a WireData module which is used to save data to DB like module/class configurations, change tracking etc. Defining a property directly in the class body makes it just a normal class property which PW doesn't threat special and it won't be in the data array. protected $foo = "bar"; // standard class property - and then set foo using set() $this->set("foo", "baz"); // set data array only $this->foo = "bar2"; // set the class property - You'll end with two "foo" which are not the same $this->foo // bar2 $this->get("foo") // baz (from data array) But If you don't set a class property and only use data array or set(key, value) to define a PW data property $this->set("foo" , "bar"); $this->foo = "bar2"; is the same "foo" Just look a the WireData class
-
I can't reproduce this as it works fine here PW 3.0.118.
-
[SOLVED] Module error (first steps) - what's wrong?
Soma replied to Gadgetto's topic in Module/Plugin Development
That's exactly the point. You might regret it. Doing such a complex project without experience is never a good idea. -
Something else related to sound creation is something a friend showed me recently: https://vcvrack.com/ For anyone into Modular Synthesizer.
-
this poor son ?
-
I don't know what's so confusing about it. I think it's rather this doc: https://processwire.com/api/multi-language-support/code-i18n/
-
Here something very special, in the days of trillions of colors high dpi screens and VR... art by Mark Ferrari which is absolutely incredible work. http://www.effectgames.com/demos/canvascycle/
-
- 9
-
-
-
Everybody can make music. ? https://audiotool.com is a powerful pretty unique in the browser sound production studio. I remember back then it was made with flash, nowadays it's a JS app with 600k lines of code. Pretty amazing if you never seen it try it out.
- 3 replies
-
- 10
-
-
[SOLVED] Pagination links render but do not work.
Soma replied to FireWire's topic in API & Templates
When you change the $user->language, all following API returns stuff in that language also, the $page->url or $input->url. No need to do str_eplace on something already the same. So if $this.>getLangFromCookie does return the language object then you can change it to this. private function doInitLocalization() { $user = wire('user'); $input = wire('input'); // Get/set user language from either browser or cookie $language = $this->getLangFromCookie() ?: $this->getValidBrowserPrefLang(); if($language !== $user->language) { $user->language = $language; $this->wire("session")->redirect($input->url(true)); } } -
Show content of an InputfieldFile field on frontend
Soma replied to MilenKo's topic in General Support
Maybe this will help? http://cheatsheet.processwire.com/files/file-properties/ -
[SOLVED] Pagination links render but do not work.
Soma replied to FireWire's topic in API & Templates
Something like this would be the easiest way, I can think of, to do what you are doing. Redirect to a another language, including urlSegments, Pagenumber and optional QueryStrings; if($user->language->isDefault) { $user->language = $languages->get("de"); $session->redirect($input->url($withQueryString = true)); } -
$page->one_liner_group->getRandom();
-
There's no difference only preference.
-
It's still popular even in 2018.
-
I tried but not luck.
-
SSL operation failed On Mac? This is due to OpenSSL changes by Apple.