Jump to content

donatas

Members
  • Posts

    22
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Lithuania

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

donatas's Achievements

Jr. Member

Jr. Member (3/6)

4

Reputation

  1. Thank you @kixe! One of the modules you listed (AdminRestrictBranch) was cutting it very close, however it can't do multiple branches unfortunately. Still managed to reach my goal with it and some additional hooks into PageLister and PageSearch to limit the selectors used for them. Thank you for help!
  2. Hi Adrian, it's a shame your wonderful module can't do multiple branches - was really looking for something with that functionality and your module does everything that I need except this. Still found it useful to completely block the page tree and restrict breadcrumbs. I am grateful for your module! Maybe any plans to rework it to allow multiple branches? With my (not very experienced) eyes it seems it might be doable, although quite a lot of code would need changing. Personally I was looking to restrict users to only those branches, where they have pages created - I am using "page-edit-created" permission to limit editing to only user created pages. I imagined using it with "Custom PHP code" option and something like: `$pages->find("created_users_id=".$user->id)->implode("|", "rootParent")`.
  3. Hello. I have a role that I want to limit only to see very few specific pages/templates, but I have like 50 templates (and more might be added with time). They are well access managed so this role can't edit any pages with them, but can see them in the system (guest role view permission). I have forcefully hidden the page tree and switched it with a Dashboard module for more control and redirect users after save, etc to it. But if a user goes to Pages > Find - he can see anything he wants... That I don't want (emails in "created by", Order numbers, etc). I can't completely remove view permission from some templates, as they are parents to pages I want to give access to this role. And some things don't work if I completely remove view permission. I use "page-edit-created" and "page-publish" permissions to limit editing capabilities. I am using Lister Pro module with access control to show only very specific things to user. Maybe there's a way to force disable showing most pages? Or the Lister all together? Use custom permission to disable it with a hook? Maybe create a custom permission, like "page-view-created" to allow viewing only your own created pages or something similar? And then using hook to decide whether to render a page in any list or not? Are there any possible options? Any suggestions? Security is key here. Thank you for any insight!
  4. Hi, Could someone please direct me to how should I go about using `addFlag` on a field in a fieldgroup context? Setting contexts through API is pretty new to me, however I managed to set all other necessary settings through `setFieldContextArray()` function. But the access flags are only applied through `$field->addFlag(128)` (when not inside fieldgroup context) - https://processwire.com/api/ref/field/add-flag/ I have tried (in a module install function): // Create a new fieldgroup $fieldGroup = new Fieldgroup(); $fieldGroup->name = static::NAME; $fieldGroup->add('title'); // trying to set flag to this 'title' // ...Adding other few fresh fields to fieldgroup $fieldGroup->save(); // Works fine. $field_title = wire('fields')->get('title'); $fieldGroup->setFieldContextArray( $field_title->id, array( 'columnWidth' => 50, 'useRoles' => true, 'accessFlags' => [64,128], // Doesn't work. 'addFlag' => 128, // Doesn't work. )); //$fieldGroup->getField('title',true)->addFlag(128)->save(); // Doesn't work with field->save() nor without. $fieldGroup->saveContext(); // Works fine with above setFieldContextArray() settings. // Adding it to a new template and saving. Works fine. $template = new Template(); $template->name = static::NAME; $template->fieldgroups_id = $fieldGroup->get('id'); $template->save(); The API docs seem a bit lacking in this department, very hard to figure out the whole flow 🙂 Any ideas? Thanks in advance!
  5. Thank you @Zeka and @bernhard! Looks like something that should do the trick! Will try these out!
  6. Hello, how would I do a multi-language website search with just a selector? I have many multi-lang fields and I want to do a search through all of them at once and through all of their language values. Is there a "selector way" of doing this? Maybe something like `title|title:de|title:it`? It seems I have seen this somewhere a long time ago but can't find in any documentation or forum search... Or the only way of doing it is by running separate searches for each language with output formatting off and then consolidating it all in one single results array? Because I still want to give users a result, even if it is in another language than current $user. Visitors mostly will be searching for specific terms that are very similar in all languages, but might be not used in one language version of a single page, for example. Or the user might not have switched language tohis prefered and did the search first, etc.. (many use cases in my situation) Example: $pages->find('title~='.$q) - maybe different operator is needed? /en/search/?q=visit = 1 results /it/search/?q=visit = 0 results Thanks for any advice!
  7. Thanks, @monollonom, that actually did it! I am very grateful for your tip. Now only to make translation .json files to be shared like that too as this is multilanguage site.. They are saved in the same /site/assets/files/ directory, but your shared hook doesn't seem to affect them. I wonder if there is a way. Probably need to hook to a different event related to translation saving in the admin.
  8. Hi, I am trying (wondering if even possible) to set a very different file folder path for my PW install. The path I want to set exist in the same server, but in another domain. Can the PW API see that far into file system? It is a shared hosting environment so no permission management options available. Also can this be achieved through .htaccess redirection? If you request a file (images mostly, but translation json files are important too) from `domain-A.com/site/assets/files/` to grab them from `domain-B.com/site/assets/files/`? I would prefer to do this through PW API, I can see the function `$config->setPath()` but it didn't work when set in config.php like `$config->setPath("files", "/domains/domain-B/public_html/site/assets/files/")`. Is there some other option to do this? My ultimate goal is to have two PW installs on different domains but one is just a "mirror" that is using the same database as the other and should use the same files structure if editors upload any images to the main (domain-B.com) website. I could use domain parking function but it then needs a more expensive SSL certificate for two domains , which I am trying to avoid if possible 🙂 (I'd like to use single domain Let's Encrypt certificates, thus I need to PW installs). Would appreciate any insight! Thanks!
  9. Hi. Something from this thread has worked for me in the past - https://processwire.com/talk/topic/9322-change-default-language-for-homepage/?do=findComment&comment=89925
  10. I have some trouble using setting() function - the setting() returns nothing in an included file. I set the setting() inside a function - could this be the culprit? _inti.php file, that is auto-included: function calendar($source){ setting('calendar', $source->id); } include_once('./_head.php'); _head.php file, that returns nothing for this setting: <?=setting('calendar')?> Is there an option to make it "global" from inside the function? API functions are turned on, and those that are set "statically" (not within function) and works fine.
×
×
  • Create New...