Jump to content

DL7

Members
  • Content Count

    28
  • Joined

  • Last visited

Community Reputation

11 Good

About DL7

  • Rank
    Jr. Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. @BitPoet One additional error I see: when using embed methode c, the JS is not triggered, this posting the form when clicking on add row. I'm checking it currently but havent found the problem yet. Added this the init $this->addHookAfter('Page::render', $this, 'addScripts'); This as a function public function addScripts($event) { $page = $event->object; if($page->template == 'admin') return; $additionalHeadScripts = '<script type="text/javascript" src="'.wire('config')->urls->siteModules.'FormBuilderMultiplier/FormBuilderMultiplier.js"></script>'; $event->return = str_replace("</head>", $additionalHeadScripts.'</head>', $event->return); } And commented/removed the current JS append to get this fixed.
  2. Hi @BitPoet, Thanks! Some additonal pointer: on an older version (3.0.36) I dont see this fatal error, but the increment still isnt working. The below mentioned isnt working for me either on this older version. See the form initially starts with their "normal" ID/Name as been set in the settings This works only if I add if($child->name) $child->name .= "_1"; If I do this, then the increment is working perfectly. Problem I face then is that none of the entries fields are filled with values 🙂 I'm also looking into that. Fixed that by adding this same line to the populate hook: if($child->name) $child->name .= "_1";
  3. Hi @BitPoet, I have tried your module and ran into a few error: 1. The "multiplied" rows are not getting the _NUM suffic for name and ID. Only on the label its adding #2 2. And Fatal error is thrown when checking the entries. This is within the ToPopulate function. If I Escape this row the error is gone. (I'm on the latest dev PW version) //$hid->label = _("Number of rows"); 3. When I can view the data in entries -> the multiplier doestn have a value and the orginal has the filled in value of the original. Probably caused by 1.
  4. Hi @adrian, Thanks! That did the trick. Cheers
  5. Hi @Ferdi Derksen, Thanks. Tried it, and its still not working. I also checked the code and concluded that the somehow the addHookAfter is not triggered, when using the $page->save via the API. I work when using the backend save. Not sure if this is expected behaviour?
  6. Hi @Ferdi Derksen, I installed your module on our test location and it works like a charm. Just one additional question. Would it be possible to execute the same code when a page is created and saved via the (API) $page->save. I added $p->publish_to_twitter = 1; before the $page->save and removed the wire()->input->post->id, but when I open the page just created, the check box is checked, but the page is not (yet) tweeted. Only if I click on save manually again its tweeted. Any idea what I need to amend in the code to get this working? Cheers
  7. Questions on this module. I seem to have issues with dynamic parameters in the url. /test/test?utm=test is catching a 404 and not redirect although this is set-up in the redirect module like: /test/test -> /newtest/newtest
  8. And you are right. In that case I would definitely go for a different approach. The one you mention from ryan is indeed also doing the trick. One thing to mention though on this is that this code isnt taking into account a certain status of the page the Option values it's been used at. I have certain pages that are for instance unpublished, hidden or even have custom status, that i've created myself, those would also be taking into account whereas for the other code I can make that exception on the selector.
  9. Again thanks for your help @Zeka. I wasn't aware of the each() function, so that help alot! Just to be clear on the above reactions, with the country list example I just wanted to point out an example of a large dataset. I wasnt looking for a country list itself. But if I need it in the future, I'll have some great pointers on how to upload them ;-) Next to that if you are really stubborn person (like I am ;-) and still want to utilize the fieldtype options for this, use this code: $options = $fieldtypes->get('FieldtypeOptions')->getOptions('xyz'); $options->each(function($item) { $count = wire('pages')->count('template=basic, xyx='.$item.''); if($count) { echo "<li>{$item->title} ({$count})</li>"; } });
  10. Thanks for your help all, I'll give it a try.
  11. Hi @adrian , Thanks for this. Very helpful. But i`m still struggeling with the fact on how to get a list of the relevant items. As per my example above, how would I check first of all the distinct values used? In either approach (options field or page) I still need to "loop" through the $page->category correct? How from an API call can I make sure only distinct values are shown in the loop? Next to that the trick would also be to add a additional count. I would know how to do this from a SQL perspective, I`m just not sure on how to do this using an API call. Note: a single page will only have 1 value as a set optionvalue (so no multiple values possible on a single page) Thanks again!
  12. Hi @Zeka, Thanks for your swift reply. As I understand ir correctly I would need to create then a page for each individual value. That would work for instance for 10 values, but lets assume the options are countries, is would be a lot of work to add every single country as page. Explaining it a bit more: What I`m trying to recreate is sort of a very small version of a so called facatted search functionality like on the sidebar on this page: https://www.laptopshop.nl/category/45702/laptops.html
  13. Hi, I have multiple Options fields on a certain page. On an overview page I like to add a filter, which display`s all the distinct value`s of the optionfield, but only the once that are in use. As an addition I would like to have the amount of times this specific value is in use. So: Given the following: 1=ABC 2=DEF 3=FOO 4=BAR I have for examples 5 pages were Page 1 uses 1 Page 2 uses 1 Page 3 uses 2 Page 4 uses 4 Page 5 uses 4 So on the overviewpage I like to have an overview with (note the 3=FOO is not displayed): Options: ABC (1) DEF (1) BAR (2) I know in the API there is a possibility to use $all_options = $field->type->getOptions($field); But I would need the $all_inuse_options ;-) Next to that It would be a nice to have to add the count.
  14. Hi All, Hi @teppo, So I got started with some basic testing and ran into some hurdles. Using the FrontEndUser module I managed to get a new user created. But somehow I dont see a way to connect this specific user with a specific profile page (company page) . What I therefor drafted is the following: Create two templates: - Company (Profile information, company infomation, e-mail adres, password (hashed) ) - - Jobapplication (all information for application) With this structure and the API i`m able to login the user and get the profile information into a session. With that I`m able to grab the company information and make a front-end edit page. Furthermore, I can connect the jobapplication to his parent and therefor: -echo all application (being sole children) on the company page - easily post the parent ID with the jobapplication once a new one is created. Some questions with this set-up : Would this work or am I using a workaround and would it be better to do this differently? While using for instance the FormBuilder Module, am I able to -within 1 formpost- create the companypage and then the applicationpage? This would be helpful for the register form where company`s that havent posted anything yet, can create a profile + post a job. Thanks After some more reading and testing, I think I got it. Process changes a bit, but I now understand the flow. What I`ll do is make a login/register page. Then when user logs in (after registration) I can grab the user->ID. He can then update his company data via a front-end form. I`ll attach the used-ID as a field for that (company)page. When that page is created, I can then let the user add a application and I`ll append that to the company page as a child. Think that will work. I think I would even be able to do this in one form-flow.
  15. Hi all, thanks for all the comments. It seems like there is no standard answer to my question ;-) Happy to started this discussion. For what I brainstormed with the current level of Processwire knowledge, I think I will be very feasable to get all the items in here. Having a look at the Skyscraper example (were jobpenings are the skyscrapers) I just need to add one additional layer (being the applicants). The challenge would be to build a dashboard with (front-end) access control were only the company posted the opening is able to post/edit/see the jobopenings and the applicants. My guess is that this would be very feasible using the current RBAC model in Processwire as the login is quite standard. In essence there would only be two roles defined: #1 me as being the admin and 2# as companies that want to post a jobopening. 2# would only be front-end access to the dashboard. When I find the time, I'll set-up a basic version of this website to test if this will work. I`ll keep you updated on the progress. Thanks!
×
×
  • Create New...