-
Posts
4,956 -
Joined
-
Last visited
-
Days Won
100
Everything posted by LostKobrakai
-
It might be a very rare edge-case, but would it be possible to change the loaded color-theme dependent on the current page a user is on or by some setting on the user itself?
-
You can always access the processwire logs in the place where they are saved: /site/assets/logs/.
-
$page->myProperty would work, as well as $page->is($selector) or $page->matches($selector). Just $page->find() is searching for "new" pages to be loaded from the db. It's internally changed to $pages->find("has_parent=$page, …") and therefore it's hitting the db. It's more efficient in terms of code quality, but not in terms of db querying efficiency, exactly. The db can just evaluate what's in the db, therefore yes, you need new fields to store things in. I would simply hide them for the admin backend and use a Pages::saveReady hook to populate the field. As you're setting the value each time a page is saved you're also overwriting potential changes, so this should not get "out of sync" with your other fields. Edit: While runtime selectors do look like they work the same as db selectors, there are lots of goodies that do not work for runtime selectors, like for example or-groups or automatic datestring convertion.
-
You could use "addHookProperty" to add runtime "variables" instead of a method. These can be used in runtime selectors and are more or less created the same way as normal hooks, but are called without the function parenthesis and therefore cannot have arguments. // runtime selector (no db involved) $pageArray->find("myRuntimeProperty=something"); // db selector (db involved; more features like or groups and so on) $pages->find($sel); // internally replaced by $pages->find("has_parent=$page, …"); $page->find($sel); If you'd also need the greater efficiency from calling less pages from the db you'd need to cache those values in real fields, so they are available to the database queries as well.
-
Found the solution for this. The "permissionMethod" setting for process modules allows for dynamic access rules on modules.
-
The error is saying everything. It's not supported, but there's a workaround posted by Ryan here: https://github.com/ryancramerdesign/ProcessWire/issues/1210
-
Why do you think your arguments are right? I translated your fields to the variables used by the docs. You need to change the order to make it work. // API Docs wireMail($to, $from, $subject, $textBody); // Your code wireMail($to, $subject, $textBody, $headers); While wireMail is using php mail as default sending mechanism it's not a plain replacement method.
-
Maybe take a look at this pages. They're doing what you're asking for: https://processwire.com/talk/topic/10324-bmw-dealer-sites/.
-
To have different access on the same templates can be done by the dynamic-roles module, but you can either give users edit access to fields/templates or not.
-
Did you read the api docs here: https://processwire.com/talk/topic/5704-wiremailsmtp/? Your arguments seem out of order. Also there's a option to test the modules configuration in the modules settings.
-
Isn't that kinda overkill to go though a second database to get things into the pw database? I'd also vote for a simple rest api endpoint. They are not to hard to create even by hand. At least as long as one doesn't need more than basic authentication.
-
Use wireMail, the processwire mail class, and install the wiremailsmtp or swiftmailer module to let it use smtp instead of php mail. There are lot's of other topics (e.g. the modules support topics) around, where you can find written out examples on how to use wiremail and the module specific api's.
-
It's not documented, but quiet allows for changing the created date in this line: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/core/Pages.php#L1082
-
They are and you'll likewise find the documentation in the Process Class: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/core/Process.php
-
That's not fully true. templates-admin contains for example the whole show-if javascript logic, which can be seen as a kinda "global" functionality, while the themes are actually mostly there for the "look" of the admin backend.
-
Is the page id correct? What does quotes return instead of an object?
-
how could i add login session expiration period on sign on ?
LostKobrakai replied to adrianmak's topic in Getting Started
It's most likely not as easy, as everybody gets a session with the lifetime defined in the config.php. Only the session id gets regenerated on login, but the session per se stays the same. -
There seems to be something wrong in either your code (besides the posted snippet) or potentially 3rd party modules. You seem to be adding the page to the page table just right.
-
Strange. eq() should be available, as a repeater should simply return a PageArray, but you could also try get(). It may even be better than eq() as I'm not sure if the PageArray is indexed by position or by id. If that's not working try to check what type of object you're getting from your quotes repeater.
-
wireRenderFile() pass value to $page->title
LostKobrakai replied to charger's topic in API & Templates
If you're view file is echoing "$page->title" there needs to be a $page variable, no matter how you turn it. "$page->title" is not a own entity (e.g variable), but a part of the $page object. If you want to have a different title the object needs to change. The only way to archive this with wireIncludeFile is by passing a $page object with the title changed. You cannot change the $page object which is automatically added by the TemplateFile class. -
You're checking if the id is the same as $i, but you're in no way looping through all the repeater fields, so this makes no sense in this state. If you try to get a specific repeater field you'd do it like this: $pages->get(1024)->quotes->eq($i); //Get the $i's repeater field
-
wireRenderFile() pass value to $page->title
LostKobrakai replied to charger's topic in API & Templates
If the "$pages(1234)" part would actually be replaced by a valid way to get a page ("$pages->get(1234)" ?) this would work. -
Could you try out "id<=1, include=all". Not sure what I thought when writing the previous selector.
-
The context dropdown does come a little close to the tabs, when editing fields or templates on a narrow screen.
-
Text is not wrapped in the Source box - FF36
LostKobrakai replied to OllieMackJames's topic in General Support
That a bug of ckeditor that should be fixed by them. Maybe Ryan can add styles to overwrite that behavior, but it's always best to keep dependencies as separate as possible.