Wanze
PW-Moderators-
Posts
1,116 -
Joined
-
Last visited
-
Days Won
10
Everything posted by Wanze
-
Caching include files called by template files
Wanze replied to Peter Falkenberg Brown's topic in Getting Started
Hi peter. Like teppo said: Doesn't matter what you do in your templates, the output that is returned by $page->render() is cached if you enable caching for the templates. Just wanted to say that there's nothing beeing cached if you're logged in. Make sure you use another browser or log out to test if the caching works. -
Web dev: Coda2 Java: Eclipse Others: Sublime
-
Do you want to do this? //.. build your normal selector... if ($input->get->limit) { $limit = (int) $input->get->limit; $selector .= ", limit=$limit"; } How to use limit in your selectors: http://processwire.com/api/selectors/
-
Hi galaxy and welcome, Right now you're looping through the fields of your page, which outputs you the repeaters. You need to loop through a repeater to get the fields in it, that's one level deeper. You could write the html markup for the tabs and then just output your data in it: <div id="applicant_details"> <?php foreach ($page->applicant_details as $d) { //applicant_details is the name of your first repeater echo $d->organisation_name . ' ' . $d->sector; //These are your fields inside the repeater } ?> </div> //.. Next tab Are you sure you need that much repeater fields? People new to ProcessWire sometimes make heavy use of repeaters - usually it's better to model your data with pages. Then use Page fields (single or multiple) to create relations.
-
No, have a look at the right bottom corner I think there's a module from Antti for a simple forum in Pw.
-
Congrats ryan, cute family! Wish you all the best for the future!
-
Something like this? $allPages = $pages->find('template=template-X'); $selectedPages = $page->pagesWithTemplateX; foreach ($allPages as $p) { $selected = ($selectedPages->has($p)) ? 'selected' : 'not selected'; echo $p->title . " is {$selected}"; }
-
Have you tried this? print_r($_FILES); //Shouldn't be empty Edit: You can't upload files with ajax in some browsers, thats a browser security restriction. There exists a fallback-solution with a hidden iframe makes it work in every browser. Check out this plugin and FAQ: http://malsup.com/jquery/form/#file-upload
-
You could check if the files are sent to the server, somwhere on top of your script: print_r($_FILES); //Shouldn't be empty Check your php settings for UPLOAD_MAX_FILESIZE, MAX_POST_SIZE edit: Soma wins
-
What do you mean with 'I've been building a back end in ProcessWire'? Any custom modules that could have introduced this error? Try to backup your wire folder (rename it for example to wire.old) and copy the same directory from a fresh Pw version, master or dev. Maybe some files got corruped.
-
Maybe a dumb question but the page isn't hidden and/or unpublished? Though shouldn't be the problem here with $pages->get...
-
Hi horst, The exception says that there is already a page under this parent with the same name. Just save the page without acutally setting the name. ProcessWire does this for you: The system builds the name from the title and if a page with the name already exists, Pw appends -1,-2.....-n $p->name = wire('sanitizer')->name($title); //uncomment or remove this line Why getting the NullPage? Maybe your title is not stored exactly the same way (spaces).
-
Interesting approach But no guarantee that the region with most details (edges) is actually the thing you want to crop.
-
Hi BrendonKoz, For an active project I'm using Pw templates and fields to model/store my data coming from another database. But I don't let users see the Pages tree. For some data, I'm not using the ProcessWire 'ProcessPageEdit' Process to edit the pages. I created my own Process module which displays the data from a page in a form. Then I save everything via API. This way you can quickly use standard form modules from Pw but you're also free to generate your own markup beside that. For example the repeaters could (maybe) be displayed in a table which doesn't eat up that much vertical space. With the 'InputfieldMarkup' module you can display whatever kind of stuff you like - would be a solution to display calculations / metrics for your second project mentioned.
-
No problem - thanks you for finding this one! I've never used html2pdf before, but it looks like it's an addition on top of tcpdf - the framework that this module is using. Don't know the differences exactly. This module just integrates TCPDF into ProcessWire, making it easier for you to setup everything. However, it could be the case that html2pdf has better html support built in for rendering the pdfs than tcpdf. The module handles creating / caching pdf's for you and you can output the content with Pw templates. This means, you have the full Pw API available if needed. If anyone can confirm that other libraries, e.g. html2pdf or mPDF have actually better html support than TCPDF, I'll switch the framework behind the module.
-
Hi onjegolders, I just noticed that I forgot to add an 'echo' in front of the render call in my first post - updated. It should be: echo $modules->get('Pages2Pdf')->render(); Was this the issue? (hope so... )
-
LeiHa, You need to tell us more what you want to achieve. In your modules, you can generate messages / error-messages like WillyC mentioned. Pw will output them automatically in the admin. However, if you speak from your own templates aka frontend, I'm not sure what you want to do
-
Add option to add repeater item from the top
Wanze replied to isellsoap's topic in Wishlist & Roadmap
Hi isellsoap, Currently not possible, but maybe in future. Check this thread out: http://processwire.com/talk/topic/2269-repeater-fields-most-recent-to-top/ If you have 'lot' of repeater items, you may also consider to add the data as pages. This way you can define the sorting. -
Hi owzim Thanks! I see your point but I think this sort of functionality is hard to implement for a general, simple solution. There are lot's of possible fields of different size. Displaying them below each other - it becomes the same as creating a normal page and fill out the fields there. That's not really 'batch-creating' then IMO. Check out niks After save actions module which lets you create a new page after saving. If you have the need to let your users batch-create pages with a defined template, I'd go with a Process module. You could build a form with the required fields and then create the pages with the API.
-
Hi kongondo, There's no reason to use a while loop in the situation where you are just iterating over the pages found. Generally: If you need to loop over a set of data, you're free to choose the type of loop (for, while, do-while). However, it depends on the situation which one you take As for your example, you could do it in a while loop like this: $i = 0; while (count($results)) { $p = $results->get($i); $rows[] = $p; $results->remove($i); $i++; }
-
Select field values not getting edited in front-end form
Wanze replied to onjegolders's topic in General Support
I don't understand exactly what you want to do. If your select fields are actually Pw Page fields, then IMO you need to store page objects and not just integers. As you are sending the ID's back to your template, you could just do this: $editTermsId = (int) $input->post->edit_terms; $page->invoice_terms = $pages->get($editTermsId); Does this work? Edit: Just saw that adrian recommended the same thing. If you allow to store multiple terms, then you need to store a PageArray. But as you let the user select only one value with the <select>, I assumed that 'invoice_terms' is a single page field. Cheers- 24 replies
-
- api
- front-end form
-
(and 1 more)
Tagged with:
-
Ah the config object from Pw is missing. Can you add this line of javascript anywhere before you include the JqueryWireTabs.js var config = {}; /* If it's not working, try adding the following lines too */ config.JqueryWireTabs = {}; config.JqueryWireTabs.rememberTabs = 1;
-
Hi, You can write like this: $session->remove('bestelling');
-
LeiHa, Can you open the javascript console and check for errors? Also make sure the css and js is loaded according to: http://processwire.com/talk/topic/2389-using-jquerywiretabs-in-my-module-how/#entry33541 Cheers
-
How do I remove certain field/data after given date-time?
Wanze replied to Vineet Sawant's topic in Getting Started
One small addition to diogo's solution: You should calculate time() - $page->date, otherwise the first if is always true and the second can't be. if ((time() - $page->date) < (3 * 60 * 60)) { // 3 hours in unix time or take the absolute value of the difference: if (abs($page->date - time()) < (3 * 60 * 60)) {