-
Posts
4,632 -
Joined
-
Last visited
-
Days Won
55
Everything posted by apeisa
-
Index template aspecific of 'sub' template? // Hello!
apeisa replied to jtborger's topic in Getting Started
You are right. If PW would have lots of conventions, default support for same frontend framework (and therefore lots of generated markup), it would mean that sites build by different companies would be closer to each other. But philosophy behind PW is way different: pretty much zero assumptions, just super useful tool that you can use how you best see. It means you can use all the experience you have (php coding, front end stuff etc) and build upon those skills and processes that you already know. -
Index template aspecific of 'sub' template? // Hello!
apeisa replied to jtborger's topic in Getting Started
I have built pretty complex sites with PW and I remember feeling ankward of having similar template file per listing page. I thought that I would use alt-template filename all the time, but haven't actually used that much. And I don't see myself using it much in future neither... After revisiting sites after year or so, I love the fact that when I want to extend something, I always know the "starting point" (consistently named template file). And important to notice: having separate template file for each of your "index templates" doesn't mean you have to do any code duplication. Includes, modules, functions... what ever suits your workflow best Oh and welcome! You will definitely enjoy PW! -
pwired: if docs would have all those examples, one by one - it would be just the same that you bought a box of legos and got 3 000 000 pages long manual that would show all the possible combinations that could be done. When you learn the basics: $page, $pages, Page/Wire Arrays, selectors etc and learn how to use cheatsheet (and soon source code), you really can find combinations like that. But, to answer your question: DIOGO: $pages is explained here: http://processwire.com/api/variables/pages/ ->find() (and selectors in more common, ie. what to put inside find) is explained here: http://processwire.com/api/selectors/ (also first item here: http://processwire.com/api/variables/pages/) ->has() is explained here: http://processwire.com/api/arrays/page/ TEPPO: $page is explained here: http://processwire.com/api/variables/page/ ->is() is explained here: http://processwire.com/api/variables/page/ (and again, concept of selectors) SOMA: Operator (^=) that Soma uses in his selector is explained here http://processwire.com/api/selectors/
-
Sorry guys, I am having busy week and not able to take look. If someone's figures way to support freeform (full or half) cropping, without braking backwards compatibility, I am happy to merge.
-
Broke the installer? (Installing onto local testing server)
apeisa replied to Godfrey's topic in Getting Started
3306 is db port, 80 is for apache. -
Here we go: https://github.com/apeisa/CommentRatings
-
Handling the ecommerce part for drama ticket booking site
apeisa replied to Vineet Sawant's topic in Getting Started
There are lot's of options for you, but I think all of them requires a custom coding (if you want to automate the process at all). It is pretty hard to help you at this point (no clear questions), but definitely when you have progressed a little you get lots of help from here. So I suggest as a first action try to draw more clear picture for us how you want the process to work. -
Handling the ecommerce part for drama ticket booking site
apeisa replied to Vineet Sawant's topic in Getting Started
I am pretty sure that when selling just seat numbers you can easily bend Foxycart for that. It could be downloadable PDF also? http://www.foxycart.com/features/feature/products/downloadable-products -
Module devs: what would be best way to avoid that kind of problem? Lowercasing on code level?
-
Check table naming, is it with CamelCase on database too?
-
Thanks for the kind words ezeey! Nothing works with multisite I hope to find some time this weekend to take a look. If you can provide any more information it would definitely help (how to reproduce, test site I can login etc).
-
I find it amusing that twitter requires auth, when pulling public tweets... Boring. </rant>
-
You can also set fields as system fields that cannot be removed at all (only by modules uninstall). Not saying that is a good idea.
-
2.5? That is future!
-
This is all more PHP than ProcessWire. All that ProcessWire does is that template files have some predefined variables for nicer api. $page and $pages are among those. Includes are different beast from functions (and from modules). If you include a file, it has all the same variables than the file that included it. So if you include a file from your template file, the included file will have $page and $pages available. Functions have scope. So when you have this code in your template: <?php renderTitle(); function renderTitle() { echo "<h1>$page->title</h1>"; } It will not work, since renderTitle() function doesn't know what $page is. Here is working version of the same template file: <?php renderTitle(); function renderTitle() { $page = wire('page'); echo "<h1>$page->title</h1>"; } or always possible to pass variables: <?php renderTitle($page); function renderTitle($page) { echo "<h1>$page->title</h1>"; }
-
They are the same. Difference is that wire('page') works everywhere, but $page works only on template context (which is of course the most common). So if you are using functions or building modules, you need to use wire('page').
-
Yes, that's it. If I change fredi form to use /page/edit/ directly, the image field inside repeater works. But normal saving fails, and I think because the forms are different, so the processing doesn't go right. I tried to get them to same structure by getting page edit form and then removing the fields that aren't needed. But cannot get the removing going. I have changed the renderFieldsForm to this: public function renderFieldsForm() { $this->fieldsArray = explode("|", $this->fields); foreach($this->fieldsArray as $fieldName) { // Check if page has the field that wants to be edited if ( ! $this->pageContext->fields->has($fieldName)) throw new WireException("There is no field $fieldName on editable page"); // Check if the current user has rights to edit that field if ( ! $this->pageContext->editable($fieldName)) throw new WireException("You don't have rights to edit field $fieldName"); } $form = $this->modules->get('InputfieldForm'); $form = $this->pageEdit->buildForm($form); $form->attr("action", "/processwire/page/edit/?id=$this->pageId&modal=1"); //TODO: url is hardcoded now.. // Build the form (loop fields and add their respected inputfields) foreach($form->fields as &$field) { if ( ! in_array($field->name, $this->fieldsArray)) { $form->remove($field); // Script goes here, but it doesn't remove the field } } return $form->render(); } I don't understand why, but $form->remove($field) isn't working.
-
Yes, moved to dev talk.
-
I have used ProcessWire 2½ years and only real issues with upgrades where at 2.0 => 2.1, when whole user management got huge overhaul. And by "real issues" I mean that upgrading required something else than just updating the core files. I has been smooth ride and I am super excited about the great development phase. But maybe 2.3.1 dev should be called 2.4 when released as stable, if it might not work with some modules?
-
Very beautiful design, congratulations Marty!
-
Yes, from entries view.
- 1 reply
-
- 1
-
-
Yep, only "users and access" is checked here.
-
It's hard to say. If you can provide me a way to code, I am happy to take a look.
-
It's not too simple task. I would probably build it independent from any ready made gallery/lightbox script, since making them work in that scenario nicely might be a bit too challenging. Maybe if they have some hook that allows you to do something custom on last click (pull new images with ajax in this case / or redirect to next page and open first image in this case) might do it. Also from UI side, I don't think many users except it to change pagination in that scenario. Or maybe using different kind of gallery there: http://galleria.io/ ?
-
You understand their language? My cat understand code? Joking aside, we actually have four cats and I have no clue which one is performing there... I debugged this little more. The responses are actually totally wrong: it responses with page save instead of field save. This is what I get when saving in normal admin: [ { "error": false, "message": "Added file: desert.jpg", "file": "/frontendedit/site/assets/files/1037/desert.jpg", "size": 845941, "markup": "\n\t<li class='InputfieldFile InputfieldImage ui-widget'>\n\t\t<p class='InputfieldFileInfo ui-widget ui-widget-header'>\n\t\t\t<span class='ui-icon ui-icon-arrowthick-2-n-s'></span>\n\t\t\t<span class='InputfieldFileName'>desert.jpg</span> \n\t\t\t<span class='InputfieldFileStats'>• 826 kB • 1024x768</span> \n\t\t\t<label class='InputfieldFileDelete'><input type='checkbox' name='delete_images_2057dd75f2e9f7b52e3dda4ccd0ea4a2' value='1' /><span class='ui-icon ui-icon-trash'>Delete</span></label>\n\t\t\t<a class='InputfieldFileMove InputfieldFileMoveBottom' href='#'><span class='ui-icon ui-icon-arrowthickstop-1-s'></span></a> \n\t\t\t<a class='InputfieldFileMove InputfieldFileMoveTop' href='#'><span class='ui-icon ui-icon-arrowthickstop-1-n'></span></a> \n\t\t</p>\n\t\t<p class='InputfieldFileData ui-widget ui-widget-content'>\n\t\t\t<a class='InputfieldFileLink' target='_blank' href='/frontendedit/site/assets/files/1037/desert.jpg'><img src='/frontendedit/site/assets/files/1037/desert.0x100.jpg' alt='desert.jpg' /></a>\n\t\t\t<label class='InputfieldFileTags'><span class='detail'>Tags</span><input type='text' name='tags_images_2057dd75f2e9f7b52e3dda4ccd0ea4a2' id='tags_images_2057dd75f2e9f7b52e3dda4ccd0ea4a2' value='' /></label><label class='InputfieldFileDescription'><span class='detail'>Description</span><input type='text' name='description_images_2057dd75f2e9f7b52e3dda4ccd0ea4a2' id='description_images_2057dd75f2e9f7b52e3dda4ccd0ea4a2' value='' /></label>\n\t\t\t<input class='InputfieldFileSort' type='text' name='sort_images_2057dd75f2e9f7b52e3dda4ccd0ea4a2' value='1' />\n\t\t</p>\n\t</li>", "replace": false } ] And this is what I get from ProcessFredi: { "error": false, "message": "Saved page '1035' multiple fields" } So it seems that my code is too eager or something. This is where I believe the problems are: https://github.com/apeisa/Fredi/blob/master/FrediProcess.module#L54