Jump to content

Search the Community

Showing results for tags 'fields'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • 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

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

  1. Hello - Total newbie here. I'm using the Profields module to make a table for settings. I would like for one row to contain a "copyright date" with a corresponding integer value according to https://processwire.com/talk/topic/8373-use-delimited-texarea-table-or-yaml-for-settings/ I have this code (courtesy of @Macrura) $copyYear = 2015; // Set your website start date $curYear = date('Y'); // Keeps the second year updated echo $copyYear . (($copyYear != $curYear) ? '-' . $curYear : ''); I want to set the value for $copyYear in a text field. Will it be parsed as an integer? Thanks!!
  2. Hi, On a project I'm working on I have a select options field that you can select what type of content you're posting. It has the following options: 1=Article 2=Q and A 3=Visual snippet 4=Gallery 5=List The assigned template has an icon (file-text-o), which is great for articles but maybe not so for galleries. Is it at all feasible/possible to change the assigned icon based on a field value within a page? Or even append a page title in the tree with an icon based on a field value?
  3. I am creating a custom search routine. This code of Ryan has been very useful to encompass all fields of the page. foreach($page->fields as $field) {echo "<p>"; echo "Field: {$field->name}<br />"; echo "Type: {$field->type}<br />"; echo "Value: " . $page->get($field->name); echo "</p>"; } But I failed to get the subfields of repeater's field type. It may be something simple, but I have several hours trying with unsuccessfully options. Any suggestions?
  4. Hello everyone, Been working rough 5-6 months with this beast and i gotta tell you that it's almost perfect Of course every software has it's ups and downs, just like life does and nothing is perfect or meant for everyone, but here we go... I think database structure is about correct and flexible enough, what i don't like is that i can have similar field with 3x different prefix just because i need different control data for that same field. How about if template would control fields data instead of field? Field could have it's own control data as default, but i would really like to see that template could at least control some data, like visibility, appearance, required, stuff like this. Why? Because past 5-6 months i faced fact that for example when i need to custom admin interface for some template i would like to use same field over and over again, but it's kind of impossible when width can be 50%, 33% or 100% for different templates, data how ever is very same. Feels so stupid to create field over and over again, when it could use existing database tables. You already have control tables for fields and data tables separated, which is good model, so how big deal would this to be to implement something like this? If this already exists and i'm blind, lemme know and i'll buy you beer I hope i'm not the only one feeling like this, cheers for listening
  5. Oleg

    fields

    Hi! How to print the value of $ fields from one template in another template?
  6. Hi guys, As the title tries to explain, I have created custom fields for users on the backend like images, job title, description etc. and that works fine if you have access as a user to the 'user-admin' role but if I give team members this role if means they can access each others profile settings and update passwords. I would like to show the fields that have been created for users under the profile page so that the users can update their custom fields. Is this possible from the back end easily? Hope that makes sense. Any help would be greatly appreciated! Cheers
  7. Hello all, First time poster here. I've been playing around with ProcessWire for some time and am currently in the middle of my first project based entirely on PW. I have a problem with the field type drop-down list in the "Add new field" tab. All of the sudden it's blank. Am I missing something, or is this an error? It looks like this, no field types, nothing. I didn't even modify any particular settings in the meantime. Half an hour ago it was working just fine. Thanks in advance for any help.
  8. Hi Guys, I have just started to experiment with Processwire and really like what I see so far. I am hoping to try my first production site on it soon. I have long been a wordpress user, but want something new and more efficient. I am wondering if there is a module/feature similar to this for wordpress: http://www.wpallimport.com/ it's a full XML importer where you can import to create new pages (posts on wordpress) and map parts of each entry to certain fields of each page. Is this possible for Processwire? I use this with the advacned custom field plugin on wordpress to great effect. Each time the plugin is run, it will update the posts if they have already been created, and add new ones for new entries in the XML feed. I've seen this module, but does it work with the latest version, and could it work with what I need: http://modules.processwire.com/modules/process-data-import/ If anyone can point me in the right direction I would appreciate it. Thanks, Aaron
  9. The field is empty, the template has over 2 million pages. So of course caution is necessary... I can't try anything too crazy. When I try to delete the field in admin area, as soon as I click on the confirmation checkbox and submit, it goes straightaway (fraction of a second) to a Bad Gateway 502 (nginx) error page. I also tried the API solution outlined by kongondo here: https://processwire.com/talk/topic/7480-removing-a-field-from-database/?p=72039 - it does not work, the script just stops running (again very quickly) at the save() part. Also tried deleting from the $fieldgroups api variable instead of from $templates. Same issue. Here is what I am getting from debug=true: Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 72 bytes) in /www/wire/core/PageFinder.php on line 306 Call Stack: 0.0000 242496 1. {main}()/www/index.php:0 0.0663 4512544 2. ProcessPageView->execute()/www/index.php:240 0.0663 4512896 3. Wire->__call()/www/index.php:240 0.0663 4512896 4. Wire->runHooks()/www/wire/core/Wire.php:320 0.0663 4515024 5. call_user_func_array:{www/wire/core/Wire.php:365}()/www/wire/core/Wire.php:365 0.0663 4515360 6. ProcessPageView->___execute()/www/wire/core/Wire.php:365 0.0721 4647600 7. Page->render()/www/wire/modules/Process/ProcessPageView.module:172 0.0721 4647784 8. Wire->__call()/www/wire/modules/Process/ProcessPageView.module:172 0.0721 4647784 9. Wire->runHooks()/www/wire/core/Wire.php:320 0.0722 4652776 10. PageRender->renderPage()/www/wire/core/Wire.php:387 0.0722 4653128 11. Wire->__call()/www/wire/core/Wire.php:387 0.0722 4653128 12. Wire->runHooks()/www/wire/core/Wire.php:320 0.0722 4655256 13. call_user_func_array:{www/wire/core/Wire.php:365}()/www/wire/core/Wire.php:365 0.0722 4655592 14. PageRender->___renderPage()/www/wire/core/Wire.php:365 0.0726 4696624 15. TemplateFile->render()/www/wire/modules/PageRender.module:356 0.0726 4696808 16. Wire->__call()/www/wire/modules/PageRender.module:356 0.0726 4696808 17. Wire->runHooks()/www/wire/core/Wire.php:320 0.0726 4698936 18. call_user_func_array:{www/wire/core/Wire.php:365}()/www/wire/core/Wire.php:365 0.0726 4699104 19. TemplateFile->___render()/www/wire/core/Wire.php:365 0.0727 4723816 20. require('/www/site/templates/delete.php')/www/wire/core/TemplateFile.php:169 0.0742 4726296 21. Fieldgroups->save()/www/site/templates/delete.php:14 0.0742 4726648 22. Wire->__call()/www/site/templates/delete.php:14 0.0742 4726648 23. Wire->runHooks()/www/wire/core/Wire.php:320 0.0742 4728464 24. call_user_func_array:{www/wire/core/Wire.php:365}()/www/wire/core/Wire.php:365 0.0742 4728800 25. Fieldgroups->___save()/www/wire/core/Wire.php:365 0.0745 4733760 26. FieldtypeInteger->deleteTemplateField()/www/wire/core/Fieldgroups.php:196 0.0745 4734200 27. Wire->__call()/www/wire/core/Fieldgroups.php:196 0.0745 4734200 28. Wire->runHooks()/www/wire/core/Wire.php:320 0.0745 4736336 29. call_user_func_array:{www/wire/core/Wire.php:365}()/www/wire/core/Wire.php:365 0.0745 4736760 30. Fieldtype->___deleteTemplateField()/www/wire/core/Wire.php:365 0.0745 4737192 31. Fields->deleteFieldDataByTemplate()/www/wire/core/Fieldtype.php:878 0.0745 4737632 32. Wire->__call()/www/wire/core/Fieldtype.php:878 0.0746 4737632 33. Wire->runHooks()/www/wire/core/Wire.php:320 0.0746 4739464 34. call_user_func_array:{www/wire/core/Wire.php:365}()/www/wire/core/Wire.php:365 0.0746 4739888 35. Fields->___deleteFieldDataByTemplate()/www/wire/core/Wire.php:365 0.0754 4743128 36. Pages->find()/www/wire/core/Fields.php:536 0.0754 4743480 37. Wire->__call()/www/wire/core/Fields.php:536 0.0754 4743480 38. Wire->runHooks()/www/wire/core/Wire.php:320 0.0754 4745344 39. call_user_func_array:{www/wire/core/Wire.php:365}()/www/wire/core/Wire.php:365 0.0754 4745680 40. Pages->___find()/www/wire/core/Wire.php:365 0.0758 4749608 41. PageFinder->find()/www/wire/core/Pages.php:199 0.0758 4750048 42. Wire->__call()/www/wire/core/Pages.php:199 0.0758 4750048 43. Wire->runHooks()/www/wire/core/Wire.php:320 0.0758 4751864 44. call_user_func_array:{www/wire/core/Wire.php:365}()/www/wire/core/Wire.php:365 0.0758 4752288 45. PageFinder->___find()/www/wire/core/Wire.php:365 Hope this is enough information for one of you seasoned folks to help me out.Thanks in advance!
  10. Hello all! I'm Andrea and I'm new in PW world. Lovely place, i like it! It's the perfect hook between cms and framework! But now, we come to the question. - It's possible to duplicate (throught .append() jquery method) the form section in backend admin panel? (i.e. http://tristandenyer.com/using-jquery-to-duplicate-a-section-of-a-form-maintaining-accessibility/) I created a form backend, allowing the user to enter information, but I would like to duplicate a section (the section name products). - is there the possibility of generating a .jpg or .pdf from a php page? Sorry for my bad english guys !
  11. I am looking to create a multiselect field that allows a user to select some PicasaWebAlbums on the admin side of PW. I know how to get the PicasaWebAlbums list and all, but it requires PHP. I also know how to make a multiselect field the Page input type and defining which parent holds the select options, etc. What I do not know is how I can create a custom multiselect field that is generated via PHP. For example: I have a list of albums from PHP (these are not actually what I have but you get the point): - id: 1000, title: Album 1000 - id: 1004, title: Album 1004 - id: 1008, title: Album 1008 - id: 1005, title: Album 1005 - id: 1003, title: Album 1003 How do I make a multiselect field where the options are: <option value="1000">Album 1000</option> ... etc ... Is this possible? Do I have to make a module? Point me in the right direction
  12. My vessel template has a price field (actually field group: with price_currency, price_amount). But when the price is lowered, the listing should qualify to appear on a "Price Cuts" page automatically... so here's what I'm doing (or skip to the bottom): So I was thinking I could add another couple of read-only fields, price_amount_was (since it's unlikely that the currency would change) and price_cut_date. price_amount_was would default to the set price once one is set on save (starts empty, stays empty until a price is set and the page saved). price_cut_date would be null by default. Then another hook after page save would check if the price_amount is lower than price_amount_was, and if so, change the price_cut_date to the current day. Then my Price Cuts page could just show "template=vessel, limit=10, price_cut_date!='', sort=-price_cut_date". But if I wanted to keep a history of price cuts for each listing, that wouldn't work. I could use a repeater field but I don't think that's all that necessary, since only the current and last price (or I guess that'd be second-to-last, last is current) need be queryable. I could add another read-only textarea field, price_history, and on every save that the price is changed, append the price and date (comma-separated, followed by a newline). So that's what I'm trying to do now, but I don't know how to append to price_history. In my module init I hook after page save, this function: protected function setPriceHistory($event) { $page = $event->arguments('page'); if($page->template != 'vessel') return; if($page->price_amount) { //$this->message("Price exists"); if(!$page->price_amount_hold) { $page->set("price_amount_hold", $page->price_amount)->save(); // append price_amount, date(), newline to price_history $this->message("Updated hold price to current price."); } if($page->price_amount < $page->price_amount_hold) { $page->set("price_amount_was", $page->price_amount_hold)->set("price_amount_hold", $page->price_amount)->set("price_cut_date", wireDate('Y-m-d'))->save(); $this->message("Price Cut set on {$page->price_cut_date}."); } } } So you see that commented out line in if(!$page->price_amount_was){}... I could set the value, but I don't want to reset it, just add to it. Thanks.
  13. This works for me to support page references in Ryan's ImportPagesCSV.module, in function importPageValue: elseif($field->type instanceof FieldtypePage) { $value = trim($value); if(wire("pages")->find("$name=$value")) $page->set($name, $value); } I need to also be able to import repeater fields though.. Anyone know how to do that?
  14. public function init() { // add a hook after each page is saved $this->pages->addHookAfter('saved', $this, 'populateDefaults'); } /** * Populates model defaults after save for corresponding blank fields. * */ public function populateDefaults($event) { $page = $event->arguments('page'); if($page->template != 'vessel') return; //$this->message("hi {$page->model->hulls}"); if($page->model && !$page->hulls && $page->model->hulls) { $page->set("hulls", $page->model->hulls); $this->message("hi $page->hulls {$page->model->hulls}"); } } This sort of works; the message echoed is "hi 1082 1082". When I set the hulls to null in the above code, it then goes back to "hi 1082". However, it doesn't update the select input in the edit screen, and the "Missing required value" error for that field remains... Also the message shouldn't even be showing if $page->hulls is set... How can I get it to update the field value and the input?
  15. I have a page field 'make', which consists of manufacturer template pages. A new page can be created from that field, but I currently have that functionality disabled, since following that field is another page field 'model' with a custom selector, 'parent=page.make, template=model'. So since the model field parent is dynamic, new pages cannot be created from the field, as the first requirement for that feature is that a single parent and template be pre-selected... Is there some way I can hook into the options there and add an 'Add New' option at the bottom, opening up the new model in a modal? Thanks.
  16. I need to make these fields for a particular template: Condition={New,Used} and Style={one,two,three}. Is there really no simple way of doing this without making Condition and Style pages with their respective children/options?
  17. $pages->get("/stories/")->find("external_status!=accepted"); This selector works as expected, excluding all the story pages that have "accepted" in the external_status field, but it also excludes stories with no external_status defined (field is empty). How can I make sure those pages are included?
  18. Hello everyone! I just added a new language to an already functioning system, and some fields are not accepting the version in this new langauge. The tab for the language appears "lighter" as seen in the picture, and when text is inputted and "Save" is clicked, it goes back to being empty. Any suggestions??? THANK YOU!!
  19. It struck me today, as I was working on a large site, that it would be really nice if the Setup -> Fields fly-out menu would implement the "Tags" feature to group fields into sub-menus. I use Tags (defined under the 'Advanced' tab when editing a field) to neatly organize fields on the actual Setup->Fields page. It would be great if the menu was also organized the same way. A single fly-out menu of 50+ un-grouped fields isn't so useful... What do you think?
  20. Hi, Can someone please help me with the scenario below, I am trying to build a Project portfolio sort of a site. I have a homepage which displays three recent items from a Repeater field named my_items (3 RepeaterReady fields are created for the home page and filled with data), example code below: <?php foreach ($page->my_items as $item) { ?> // display item values, for example: <div class="item"> <img src="<?php echo $item->my_image->url; ?>" /> <a href="<?php echo $item->my_link->name; ?>">View</a> </div> <?php }; ?> I have a page called my-items with repeater 'my_items' field for displaying the same as above. The page 'my-items' has children, each of which have 'my_items' Repeater field for displaying data respective to that page using the same code as above. The page/ site hierarchy is like: Home - uses Repeater 'my_items' |- My Items - uses Repeater 'my_items' |- Item 1 - uses Repeater 'my_items' |- Item 2 - uses Repeater 'my_items' |- Item 3 - uses Repeater 'my_items' |- ... |- My Items 2 |- Item 1 - uses Repeater 'my_items' |- Item 2 - uses Repeater 'my_items' |- Item 3 - uses Repeater 'my_items' |- ... and so on. What I am doing as a starter with PW is: - Entering same data for in Repeater for Home for some item, lets call this 'A'. - Entering the same for My Items the data for 'A' - Entering the same for Item 1 the data for 'A' Therefore, I am adding 'A' thrice in three places, violating the DRY principle. What I have tried and failed is: - To get 'A' to display in My Items page fetched from Item 1 and then, - the Home to display 'A' fetched from My Items so that I only enter data for 'A' in Item 1 and not in every page that displays it. Caveats: - The homepage displays 3 recent only from page My Items - Page My Items displays one from each children - Item 1 has multiple Repeater blocks/ pages for displaying data (e.g. My Item #1, My Item #2, My Item #3 .......... My Item #n) Another way I think to explain it would be a photography site with structure as: Home - display 3 recent photo projects |- Projects - displays each child project with the 1st photo and its description |- Nature - Has many photos with description |- Animals - Has many photos with description |- People - Has many photos with description I hope I had explained properly. Any help or suggestion would be highly appreciated.
  21. Currently to change the 'summary' description in context of 'basic-page' we would have to do this: // get the template $t = $templates->get('basic-page'); // get the field in context of this template $f = $t->fieldgroup->getField('summary', $useFieldgroupContext = true); // value of the field $f->description = "'basic-page' summary description"; // save new setting in context $fields->saveFieldgroupContext($f, $t->fieldgroup); What I'd like is something like this // get the field $f = $fields->get('summary'); // value of the field $f->set('description', "'basic-page' summary description", $context = 'basic-page'); // save new setting, perhaps optional, because behind // the scenes `saveFieldgroupContext` has been called already? $f->save(); Similar for getting in context: $f->get('description', $context = 'basic-page'); Not only is it more intuitive, but less verbose, in my opinion. What do you think?
  22. Hello. I'd like to clarify something that's in the back of my mind for a while. If i have 10 fields with the same parameters, except only the labels, for example scatered in different templates, i must have 10 different copies of those unique fields?
  23. Currently there is no way for an editor to change those fields. Both are static. Even from the API. But sometimes – especially when using a news site or some kind of blog – you have to use those fields a lot. It would be nice if the fields become editable, so you can change the creation date for example.
  24. I have a checkbox field that I need to split into two checkboxes. Currently, the single checkbox determines whether a badge appears next to an entry on the front end, but now that badge should only appear if both checkboxes are checked. So when I add the second checkbox, I'll need all the old pages that were created when there was only one checkbox to now have both checkboxes checked so that the badge appears based on the new template logic. Any suggestions that would be more efficient than manually going through and editing all the old pages by hand?
  25. Hi Guys, In 2.5 we can export the fields. I am wondering whether there is a way that it can handle importing the json from the modules when installing. Eg : A module is created which uses certain fields. I have exported the fields via export and keeping it at some fields.json . Does PW have the ability to find the fields.json and import the fields . This is just a question to know whether something like this have been added into core. Thank you
×
×
  • Create New...