-
Posts
21 -
Joined
-
Last visited
webaff's Achievements
Jr. Member (3/6)
9
Reputation
-
Thank you @Macrura for your pointing me to the PHP sample.
-
Hi, can we use field sets to structure our settings gui? What would the JSON syntax for InputfieldFieldset look like? Thanks
-
module PrivacyWire - Cookie Management & async external asset loading
webaff replied to joshua's topic in Modules/Plugins
Thank you @joshua for this great module! Everything works perfectly. Only I can't get IE11 support to work. I'm on ProcessWire 3.0.165 with PrivacyWire 1.0.4. JS console says: Yes I know I should drop IE11 support... but this is more a legal issue than a functional or cosmetic one. -
webaff changed their profile photo
-
Show children links in page reference in admin with hook
webaff replied to DaveDev's topic in General Support
Maybe a bit late, but this works for me: $wire->addHookAfter('InputfieldPage::getSelectablePages', function($event) { if($event->object->hasField == 'childLinks') { $currentPage = $event->arguments('page'); $parent = "parent=" . $currentPage->id; $event->return = $event->pages->find($parent); } }); -
@Robin S, I filed this request at GitHub. Maybe you want to comment there to make things more clear. Thanks again for your support.
-
How to use language-alternate fields inside selectors?
webaff replied to webaff's topic in API & Templates
This issue was solved by two great community members in this thread: -
@bernhard and @Robin S, it's all working. Thank you so much! Robin S, further up berhard proposes to file an issue at github. Do you agree?
-
@bernhard, I'm not sure if I explained my setup clearly. I would be glad if you could jump over to this thread where I explained it in more detail: Thank you.
-
Hi bernhard, geat idea! I can see how that would work in your setup. Unfortunately I can not apply this to my situation. I have 4 file fields for the 4 different languages, according to the concept of language-alternate fields. There is always a file for the default language (mandatory user input). But uploading files for those other 3 languages is optional. Now I want to sort by file.modified depending on the user's language. (If there is a file for the user's language, take its modified date for sorting. If not, take the default file's modified date.)
-
Hi @bernhard, A while ago, but have you ever found a solution to sort the way you posted above? (OR-groups are no solution here, I guess.) I want to sort after fileField.modified in an language-alternate fields setup: Seems like language-alternate fields inside selectors do not work. The sort is always by default language. Sorting the way you are asking in this thread could solve this problem. I could sort by both, fileField.modified OR (if not empty) by fileField_altLang.modified... I would appreciate your reply, thx.
-
How to use language-alternate fields inside selectors?
webaff replied to webaff's topic in API & Templates
@LostKobrakai, thats how I had it first, didn't work neither. Thank you for pointing out issues with pagination. -
How to use language-alternate fields inside selectors?
webaff replied to webaff's topic in API & Templates
@Zeka, thanks for your reply. I did try that already with no success. I will give some more insight into my setup: It's a multilingual site with the concept of _init.php/_func.php/template/_main.php Inside my template, I get my PageArray together... $matches = $pages->find("template=file"); $matches = $matches->sort("-fileField.modified"); $output = renderFileList($matches); and pass it on to _func.php, where the output ist generated and returned: function renderFileList(PageArray $items) { out = ''; foreach($items as $item) { $out .= $item->fileField->modified; } return $out; } This returns the timestamp of the language specific file. If user language is not default, this magically gets fileField_altlang, as expected from the concept of language-alternate fields. BUT: the results are not sorted by the timestamp of the fileField_altlang but are sorted by the timestamp of the default fileField, no matter what the current user language is. It seems to me, that the concept of language-alternate fields does not work inside Selectors. I hope that someone can follow, reproduce or disprove my findings. Thx. -
Hi, I want to use language-alternate fields inside selectors for manipulating PageArrays, i.e. find(), sort() or filter(). I have set up a multi-lingual file upload with the file field "fileField" and its language alternate fields "fileField_lang1", "fileField_lang2", ... This works as expected: $matches->sort("-fileField.modified"); While this: $matches->sort("-fileFile_lang1.modified"); ...throws an error: "Recoverable Fatal Error: Argument 1 passed to ProcessWire\PageArray::getItemPropertyValue() must be an instance of ProcessWire\Wire, boolean given, called in ..." Maybe I have to turn off outputFormatting? But how would I do that in this context? Any help is well appreciated, thx.
-
Just came across this issue in 3.0.62 and glad to find @Soma's workaround. Not sure if it's caused by the clone function as the pages are created by a client, but highly possible. Hope @ryan can fix this soon, maybe with @LostKobrakai's fixer module. Thx.
-
File distribution tool / extranet: Help on concept wanted
webaff replied to webaff's topic in General Support
Thanks, @Zeka, for pointing out the matching modules. In my scenario I have up to 5 user groups (roles) and pages can be accessible for any combination of groups (for all groups or just some of them). What's the recommended way to achieve access control on page level? A custom solution based on concepts like here: https://processwire.com/talk/topic/3254-restricting-permissions-on-a-specific-page/ ? Or one of the following modules? https://modules.processwire.com/modules/custom-page-roles/ http://modules.processwire.com/modules/page-protector/ Thanks for further help.