Jump to content

pppws

Members
  • Posts

    46
  • Joined

  • Last visited

Everything posted by pppws

  1. ahh! slight misunderstanding: those are two forms. 1) is just this, which creates the new pages and sends the url to the users e-mail address (the name of the pages is the md5hash of the email and gets replaced with the 'name' input from form w), which is working fine 2) when the user is opening the link in the e-mail something like that shows up: i will have loops for: givenname year of birth year of moment last edited professions cities countries
  2. ahhhhhhhhh. you are fantastic – but the persons need to be able to enter new professions: thats why i thought the hook for the current pages won't work?
  3. i'm not quite sure if i undestand you right: the code is belongs to the page table? and the 2-way relations problem also? the persons don't own users. they enter their e-mail adress in a form, by pressing submit a page is created and the 'status' of the page is set to 'editable'. the persons gets the page link via e-mail and can start filling in the blank input fields: jobs, loctions, name etc. i'm just confused what's the best way to achieve this – even more because i already got what i needed, it was just slow as hell :/.
  4. wow wow wow. you're great! unfortunately i just remembered that those fields get populated via api on the frontend, so this current job hook won't work? i'm actually thinking of buying the profields out of my own pocket, otherwise it seems to much of a trouble. do you think profields: table will perform good with about 200 person, each with 1-5 jobs, cities and countries?
  5. since it is a project i'm doing for university there is no money involved to buy profields. if you find the time to help me with the hook that would be great, otherwise i'll try the other option and create a current jobs/city field. while you're at lunch i try to figure out how to filter the persons for my language field enjoy your meal!
  6. i've already installed the autocomplete module! suddenly it's much more fun to populate the fields ;). hmm, there might be a view persons who have more than one current job, but i'll figure something out. the lang field is a field i created myself. the persons pages are created on the frontend via the api, so i get the current user language and store it in the `lang` field. persons which were created on the english page should only be displayed on the english collection, the german persons only on the german collection and the spanish persons on the spanish.
  7. wohoo! thank you so much! you saved my day if you have 5 more minutes you maybe can help me with two additional things: 1. i somehow need to filter the persons: <?php foreach($j->persons as $p): ?> // what you wrote <?php foreach($j->persons->find(lang=$langname) as $p): ?> // what i was thinking, but isn't working 2. how can i add a checkbox to the professions to mark the "current" job?
  8. wow that was kinda easy – at least the setup for the fields and so much easier than repeaters. i'm kinda struggling to understand what you are doing in the template with php. $jobs is supposed to be … ?
  9. thanks! i'll give it a try. FIELDS: professions Page field, Page field = Page Reference? the residencies work similiar, but have two additionals fields: city, country (both text) and current (checkbox) – can i use the same method you explained above?
  10. hey there, i have a collection (parent page) of persons (child pages of 'collection'). each person has several fields. two of them are repeater fields where the person can enter their 'jobs' and 'recidencies'. i'm trying to build a list of entries which looks like: Actor Peter Maria Paul … Doctor Eva Julia William … for the first 5 persons everything worked smoothly. but now that i've reached about 20 entries the server slows down and i'm wondering if my loop is somehow cluttred up. <?php $langname = $user->language->title; //get current user language?> <?php $persons = $pages->get('/collection')->children->filter("lang=$langname") // get all children for current user language ?> <section class="profession"> <h1>professions</h1> <?php foreach ($persons as $child): ?> <?php foreach ($child->professions as $profession): // the repeaterfield is called: professions, the field itself is profession?> <?php $profAll[] = $profession->profession // store all entries; $profUnique = array_unique($profAll) // only unique entries ; sort($profUnique) // sort the entries; ?> <?php endforeach; ?> <?php endforeach; ?> <ul style="column-count: 2;"> <?php foreach ($profUnique as $profLetter): // loop through all professions ?> <li style="font-size: 2rem; list-style-type: none;" class="letter"><?= $profLetter // output one profession e.g. Actor?></li> <?php foreach ($persons->find("professions.profession=$profLetter")->sort('givenname') as $person): // find all persons who have the profession Actor ?> <li><a class="ajax" href="<?= $person->url ?>"><?= $person->givenname // output the name of person who fits the profession ?></a></li> <?php endforeach; ?> <?php endforeach; ?> </ul> </section> is there a way to make this request faster? (i'll have at least two of them on the same page)
  11. but! when i try to save a value. leave the page, come back, my entry is gone. so, even if it's a string and not a message, it still not saves my input. i figured out another way to translate my date fields.
  12. hey there, i'm trying to change the C of my LanguageSupport.module, but i get this strange extra field right beneath it. the strange thing is: i never changed any permissions for any user. am i doing something wrong? thanks!
  13. hey there, i'm quite new to processwire but i'm having a great experience using it! right now i hit a point where i can't help myself out with google/searchfunction. to sketch the basic functions of my page: visitors can enter their e-mail in a form. when doing this pw creates a new page, using the e-mail's md5 hash as a name. the url of the page is sent to the user. the user now can edit the newly created page and can fill out fields like: name and year of birth (thanks to the docs those two already work like a charm!) but there are other fields like "residencies", which are repeaterfields containing three fields: city (text), country (text), current (checkbox). at my current version i can populate a new repeater field easily by using this code: $location = $page->locations->getNew(); $location->location = Munich; $location->country = Germany; $location->current = 1; $location->save(); $page->locations->add($location); now i want to populate the new reapter fields from input fields (using the simple form api). which leads me to my questions: 1. can i somehow group/merge input fields to one "repeater input fields" right now i have: // create a text input -> locations $field = $modules->get("InputfieldText"); $field->label = __('City'); $field->attr('id+name','location'); $field->required = 1; $form->append($field); // append the field to the form // create a text input -> country $field = $modules->get("InputfieldText"); $field->label = __('Country'); $field->attr('id+name','country'); $field->required = 1; $form->append($field); // append the field to the form // create a checkbox -> locations $field = $this->modules->get('InputfieldCheckbox'); $field->attr('name', 'location_current'); $field->attr('autocheck', 1); $field->attr('uncheckedValue', 0); $field->attr('checkedValue', 1); $field->attr('value', $this->fname); $form->append($field); // append the field to the form 2. my desired layout for the form looks like this: by hitting the + button a new line shows. i'm wondering what's the best practice here. can is somehow use the above mentioned code itself as a repeater, or do i have to create several (uniqe) input fields in advance and hide them afterwards (javascript)? any help is appreciated! thanks!
  14. found the error. was a stupid mistake i made. the local server didn't differentiate between the templates name »Person« and »person« but the live server did :/. thanks for you help!
  15. i turned on the debug mode and i don't get any errors – besides the 404 error when it try to access the child page via the browser. the permessions of the template files are: 664 edit: could the problem be caused be using a subdomain?
  16. debug mode is turned off but the browser just can't find the pages: 404 error.
  17. hey there, i stumbled about a pretty odd problem (at least i think it's odd). i was building a site on my local machine, everything worked just fine. after migrating the page to an actual server most of the parts still worked. only all of my childpages where gone. they are still available and editable in the backend but i can't access them in the browser. even the »view«-button is missing. i already had a similar issue while working local: the site is a multi-language site and is use a form to create the childpages via the api. but i could fix it by adding a dedicated status to the newly created pages: $p->addStatus(Page::statusHidden); for the migration i uploaded my local processwire folder via ftp. edited the site/config.php (httpHosts) exported the local sql imported the sql backup to the new server this strange behaviour also applies for newly created pages on the live server. did i somehow mess up the migration – is it a bug – how do i fix it? thanks in advance for any tip!
  18. well! that was easy. thanks alot. i didn't know that users are page references.
  19. hey there, i'm using processwire for the first time, so maybe it's a dumb question. but i'm trying to have an options field which values are the users of the processwire. i don't need the values to be displayed, it's just for the administration of the page. but each time a new user is created / a user is deleted the options field should be updated automatically. is something like that possible?
  20. hey guys, i'm currently working on my first processwire page and really enjoy the way it works. the basic set up is done and everything works. now i want to add some more features: i have a spreadsheet which i want to import as pages. besides two fields (name and date) all of the fields should be additional classes for the posts/pages in my loop. so the spreadsheet looks like this: and my loop looks like this: <div class="grid"> <?php $items = $pages->find("template=einzelansicht, sort=title"); foreach($items as $item) { $firstimage = $item->einzelbild->first()->size(200,200)->url; if () echo " <a href='{$item->url}'> <div class='item'> <div class='overlay'></div> <img src='{$firstimage}' /> <h2 class='headline'>{$item->title}</h2> </div> </a> "; } ?> </div> so basically i need this (line 8 in code above): <div class="item REAL INTERACTIVE COGNITIVE"> any help is appreciated! thanks a lot philipp
×
×
  • Create New...