Jump to content

Oliver

Members
  • Posts

    167
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Oliver

  1. I was thinking of a shared base as a ressource for generating individual site-/client-specific versions from it or just link to it. In what format or media each of us provides the material to clients doesn't matter.
  2. Yeah, thanks for this approach. That would be the solution of choice if there is no alternative way to go without causing numbers and numbers of SQL queries depending on the number of matched pages. I guess, for performance reasons it would be a pretty nice enhancement, if there was the possibility to compare fields within one selector, resulting in a corresponding SQL query after the selector has been processed. If it doesn't go against the logic of PW's selector engine. Edit: I also should have read your code twice before answering. Of course there are no multiple queries here. But it could lead to a whole bunch of pages being loaded for nothing. I'd still be a fan of a pure selector based approach, if there was one.
  3. As our studio is getting close to finishing another project, we are facing the challenge to provide our client with easily understandable materials or kind of a manual on how to manage content in PW. As I guess that this happens from time to time to you guys around here, too, I wonder if it would make sense to collaborately work on a kind of manual document explaining key actions to be done for an editor. So there could be an open document or wiki providing texts in different languages and supportive images we all could use to e.g. turn it into a nice PDF or printed handbook (yes, some clients still like paging through paper) where we just have to replace images. I don't think this work has to be done over and over again by each one of us for his own purpose. And I'm sure, all our clients would benefit from something like this. Also it would be a nice plus for everyone thinking about using PW the first time for a client project.
  4. Had to deal with this prob these days, too. In my opinion, the API should also process the $_FILES var and provide the post files data through $input->files or something within templates etc.
  5. Hey Nico, after the multi-language features ryan implemented for backend and static template content, I'm still re-thinking the purpose of my module. The goal is to keep the idea of separate page trees. But basically the new module won‘t be about languages but about contexts the content belongs to. Such a context can - but doesn't have to - be a language. Or a mobile version of your site. You'll be able to define rules like url matching or client language detection to define what page tree to use. An API object var will give you the possibility to switch contexts. And it will be working together with PWs native language management. The page mapping feature will be provided by an additional module extending the context module by the mapping capabilities you know from language module. As there is still a lot work to do, I can't tell you yet when I'll be able to push a first stable version. Would need some holidays to focus on this one.
  6. Currently I'm facing the problem that I need to select pages by a specific relation between two field values. Is it somehow possible to do something like $result = $pages->find('template=something, field1>field2'); as it would be possible to do within an SQL query? If this isn't possible, yet, I would think about ways to implement something like this e.g. by - in case of a string value - checking if the value matches one of the matched pages' field names or - to be sure it is meant to be treated as a field name - by introducing a notation like “field1=self.field2” similar to “children.count”
  7. Of course. As I am a lazy guy, I took the existing roles field to create the input field with all the roles as options from it. I created an own static function for it, that is part of a management module and returns the field - as it is a default - to its child modules, which use it in their config field form. Method in management module: public static function getRoleConfigField($user_roles) { // prepare roles $roles = Wire::getFuel('roles'); if(!is_array($user_roles)) { $user_roles = explode("|", $user_roles); } $value = new PageArray(); if(is_array($user_roles)) { foreach($user_roles as $role) { $value->add($roles->get($role)); } } // offer user roles to choose $roles_field = Wire::getFuel('fields')->get('roles'); $field = $roles_field->getInputfield(Wire::getFuel('page'), $roles_field); $field->label = __("User roles", __FILE__); $field->description = __("Roles given to users created for this type of login by default", __FILE__); $field->value = $value; $field->name = 'user_roles'; return $field; } getModuleConfigInputfields public static function getModuleConfigInputfields(array $data) { $modules = Wire::getFuel('modules'); $fields = new InputfieldWrapper(); // roles $field = ProcessSocialLoginManager::getRoleConfigField($data['user_roles']); if($field->name) { $fields->add($field); } // consumer key $field = $modules->get('InputfieldText'); $field->name = 'consumer_key'; $field->label = __('Twitter Consumer Key', __FILE__); $field->description = __('Enter the consumer key you got for your site from dev.twitter.com', __FILE__); $field->value = $data['consumer_key']; $fields->add($field); // consumer secret $field = $modules->get('InputfieldText'); $field->name = 'consumer_secret'; $field->label = __('Twitter Consumer Secret', __FILE__); $field->description = __('Enter the consumer secret you got for your site from dev.twitter.com', __FILE__); $field->value = $data['consumer_secret']; $fields->add($field); return $fields; }
  8. Nice, apeisa. Some multisite features would be a great enhancement for PW. For example to provide a mobile site using a subdomain. So this is a nice step forward here. I have been experimenting on something like this several weeks ago, too, but then had to focus on some other modules. So I’m curious about your ideas.
  9. Got another problem here that may be a bug. I’m working on a configurable module and it’s getModuleConfigInputfields method returns a multiple select field for selecting roles. After being processed, the value submitted as an array of course is turned into a PageArray object. When the data is saved in the executeEdit part of ProcessModules, saveModuleConfigData tries to save it as an encoded object within {}. But it doesn’t succeed in storing the actual page IDs, so the config field stays empty. So, I think a PageArray should be saved either as a string (the __toString result separated by “|”) or actually as an encoded array “[id,id,id]”.
  10. That’s the way it usually would be done. But this is a case were I would think about creating a time field type module which generates the select options without pages behind, as the values follow a certain pattern. For example with an option to define time format and the intervals to be shown in the select etc.
  11. Some interesting questions I also have been thinking about from time to time. I know that much: Importing 400+ users shouldn’t be a problem, as the users in the end are pages with templates. And there is a module for importing a page structure from csv files. Assigning a part of the page tree per se to a user should be easy. You could define user-specific home pages with a template that uses a page reference field pointing to the user’s account page. But I don’t think, there is a way to just show the part of the page tree relevant for the user in admin, without a customized module for the page section in backend. As far as I know, the fronted module for forms would just create the forms from a list of defined input fields. What you do with the data submitted to the page defined in the form’s action attribute, is your decision. Creating forms from the field definition of a page’s template and modifying the page’s field values afterwards via API shouldn’t be that hard to achieve. Maybe you also could access the original backend page edit process from your page’s template to save the edits. But I guess, ryan and the other’s will have more information on this to share.
  12. As e-commerce is such a large topic with so many features to discuss etc., I think it would be worth an own forum like language support. I think we will have a lot separate threats regarding products, payments and all the other features. Something like “E-Commerce in ProcessWire”.
  13. I’d say, you are my personal hero, ryan. But I am afraid of repeating myself.
  14. That’s why I love this forum! Some great and really supportive guys around here! Making PW a kind of social experience.
  15. Hi Lance. I actually don’t think there is one as you’d expect it from CMS you may be used to. I usually use the home page’s title as the site’s name and create a var $home at the top of the header include like this: <?php if($page->path == "/") { $home = $page; } else { $home = $pages->get("/"); } ?> and use it e.g. in <title></title> like this: <title><?php echo $home->title.($home->id != $page->id)?" – ".$page->title:""; ?></title> Sometimes I create a custom text inputfield for the site’s name and add it to the home template, so I can take it from there like this: $pages->get("/")->site_name; // or if used like above $home->site_name; When I use the $home solution, I often use the home template to store general information on the site. But you also could create a hidden page as an info container for this.
  16. Not yet? Will it be supported? Is there any way to do something like $this->pages('templates^=shop_product'); currently?
  17. That’s right the way I tried. But there is no module ID saved in the database for the field. It sais 0. But yeah, as I installed your module successfully, it seems to work in your case. But where does it get the ID of the module from, as the module doesn’t have any the moment $orders->save(); is executed?
  18. I have a problem with assigning a process module to a process field as it has to happen on installation of the process module. As the code for assigning is executed as part of the ___install() method of the process module, the module - of course - isn’t actual installed yet and so it has no ID to be saved with the created page’s process field. The ID would be available after the installation has finished. But I haven’t found a way to actually call a second method to do the assigment. I thought about setting a hook on init after ModuleName::install, but as the hook would be set on every init of the module, it seemed not to be a very clever solution. Any other ideas?
  19. Thanks Jim. I just started the module, so there’s no hurry. Gives me time to get an idea of LDAP.
  20. Nice, Jim, even if I have no idea of ldap auth. As I'm working on a module that serves as a kind of manager for different auth modules () and will provide standard login, Twitter and Facebook auth, it would be great to have a ldap auth module for it, too. When you're ok with it, I'd build one based on your code here, as it mostly just needs a bit of reordering.
  21. I know the tab thing, but then the fields are out of sight and out of mind. I've been using the tabs e.g. for page specific SEO data. But often I want the editor to see the field right away when he edits the page for the first time.
  22. As I have been trying to optimize the input masks for page editing for a client a lot lately, I wondered, why there is - on setting up a new field - just an option to make its input field be shown collapsed when empty, but none to make it collapsed when a value is set. The point is, that there are some kinds of page data that has to be set on creation of a new page (e.g. categories, publication date or author) and it's very unlikely this data will be changed later on very often - or at all - in contrary to other data of the page. So it would be a nice feature to be able to force these fields' inputfields to be expanded as long as they are empty and to show them collapsed as soon as a value has been saved. A kind of "do it once and forget" setting that keeps the input form clean and allows to guide the editor's attention.
  23. As I said I've been thinking about creating a kind of short cut InputfieldType similar to ryan's idea of repeatable fields. But this one would allow to manage a page's hidden child pages of a set of allowed templates skipping the way through the page tree. It's something I think would help people editing contents to work faster and avoid mistakes. And it still would keep the data hierarchically consistent within the tree. In the case of Repeatable Fields I guess it's all based upon FieldtypeMultiple and ryan stores the IDs of the hidden pages representing the single repeatable elements in the DB like in FieldtypePage. The point is, that - in case of my Fieldtype's idea - it wouldn't make sense to store any additional information in the db, as all information would be already stored within the pages' relations within the page tree (children, IDs, sort values). But when I'm not totally wrong, the Fieldtypes expect a DB scheme to be provided for installation, saving and getting values. Which methods do I have to override to work around using an own DB scheme and just provide data from API calls? Is it possible at all?
×
×
  • Create New...