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. I'm in the process of building an internal tool using ProcessWire for my team to write and manage Agile user stories. (It actually started out as a quick prototype, but you know how things go with ProcessWire, I kept going for a few hours and suddenly had a pretty full-featured system. ) The way we do user stories, we have a story ID, such as "OP100", and then a title, such as "As an admin, I want to upload a PDF to attach to a user's account." I have these as separate fields, with the latter being the actual page title. These titles can get somewhat long, however, and can change throughout the lifecycle of a user story, breaking links from Pivotal Tracker. Ideally, I'd like to just use the story ID as the name / URL, so instead of "/as-an-admin-i-want-to-upload-a-pdf-to-attach-to-a-users-account/", the page would just be "/op100/". Further complicating this is that the story ID is optional (since a story can start out as just a concept that turns into an actual story later). So my ideal workflow would actually be one where the title creates the URL initially, but once there is a story ID, the URL changes to that (or even better, aliases to that). One more related thing I'm hoping to do is to concatenate the story ID and title in the admin. Any ideas on how to do this?
  2. How do I migrate a template with all its fields and values to a new site? Is their an export/import process?
  3. I am using module "FormTemplateProcessor" to get data in a pages but they all are unpublished and when I am trying to display them with relevent pages it not working page1 p1 p2 p3 page2 (FormTemplateProcessor) up1 (unpublished page and have p1 id on field knows as "ID") up2 (unpublished page and have p3 id on field knows as "ID") up3 (unpublished page and have p2 id on field knows as "ID") now here up1, ip2, up3 can be created by p1, p2 or p3 and I am saving respectively I'm saving their id in field which is being used by up1,up2,up3, etc template. now I want to show the data from unpublished pages which belongs to p1, p2 and p3 respectively anyone has experienced this or knows something which can help me out ?
  4. A minor gripe but one that trips me up every time. When there's naming error on a field, ALL the field values are erased and I have to setup everything again. IE name, type, label and descriptions details and sometimes notes. Would be really helpful if ProcessWire didn't zap all the values but just cleared the illegal field name.
  5. I have been following @bernhard's great tutorial on creating a Dashboard and everything has very easy to understand so far. However, I need to add a select field that a template is using (so users can create a new page from the dashboard), but I am really at a complete lost on how to achieve this. I have been googling, but can't really find anything on the matter. $field = $this->modules->get('InputfieldSelect'); $field->name = "Select Manufacturer"; $field->findPagesSelector = "template=basic-page"; //not needed for select field $field->labelFieldName = "title"; $field->name = "Manufacturer Select"; $field->columnWidth = 34; $fieldset->add($field); I have the above code, which was originally an InputfieldPage, but since this is an options field, I have changed it. Has anyone actually gotten a select from a template (and its' values) in a module?
  6. Hello fellow Process wire Developers! Today i have encountered an issue using the repeater where I can't find out how to solve it therefore i am asking for help. To be specific, I am trying to get the "file" field working properly in the repeater but i couldn't find a way on how to assign a property of a field that is being used by the repeater. download_pdf is the name of the field that i want to access properties from. What i wished i could do was something like $download->download_pdf.size or $download->download_pdf->name, something like that but obviously these didn't work Hope there is a solution and thanks in advance! Best wishes, Livius
  7. How do you include fields in Twig templates? Tried using {% $page->Title %}, but that creates an error. Thanks
  8. Hi Guys, I recently have received a client who has various page layouts. I wanted to give them the ability to simply add their HTML into a body field with CKEditor to allow HTML customization. However, the client isn't very familiar with HTML. This has left me to build a template that has multiple of the similar field types. The thing is, I cannot use the repeater since I cannot repeat lets say an image for repeated item 1 and only body field for repeater item 2. Therefore, I have to literally add 15 fields for them to totally be able to edit the page without issues. What are your thoughts on this approach? Also, I have to name the template according to what it contains, so I was thinking of using numbers instead of words. Reason being, numbers can describe the amount of title fields, body fields and images. Therefore something like, 3-3-2.php or three-three-two.php I have never run into a situation where the client needed so many fields. I was always able to get around it with repeaters etc. Thoughts?
  9. Hello There fellow PW gurus. I am trying to make a field show as open only if the field is filled out with at string. for example: "my_styles.css" and stay hidden if the field is empty. The field in question is of type "text" if that helps. And i put in the "show this field only if" css_filename!='' because the field name is "css_filename" But no mather what the field is closed because i have choosen it as "closed" as default. What am i doing wrong? i am running PW 3.0.83 Dev.
  10. Based on this forum post, I wanted to find a more elegant solution for changing a field's settings per template. Hooking the page editor after it generates the form works and may still be needed for more complex modifications. But using field & template context, it's easier to modify the field settings and it greatly reduces the need for creating an almost identical field just to adjust a few things. In my blog post, I've written on how to extend contextual options to allow any fieldtype / inputfield settings to be changed depending on the template. Hope you find it useful, and if you have any questions or comments, feel free to post them here. https://abdus.co/blog/doing-more-with-fewer-fields-in-processwire/
  11. Hi guys, is there a way to declare numbers other than integer and float? My issue is that intgere is not enough for me because i'm dealing with multiple of bilions (let's say something like 111,532,372,567) Thanks, Rob
  12. Hello all. I know it might sound silly, but wanted to check how are you guys proceeding if in the theme development you have a need of some fields that are repeating in several templates. For example, I am having an image field that can be used as the site logo in "Settings" template or as to show the page image in the markup of the inner page template or else. I am aware, that if I leave the resizing in the markup, than the field can be used on multiple templates, but the field has some specific label/description, notes and/or placeholder that would be not-related. Sticking to the logo example, I have a label saying: Add your logo image here. So if I use the same field for something else, the same text would show while editing the new next page calling for image. How are you guys taking care of this? Are you creating specific fields for every aspect of your theme or there are some tricks I am missing in the big picture? P.S. Besides the descriptive text of the field some might require to have a single image and some an array (e.g. you don't need to upload multiple logos, unless you want to randomize or call one based on some criterias, but for a gallery - sure I would have multiple)
  13. Hi guys, let's assume I'm developing a site (custom theme with custom fields) for my customer, where he can list any articles. For example: Article1 -> item1, item2, item3, item4, etc... Each item is a textfield. Now if I want to add a new item, in this example item5, then I have to clone an existing field in the admin panel and also add this field to pagefile with PHP. If there would be 100 items, do I really have to clone an existing field and add this field to PHP code everytime? But my main question is: if my customer want's to add a new item (on the admin panel with own user), is there a way that he can clone an existing field (item) and edit the text inside and publish this field on the site, without customizing with PHP?
  14. I've been trying to figure a way to output the values of several fields within a single repeater using a foreach() without having to reference the name of the fields. Typically, for repeaters, I understand you would do foreach($repeater_field as $afield) { echo $afield->fieldname_a; } pretty straight forward. Anyways, what I'm doing is using a single repeater as just a container for other fields. I've tried using $page->my_repeater->getArray(), then looping through the array, and all sorts of methods, without luck. It seems I must specify the field name for output. For instance, my (single) repeater is set up to hold a few different fields: my_repeater field_a field_b field_c Trying to output it using something like this: foreach($page->my_repeater as $afield) { echo $afield->value; // I'm not wanting to have the reference the field name e.g. use $afield->field_a } Any suggestions?
  15. I have a fieldsettab I want to populate with two collapsable fields that are for display not input. One will display data directly from an extra MySQL table (corresponding with PW pages) and the other will list certain PW pages. How do I go about this? I wanted to lay them out using Dynatable, one per each field. Thanks.
  16. I would like to be able to fetch the labels for fields in a language different than the current logged in user. For field values that's easy // p is page, l is language, and f is field $p->getLanguageValue($l, $f); I'm looking for something like $fields->getLanguageValue('en', 'length'); The only solution I know of is to save the current user language, iterate through the languages by setting the user language and fetching the value, and then restore the user language.
  17. I have a category template and each page can be associated with multiple categories using a page field type. i have this in php : - $categories = $pages->find("template=category, limit=6"); I want to sort the results by the amount of pages each category has, is there a way to do this in a selector or is there a better way of doing this?
  18. Hey guys. Need some little help for a newbie. How can i foreach all possible values from existing field of a child template into select form? Trying like this but it showing me results from created pages and their fields. $fields = $page->find("template=item, sort=item_type"); echo "<select>"; foreach($fields as $item) { echo " <option>{$item->item_type->title}</option> "; } echo "</select>";
  19. Hi all, I got a Internal Server Error when accessing de /setup/fields in my back end... Also when i try to reach it through the page tree, i can't edit the 'fields' page, same error. I do modify a image field through the api, i don't know if that has something to do with it, below the code i use to upload an image through the api, I deleted the parts that are not important. If anyone can help me that would be great. To clarify; the code below works fine, my image and page is created as expected, the only thing is that I can't access my /setup/fields/ page in my CMS anymore due to the Internal Server Error. <?php if($input->post->submit) { $photoPage = new Page(); // create new page object $photoPage->template = 'photo'; // set template $photoPage->parent = wire('pages')->get('/foto/'); // set the parent $photoPage->name = urlBuilder($input->title_photo); // give it a name used in the url for the page $photoPage->title = $input->title_photo; // set page title (not neccessary but recommended) $photoPage->save(); // next: process photo upload // Set a temporary upload location where the submitted files are stored during form processing $upload_path = $config->paths->assets . "files/photos/"; // New wire upload $file_upload = new WireUpload('file_upload'); // References the name of the field in the HTML form that uploads the photo $file_upload->setMaxFiles(1); $file_upload->setOverwrite(true); $file_upload->setDestinationPath($upload_path); $file_upload->setValidExtensions(array('jpg', 'jpeg', 'png', 'gif')); // execute upload and check for errors $files = $file_upload->execute(); // Run a count($files) test to make sure there are actually files; if so, proceed; if not, generate getErrors() if(!count($files)) { $file_upload->error("Sorry, but you need to add a photo!"); return false; } //success //echo 'photos stored';exit; $photoPage->save(); //$session->redirect($locationPage->url); } else { ?> <section class="add-location"> <div class="container"> <div class="row"> <div class="col-xs-12"> <h2>Spot toevoegen</h2> <form id="add-form" action="" enctype="multipart/form-data" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size; ?>" /> <div class="col-xs-12 col-md-6"> <label for="fileselect">Upload jouw foto:</label> <p> <input type="file" name="file_upload" id="file_upload" accept="image/*" class="inputfile" /> <label for="file_upload"> <span></span> <strong><i class="fa fa-upload" aria-hidden="true"></i> Kies je foto…</strong> </label> </p> </div> <input type="submit" name="submit" value="Upload" /> </div> </form> </div> </div> </div> </div> <?php } } include('./includes/foot.php');?>
  20. mamo_length_ft is not a field. I don't see it anywhere in the database neither. Where could this possibly be stemming from?
  21. Hey y'all! I've been digging through the forums trying to find a workaround for the Page AutoComplete Field. So far, no luck. Here's the problem: Currently, to use the Page AutoComplete Field, you have to define a single parent for the pages you want to select from. I want to use the AutoComplete field to add multiple pages from different parents. For instance, I have a field for location, and I want to add the MET Museum and The Louvre, but the MET has parent USA, and the Louvre has parent France. Currently, it's very labor intensive to scroll through a list of 300+ locations, or use AsmSelect to drill down. AutoComplete would be a godsend. I've not been able to find any way to workaround this issue, any ideas? Thanks for any help or recommendations! — Reed
  22. Hello guys. I am starting as a new project to work with my daughter on a cooking recipes website to use it as an initial web development learning curve (for both of us ). So far we did the main page and category listings, but now we need to find an approach for adding the ingredients. Initially I thought to add a simple TextArea field and allow to list the ingredients, quantities etc. in it, however that won't allow us to style it properly (especially if somebody else is adding recipes too). What we are trying to achieve is an ability to add ingredients one per line and then style them with a class in between <ul> & <li> (my guess guess is we need to use some php to separate every line from the rest and make it an array or else but how to easily achieve it - that is the question) Any ideas/suggestions how to accomplish that?
  23. Hello, I'm new to PW and like it already I have just created my first site with PW and need some help getting repeater posts from one page to expl. home page. I have a page called Events with template events.php . Page has a repeater field called Events_repeat. Now I would like to show last three events on a homepage, how do I do that. I have tried with: <?php foreach ( $pages->find('template=events, limit=3') as $event ):?> <div class="hovereffect"> <img src="<?=$event->images->first->url ?>" width="100%" class="img-responsive" style="border: 9px solid white;"> <div class="overlay"> <h2><?= $event->images->description->first ?></h2> </div> </div> <? endforeach; ?> But it doesn't work, what am I doing wrong. I tried to look on a forum but couldn't find anything helpful really. Thank you very much R
  24. Hi, I was just playing around with the Repeater fieldtype and wondered if this might be a good fit for something I would call a "FieldCollection". In a FieldCollection the behavior should be exactly the same as in a Repeater fieldtype where minimum and maximum items are set to "1" – just the look and feel in the backend should be slightly different. Think of templates that share two or more fields for the exact same reason – e.g. a "published from" and a "published to" date field and a checkbox. Instead of adding those three fields to every template that needs them, why not create a FieldCollection? Changing the FieldCollection will change the fields on every page it is added to. The only caveat of using a Repeater item set to min and max 1 item is its appearance in the backend: Some of the Repeater features (delete item, add new item, ...) wouldn't be needed for that particular usecase. What do you think? Many greetings! Nik
  25. I have a page which lists articles, and if there are images uploaded via the images field for that page, a thumbnail is displayed next to the article headline. However for a number of pages, I will be placing an existing image from another page in the tree into the body field. In these cases, is there anyway to check the body field's content for an image so I can display that in the article list? Logic would be: If the image field has one or more images uploaded { get first and display as thumbnail } elseif the body field has one or more images placed from another page { use the first body image as the thumbnail } else { omit thumbnail } Anything I can try that would work as shown (or is there an alternative to consider)? Thanks in advance!
×
×
  • Create New...