Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. just tested it on my local testversion. I experience the same effect with lates commit. It seems the template isn't applicable. It's possible to output name and fieldgroup "$template->name" ... but a wire("templates")->get("mytemplate") seems to return NULL. Don't know what's happening and how to fix this right now. Ryan would certainly now.
  2. There's no radio field type. You can choose radio boxes as an inputfield for page reference field. If you create pages as categories for example you can make them selectable, and use a select or radiobox,checkbox as inputfield type. There's actually a "select (aka drop down)" custom fieldtype by hani see "download section" or here direct link: http://processwire.com/talk/index.php/topic,245.0.html it creates select list from a string like "1:=Poor, 2:=Excellent" . It would be easy to create a custom radio field that does the same. Depending on what you want to archive, it could make sense to do it with the page reference field as it will give you great additional posibilities.
  3. Ryan is right. Here's a little module I'm using. I will maybe consider make it official module, but then I would like to have it with some configuration and this would take some time to consider. You would need to add a page reference field with inputfield asmselect or multiple select and add it to the user template (use filter at top of template overview page to show system templates). In this case it called "editable_pages". Following code does recursive check for editable pages. This works with adminbar in frontend too. If you like only 1 page you could also check only for those explicit. Have fun <?php /* * Page access control on user level * Allows to add pages on to user page to restrict editable workspaces * */ class AccessPageEdit extends WireData implements Module, ConfigurableModule{ public static function getModuleInfo() { return array( 'title' => 'Access Control Page Edit', 'summary' => 'Control who can edit what page. Create "editable_pages" page field (asmSelect) and add it to user template. Select pages to allow edit and add access.', 'version' => 001, 'permanent' => false, 'autoload' => true, 'singular' => true, ); } public function init() { if($this->user->hasRole("editor")) $this->addHookAfter("Page::editable", $this, 'checkpermission'); if($this->user->hasRole("editor")) $this->addHookAfter("Page::addable", $this, 'checkpermission'); } public function checkpermission(HookEvent $event) { // if it was already determined they don't have access, then abort if(!$event->return) return; $page = $event->object; $parents = $page->parents; // run check for parent pages and allow recursive inherit access foreach($parents as $p){ if($this->user->editable_pages->has($p)) return true; } // then run check on selected single pages if(!$this->user->editable_pages->has($page)) $event->return = false; } }
  4. Well I'm already used to it, but now it works without doing something... tested again in FF and it works now. Oh well. Thanks Ryan for the suggestions, I implemented your suggestions. And have adjusted the config times to be both in seconds. I commited the new version to github. Thanks!
  5. Thanks a lot Ryan, this would have taken me ages to find out! Lovely It works now again. Only problem I noticed now in Firefox it doesn't seem to work at all, my module. Even with the fix. I got tested now with all except FF, I got latest. Anyone experience the same? Stupid me, I logged in with same user... But still I think the pining window.setInterval doesn't work in my FF. Will test now some more. EDIT: There's something strange going on in FF, no errors and it doesn't seem to work at all... Confused...
  6. I have installed it on some projects and now I noticed a problem with the file upload. It doesn't update upload status and doesn't finish it, but after refresh the image is uploaded. I'm sure it has to do with this module, but not sure what's causing it. Any suggestions appreciated! Thanks
  7. Nice consideration. Not sure how easy this all would be. Sure a big task to build something up. Of course it would help people migrating and this can be a plus on the feature list. Not sure about what version I would go for. Are you planning on doing this, or do you want someone to do it? Either of the two ways would be possible and wouldn't require much work on PW side. Though I'm not sure what is planned by Ryan in this area. I'm sure he will make the CSV importer much more clever and versatile. Maybe there could be some collaboration taking place. Since I barely used WordPress and the other system (don't like them at all) I can't really help on this, as I will also spend my spare time on other helpful modules.
  8. Nice sites thanks for sharing. 8) I didn't notice any slow downs. Both are fast. I'm located in switzerland.
  9. Thanks apeisa. Just released first version. See first post for link and infos.
  10. Amamzing stuff, can't wait when I got time to try this out! Thanks apeisa for sharing this!
  11. Hi and welcome Steve! I'm busy but will give short answer: Offices would be pages too that's separate in a branch so you can edit them within PW admin, or alternatively you could using search in admin or create a bootstrap php somwhere outside and build a data table for easy finding and editing and use the excellent PW API, you're not bound to use PW admin. In your "skyscraper" template you would have a page reference field to select one or multiple offices. You could also create them all using simple script through API. Finally you can build all sort of lists and searches whether from offices view or skyscapers using the powerful selectors. You can easily relate them using the page reference field. The setup can vary to your needs. So you can also use PW only for presentation and connect it easily with your master application. See bootstraping. This enables you to build an easy maintain script synching or whatever using the excellent PW API. Finally PW supports urls segments up to 4 or more (not sure atm) if this is what you mean. It has to be enabled on PW template setup. After you can use segments to give it to the php template. So kinda yes, yes, and yes Have fun!
  12. PageEditSoftLock ProcessWire2+ Module There was a request for a page lock feature in PW2.1 for pages being edited by an other user already, it would lock or throw a message of along the line of: "This page is currently being edited by "username'." Thanks to Ryan for helping getting this done quickly! Download: https://github.com/s...ageEditSoftLock How it works Only the module "PageEditSoftLock" needs to be installed/uninstalled, the "ProcessPageEditSoftLock" Module will install/uninstall itself. The module creates a table and a hidden admin page under /page/edit/ for pinging in the background while editing a page. You can configure the ping interval and expiration timeout to what you think is good. Defaults - 20 seconds for pinging, - 60 seconds for expiration time (all entries in the table older than this will get deleted). ---- 27-02-2012 update https://github.com/s...1f204bc1b6c740a Fix for new repeater field throwing the lock message because of the way repeater work and this module. Thanks to Ryan for finding a quick fix.
  13. Hi sev and welcome! You could do the following and strip the last char from the string after the loop. <?php // if there's any images if(count($page->images)){ $out = ''; foreach($page->images as $image) { $large = $image->size(1200, 795); $out .= "{$large->url},"; } echo substr($out, 0, -1); }
  14. Hi Nico This has been discussed several time already. Please try to use search before posting. I know I have to remind myself too everytime I'm in a rush to post something...
  15. Ok I get it. Good to know this is possible. Though I'm not sure I'll set this up in this site. There's not sooo many fields I'm using in the search and there's some multilang fields on templates, so it would need 3 cache fields for some "_de,_en,_fr", or include them all in one an sort page out from other language trees.... This can get cumbersome and not so easy to maintain. I like it to have it in code form. What you mean when you speak of lots of fields? My selector part is now like following and there will be max of like 200-300 pages/downloads/properties/contacts total for a language. Do you think caching fields would really make a difference? I didn't notice any impact yet without cacheing. <?php $q = $sanitizer->selectorValue($input->post->q); $words = explode(' ', $q); foreach($words as $word) { $word = $sanitizer->selectorValue($word); if($word) $selectorPages .= "title|headline|headline2|body|summary%=$word, "; if($word) $selectorObjects .= "title|beschreibung_$lang|strasse|ort|bewirtschaftung|hauswart_adresse|headline1_$lang|headline2_$lang%=$word, "; if($word) $selectorEmergencyContacts .= "title|label_$lang%=$word, "; if($word) $selectorDownloads .= "title%=$word, "; }
  16. Ahh now I get it! But with lots of fields in 3 languages its quite tedious to set up. Nonetheless its a great feature. Now I did what you said and hit save, but there's no cache created. If I check "regenerate cache" and hit save it throws an error Cache 'emergency_contacts_field_cache' is not assigned to any templates. What now? Do I need to attach that field to templates too?
  17. I could help out with de-DE or ch-CH (swiss german, would be funny)
  18. I already wondered what this module is about and for what use? Example? Is it to have a selectable list of custom modules that then will get executed on template file / page? Sorry if I missed the obvious.
  19. It shows on modules overview that it's configurable, but when opening there's nothing to configure.
  20. Thanks you a lot Ryan for the input. Very helpful! Just one thing I don't get, what you mean by cache field? I don't get it.
  21. Nico, don't know if you seen the CSV import module by Ryan in the download section... https://github.com/ryancramerdesign/ImportPagesCSV
  22. Not sure, it works for me. What browser? PW version?
  23. I'm currently using this module to render simple contact form and it works great so far. Now I got a page reference field with a select inputfield for selecting a category. These categories are pages and they are multilang. So there's 3 fields for title_de, title_en, title_fr. How would it be possible to render the select chosing the option text from the current language? So far I've added a parameter to the ___render($lang) function and give that to the ___buildForm function where the form is built. How can I make it (if ie inputfield->name is "category_select") using like "title_$lang" for the option text. Or maybe simpler /alternatively, how can I build the select menu using API? Any help is appreciated. EDIT: I should first investigate.. then ask I found the simplest solution: <?php if($inputfield->name == "formfield_category_select"){ $inputfield->labelFieldName = "title_$lang"; } This sets the field chosen from the reference pages for the inputfield select. Amazing, didn't thought it was that simple. EDIT: Only problem now the select has id's as value which get sent by email, how could I set the option value to be the title? EDIT: Well I think this wouldn't be easy possible, no? Now what I did is a simple check, when preparing the mail content for sending email, for the fieldtype label. If it's the category select, I do a find using the id and return the title_de, title_en ...
  24. I just tested some more and it was me getting confused, but I can confirm it works with multiple matches. Now I notice a problem concerning multiple words, using any of the *= %= ~= . I search for : "lift notfall" = no results. "lift" = 4 results ("notfall" doesn't relly exist somewhere) This is on a search over simple fields: title|textfield|textfield Edit: Ok I understand it that "~" is only if all words exactly match. It doesn't match only parts of words like with %. But when using % it doesn't search with multiple words. How would it be possible to archive this having multiple words? I know search is not an easy topic and I've done it only roughly few times in the past, last doing it using Doctrine ORM with CI and performing index searches using Doctrine Search, was hard to find the right way that's working fine with multiple words. Like searching for "zeit bern" it finds "Berner Zeitung".
×
×
  • Create New...