Jump to content

Search the Community

Showing results for tags 'fields'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL







  1. Hi! I am building a website and it would be great to have a way to update the value of a field when other is changed. Let's explain with an example: I have a template for Books. I have a template for Authors. In the Books template I have a field called Author, with the type page, and restricted to the template books. When I insert a Book, I simply fill the Author in the field. Imagine that now I have a lot of Authors and Books inserted, and I want to link them. The easiest way is to go to the Authors and fill in the Books, so I have to edit less pages. Is there any way to to it? I have though on adding a new field on Authors called Books, so when I fill it, the author field gets updated in the Authors automátically. Is this possible? Thanks!
  2. Hello, im porting my first static site to PW and still trying to get my head around all the options and logics..maybe you can help out. I have a simple list (ul>li) of Names on the page, which i want my client to alter at any time. Right now, the only option i see is to create a textfield with the CKEditor. Is there a more more straight foreword way to accomplish this, like creating one field in which my client can put comma separated names, and i loop through this field in the template? I tried to find something like this in the cheatsheet but im still struggling with all the options. Thanks for your help.
  3. Hi, I'm playing with my first "fields". I have accented characters : é, è,... to display. I don't really understand how to handle this. Previously I stored them html encoded in my own DB tables, example : "évènement" (means 'event' in french). Now I want to replace my own PDO SQL queries by PW fields. Do I need to paste html encoded content only within the fields in the admin or will it be encoded on the fly ? Until now I didn't success to view html encoded version of my data through the view source page in the browser, it's displayed as 'é', 'è', I was waiting for "é" ... I've tried CKEditor and the textarea, I've played with the markup/html - html entity encoder functions with no more success. Any idea ? Thanks
  4. I am using a PW installation as a template for every future PW installation. So within that I create all kinds of fields and templates for many different use cases which might not be used later in a copy installation so I delete all unused. What would be a good way to delete them fast instead of clicking every single template and field and delete it in the delete tab?
  5. Hello, Is there a way to group together fields, like in a repeater field, but only allow there to be one set per template? I looked into the fieldtab field but this doesn't allow for certain features that a repeater would - ie, allow the same field to be used at least twice within a page (eg, outside a repeater and within a repeater), and to add a group of fields into a template as one chunk. This would seem like a handy feature feature and I'm probably missing something! Many thanks in advance, ben
  6. Hi all. I'm creating module and it needs to create some actions in admin panel to work correct. So it would be great if somebody tell my how to do some things below using api (___install() method): create fields put fields to template Thanks
  7. I have a module that creates a bunch of fields and none of the Options type are saving their values. The options I have set appear in the page editor, however when I go to edit any of these fields the textarea where the options are supposed to be specified is blank. $f = new Field(); $f->set("name", "iu_do")->set("label","Action(s)"); $f->type = wire('modules')->get('FieldtypeOptions'); $f->set('inputfieldClass', 'InputfieldCheckboxes')->save(); $f->options = [0 => "Import", 1 => "Update"]; $f->set("required",1)->set("optionColumns",1); $f->set("tags","-impupd")->set("columnWidth",50)->save(); How do I do this right? Thank you.
  8. This is in my module's install() function: $f = new Field(); $f->type = wire('modules')->get('FieldtypeSelectExtOption'); $f->set("name", "iu_template")->set("label", "Template"); $f->option_table = "templates"; $f->option_value = "id"; $f->option_label = "name"; //$f->filter('id not in (2,3,4,5)'); $f->set("required",1); $f->set("tags", "-impupd")->set("columnWidth",50)->save(); $f = new Field(); // set to select from template's allowed parents $f->type = wire('modules')->get('FieldtypePage'); $f->set("name", "iu_parent")->set("label", "Parent"); $f->set("derefAsPage",1)->set("required",1); $f->set("findPagesSelector","template!=admin,hasParent!=2"); $f->set("tags", "-impupd")->set("columnWidth",50)->save(); $f = new Field(); $f->type = wire('modules')->get('FieldtypeOptions'); $f->inputfieldClass = 'InputfieldCheckboxes'; $f->set("name", "iu_actions")->set("label", "Action(s)"); $f->options = ["import" => "Import", "update" => "Update"]; $f->set("tags", "-impupd")->set("columnWidth",50)->save(); $f = new Field(); $f->type = wire('modules')->get('FieldtypeOptions'); $f->set("name", "iu_uid")->set("label", "Match Field"); $f->description = "Values must be unique."; $options = array(); foreach(wire('fields') as $opt) { $options["{$opt->name}"] = "{$opt->title}"; } $f->options = $options; $f->set("required",1); $f->set("tags", "-impupd")->set("columnWidth",50)->save(); Oddly every time I install the module the second field `iu_parent` says it still needs configuring, without fail; I have to go to the field editor and just save it as it is one time. Anyway the real field in question here is the last, i.e., `iu_uid`. That method of adding options is entirely ineffective, sadly; it adds none at all. What I need is for it to dynamically populate with the fields in the previously selected template's fieldgroup on saveReady. This is possible with page fields, to dynamically populate options based on another field's value. Alternatively I can set up `iu_uid` like so: $f = new Field(); $f->type = wire('modules')->get('FieldtypeSelectExtOption'); $f->set("name", "iu_uid")->set("label", "Match Field"); $f->description = "Values must be unique."; $f->option_table = "fields"; $f->option_value = "id"; $f->option_label = "name"; $f->set("required",1); $f->set("tags", "-impupd")->set("columnWidth",50)->save(); Then I would just need for a hook to filter the options to correspond with the `iu_template` value. Any pro tips/guidance to spare on this subject?
  9. I need this field in a template, and then another select field which is dynamically populated with field names/references to those present in the previously chosen template for options. Any tips?
  10. Hey, I was wondering if there's a way to add more fields to specify when creating a new page. At the moment, the only two fields are required for creating a new page. Title Name (Automated) I've configured processwire so that the chosen page to create is limited to one template. Guess this would make the process to achieve the above a bit easier. Regards,
  11. Finding it quite fustrating work with fields from a module, I cant seem to find any good docs or forum threads. For example I'm making a new field on install of my module, but ideally I would like to know how to set flags, default value, max- min etc for that field but it's not obvious to me. All I can mange so far. $f = new Field(); // get a field type $f->type = $this->modules->get("FieldtypeInteger"); $f->name = $this->fieldName; $f->label = 'Publish Page later'; $f->save(); // save the field I'm finding this elsewhere with integrating with the admin, but not at all with the API itself which has great documentation. Any advice, guidance would be great!
  12. Hi, i just discovered that i can't change the field type after making a field. I made a field "checkbox" and later i decided to want that field as a radio button (Select Options Fieldtype) with two options. But i can't change it under "Basics" -> "Type". I've to delete the field and then make it new. Then i can choose the Select Options Fieldtype. I'm doing something wrong? PW 3.0.24 Mario
  13. Hi, another stupid question from a PW newbie. I'm working on a page which displays team members with some information (name, phone number, ...). For the person who edits these infos later i wanna make it as simple as possible to change the entries. I was trying to use the repeater field for some sort of grouping the infos for the several team members in the backend. This works like expected. But how to display the entries in the frontend? There i need the separate fields (name, number ...) to be able to do a formatting. Is there another way of grouping the fields in the backend, but access the individual fields for displaying in the frontend? Mario
  14. Hi everybody! I'm trying to figure out how to do what is mentioned into the title but I'm stuck into this issue and can't get a valid idea, still Let me to explain better what I'm looking for. I've seen some module (and I can't remember the name ) that asks to the user to fill a field and save the data before to come back to the module settings with other fields enabled and (maybe) pre-compiled using the previously filled field. What I'm trying to do is to make a module using the new PW 2.5.x syntax (the one which separates the module from its configuration via <module_name>Config.php file) that at installation time asks the user to select from the available templates, then submit the choice. Once submitted, the module should provide more setting fields based on the previously choosen template. It would be a great help if someone could help me to figure it out and/or point me at some module which implements this kind of logic. Thanks in advance!
  15. Hello, just another wish on my list: Multiple instances for same field. E.g. I have got a simple "text" field that's just a CKEdtior textarea. If I want to use two or more text fields, I need to dublicate the "text" field to something like "text2". I know that every field is unique because of the database structure behind. Is is still possible to make something like this for this problem? Maybe save everything to same table in database but somehow add a "instanceNumber" field that separates "text1" from "text2"? It isn't a big thing, because cloning is easy. I really like to keep redundancies low and cloning fields isn't that great, so I share this wishlist. Maybe there is some way and I don't know about it, so let me know
  16. I see it's possible to Export and Import data from the Templates and Fields panels. Awesome. Is it possible to configure these settings in a text file or files that live in the site directory? The /site/templates directory already contains PHP files for each template, but they don't cover the template and field metadata that one configures using the ProcessWire admin panels.
  17. As I’m getting a bit more into the e-commerce idea I was talking about in one of the other threads, I have been thinking about the PW template system. In a shop system you’d need a kind of basic product template with certain necessary fields like default price or something like that. But you’d also need the possibility to have variations of a product template, where additional fields can be defined individually for a certain kind of product. I know that there is the possibility to clone fields from an existing template. But I don’t think, that is a good solution for this particular problem, as you were able to delete some of the basic product data fields. So my thought was, that it maybe would be a cool thing to be able to define a kind of relationship between templates. Like a class extending another one you could define an existing template as parent and the child template would inherit all fields and settings. New fields could be added, the inherited fields were kind of protected, the settings could be overridden by the ones defined for the child templates. I guess, this could be achieved by a module pretty easily. But I think it could also be a pretty nice enhancement as a core feature.
  18. I've got a large number of new field definitions and associated data in a development site, all of which needs to be deployed to a site that's already live in production. I know I can export/import the field data via CSV, but I'd also like to avoid the laborious process of manually recreating all of the field definitions. Looking at the database schema, it seems like I could do a structural sync (e.g., using a tool like Navicat) to add empty versions of all of the new per-field tables ("field_myfieldname"), then sync the data in the following tables: fieldgroups fieldgroups_fields fields fieldtype_options It looks like that would recreate the structure. I wouldn't sync the actual field data that way, as it looks like an easy way to get ID mismatches. I can test this on a copy of the database, but thought I'd get opinions here. Seem like a reasonable approach, or bad idea (because...)? Thanks, Jason
  19. Hello, I am building a dynamic frontend form from fields of a page, following Soma's great gist example. The form is working fine, except for multi language values. After this part of the code $form->processInput($this->input->post) when I loop over the form fields, I don't know how to access the multi language values of a field foreach($form as $field) { // how to get multi lang values here } What I tried is not working foreach($form as $field) { if($field->type instanceof FieldtypeLanguageInterface) { foreach ($languages as $lang) { $langval = $editpage->$field->getLanguageValue($lang); $editpage->$field->setLanguageValue($lang, $langval); } } else { $editpage->set($field->name, $field->value); } } Actually the $field->type returns just "text" for a PageTitleLanguage field. var_dumping the $field reveals that the language values are stored deep inside the object like 'value1023' => string 'Testworkshop2' (length=13) 'value1032' => string 'Testworkshop2 Englisch' (length=22) So how would I access those other than pulling them directly from $this->input->post?
  20. I'm not sure how to even phrase this question, I think I need to learn more specific vocabulary to even ask it. But here goes: With a Processwire site, how does one deal with synchronizing data between a local development database and a live production database? Specifically, the following scenario. Let's say I'm developing a site for a small business client: I develop the site locally, and eventually deploy it to a server The client starts using the CMS, and entering data which is saved in the production database The client requests a new feature -- let's say it requires adding a few fields to an existing template I add the fields to the template on my local development machine Now how do I get those changes to the live site, without overwriting the data the client has already entered? The way I am currently handling this is as follows: I ask the client to stay out of the admin area and stop making changes I dump the production database, and import it to the local dev database I make the changes to the fields / templates I dump the dev database, and import it to the production database Is there a better, more efficient way? Are there specific database tables that define the "idea" of fields and templates, but not their content? In the Rails world, this sort of task would be a "rake db:migrate". One solution, I guess, would just be to connect my local dev site to the live production database once a site is live. But I prefer to be able to work offline if needed, and sometimes I'm dealing with shared hosting services that have limited or unreliable external database access. Forgive me if this is covered elsewhere, or already has a well-documented and obvious solution. I would love to hear any thoughts or suggestions.
  21. I had a sidebar template set up with a repeater (as it needed to display links offsite) and everything was going smoothly: <ul class="sideNav" data-spy="affix" data-offset-top="490" > <?php foreach($page->selectHeader->pageSidebar as $sideNav) { echo "<li><a href='{$sideNav->sidebarURL}'' >$sideNav->sidebarTitle </a></li>"; } ?> </ul> The repeater was set to include 2 fields (the link title and link URL) and output it in my template (usually constrained to 8 links). However, I now realize that I must remove the 1st and 3rd links and put them in another template as they are dependent on the page (and cant just be entered manually. My question, is it possible to inject the two links into the foreach loop so that they still appear in the 1st and 3rd spot respectfully? The two were changed to a page select, but I didnt know if that was even possible to achieve. I was hoping that I didnt have to create 8 separate fields to achieve the desired result.
  22. I am coming up close to when I need to move over my local branch to the live site and was wondering is it actually possible to move the templates (with assigned fields) over to the new site without having to reassign the fields? I know I can backup/import the fields themselves, but I have 78 fields assigned between 2 templates that would be a pain to "redo". Thanks again for all the help everyone. I am loving processwire thus far.
  23. Silly question maybe, but I'm new to PW. How can I retrieve the value of a custom field? I'm trying for the label: <?php echo $fields->get("caracteristicas_superficie")->label; ?> And it's working just fine, but: <?php echo $fields->get("caracteristicas_superficie")->value; ?> doesn't work Thanks very much.
  24. Hi! This is my first posting at this forum and I am on my first PW website. The CMS looks pretty cool and I like its approach of handling data. Well, there is just one thing I don't understand or perhaps that way is new to me. The assets management. My website (about 100 pages) has a slider with 3 images in its header. As I understand I have to attach an image always to a particular page. If I want to use the same image on another page, I have to upload it again. Right? I can't access it from a field on another page (beside access via TinyMCE). Thanks for help! Sebastian
  • Create New...