Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/22/2013 in all areas

  1. Hey all, just wanted to share with you the new Milktop website http://www.milktop.co.uk/ (powered by PW of course). This comes to life as the result of merging Milktop with ED DESIGN ( the design company of Diogo, who you all know and love and his partner Erika, a fantastic graphic designer). It's been great to work with this new team, and we hope that you guys will like the website as much as we have enjoyed creating it A few notes on how we accomplished some things: For the grid we used Bourbon Neat. We wanted to try out this framework since it doesn't make impact at all on the markup. We're pretty happy with the result, but in the end we feel like we didn't save that much time by using it than if we would have used simple SASS variables or created our own mixins. For the icons we used Fontello. This is great because it allows you to create a new font with your own set of icons from several sources, and even add some custom built icons by importing a SVG drawing. One advantage is that the final font only has the icons that you put there, which makes it a very small download. We decided to use large images to display our work in the best way possible, but we're serving smaller images for smaller screens. We do this by serving the smaller size by default and swapping the image for a larger version by measuring the container element : <img data-large="<?php echo $img->url; ?>" src="<?php echo $img->width(400)->url; ?>"> For speed we are using the excellent ProCache module by Ryan For publishing automatically to Twitter and Facebook we plan to (not done yet) publish a RSS feed with Ryan's RSS module and use IFFFT to pull it into both social networks. If you don't know IFFFT, you should definitely check it out. A final detail, our logo is designed in HTML and CSS Hope you guys like it and thanks again to the great ProcessWire community without whom this collaboration would never have happened. Have a great evening.
    7 points
  2. I'll start with saying that I'm not a 'coder' by far and sometimes I have the impression that most people here are and suppose that everybody is one. Being a 'performance artist' you could say I'm the opposite I need nothing else but my body to do my work. www.performan.org Nevertheless I've used the internet as a means to make my work public, since 1994 when Netscape 1.1 was released with the major introduction of frames. The Jockel Project Since 1985 I've kept a database of events that I find interesting, in notebooks, in a Commodore 64 environment, in a FoxPro database, in a Filemaker database, as a blog When I Was Buying You a Drink Where Were You? and now finally (and hopefully working from 1 Jan 2014) in a searchable website thanks to ProcessWire. Apart from that I worked as a cook, a carpenter, a welder, a painter, a teacher, a bus driver, manager of a tattooed pig farm in China and currently at an architecture school operating CNC machines and lasercutters but also unloading wood, card- and fiberboard or simply bricks from delivery trucks. And more actually I'm painstakingly recovering from a complex leg fracture since the unfortunate meeting of my left leg and a yellow car while driving my bicycle in Antwerp last summer. So yes, PHP and XML are hard work for me, but I'm willing to learn. And I'm happy to have discovered ProcessWire and appreciate the help I've had so far from anybody responding to posts and questions. Some things just aren't obvious, and even when searching the forums you don't always find what you want. Or sometimes something doesn't even looks like a solution until someone tells you to look at it in a different way - which you did, thank you. Oh, and if you're looking for some electronics to listen to while you're coding, our complete catalogue of electronic music since 1980 (vintage analog synthesizers, tapeloops and voices only!) is available for free at the Internet Archive.
    4 points
  3. You guys hooked up? Like a ProcessWire marriage? I must have missed that one. Good luck on the new business! Great work on the website. Looks really, really good.
    4 points
  4. 2 points
  5. Looks just as good on desktop as on mobile, which I commented on earlier. And good luck to all on this new venture - here's to a successful new year!
    2 points
  6. Hi Tino, I don't have an answer to your question...I am just saying hi and welcome to processwire and the forums . Hopefully someone will answer your question ;-) Cheers, /k
    1 point
  7. I'm not saying it's the ideal solution. The ideal would be Pete reading this and changing it on the module. We can also make a pull request to him, of course.
    1 point
  8. Really nice and clean! I'm really envy about your studio's location, too cool
    1 point
  9. Good business look with a background both contributing to the business look and easy for the eye. We'll that is a surprise two smart webforces here joined, congrats on both your futures.
    1 point
  10. For those of you interested in strategic marketing I recommend this link http://www.quietroom.co.uk/santa_brandbook/one
    1 point
  11. One more observation: The green label "This site is in maintenance" destroys my page setup and makes design testings tricky. If there was a css class with it, I could overwite the included hard coded styles more easily.
    1 point
  12. You're not that vague I guess. Have a look at Soma's brand <blink>NEW</blink> blog !
    1 point
  13. Followed your link Adminer Editor. Found there Adminer and tried it out on a hosting server. Adminer is really a nice alternative to phpmyadmin. It is even a single php file. Good found !
    1 point
  14. Sorry guys, I didn't see it was posted in the jobs channel, not good, must go to bed earlier. Not easy because I got the taste of php lately. Will look better next time.
    1 point
  15. @3fingers: sorry, I had managed to miss your question. This is exactly why I added JSON view to the latest changelog version, i.e. you could use PHP or JavaScript to request same data as JSON and parse that to whatever you need. If the module is installed to default location, you can get this data from /processwire/setup/changelog/json/. Various search parameters (GET params) also work there. Ask if you need more detailed description, I'm in a bit of a hurry right now
    1 point
  16. Also, make your "text", "date", "city" and "podcast" fields autojoin in your advanced field settings like WillyC mentioned. That should cut out a few hundred more queries as well. To avoid the nested loop, just keep track of when you need to output your headline. You want your data grouped by tour, so you'd sort by something from the parent, followed by the concert date. Perhaps "sort=parent_id, sort=date" in the concert finding query. Then keep a $lastParentID variable that you set at the end of your loop ($lastParentID = $concert->parent_id. At the beginning of your loop, check if $lastParentID != $concert->parent_id and display a headline when the condition matches.
    1 point
  17. Hi guys, my latest PW project. Client: ProximaXP One page design this time, so there is not much on PW power here, but I used a lot pages and fields for customizing all aspect and functions of the website. http://proximaxp.com
    1 point
  18. There must be a lot of photos in there for the counting of that field to be a bottleneck? Something that may be even faster is to load the concerts that have photos in one query and label them as such, then load the concerts that have no photos in another: $concerts = $pages->find("..., fotos.count>0"); foreach($conerts as $concert) $concert->has_photos = true; $concerts->add($pages->find("..., fotos.count=0"))->sort("title"); Using that method, output code would just check $concert->has_photos; rather than count($concert->fotos); But you will have reduced 250+ additional queries down to 2.
    1 point
  19. You should definitely read the docs... $item->FolgePic->url
    1 point
  20. <img src="logo-<?php echo $user->language->name; ?>.png" alt="" /> This will give you the name of the language. So you either make sure you change the language name or the filename of the images to make sure they match.
    1 point
  21. Basic but great The apigen docs were automatically created by scanning the code for classes and useful comments. They're not more than a nice alternative to reading the code itself.
    1 point
  22. foreach($pages->get("/video-container/")->children as $p) { echo $p->folgeTitel . "<br>"; echo $p->folgeYT . "<br>"; } edit: Well, now you have two answers... find the differences
    1 point
  23. To get content from a field of one children page that you know the name, do this; echo $page->get("parent=$page, name=name-of-page")->field; To get more fields do this: $myPage = $page->get("parent=$page, name=name-of-page")->field; echo $myPage->field1; echo $myPage->field2; To get the fields from all children do as Martijn pointed out. Basicly, you will be looping through all the children, and extract the fields from each one of them. An important thing to know is that get() get's one page and you can immediately retrieve the fields, while find() gets a group of pages and you only have access to their properties when you iterate them (with foreach() for instance.)
    1 point
  24. I think you should probably take a look at the concept behind ProcessWire first, then some of the other docs and the cheatsheet as Macrura suggest - start with the Concept page from here: http://processwire.com/api/ The Cheatsheet then gives you a look at most the possible functionality at your disposal in page templates to access your data and files. As for explaining the line of code you quoted: $skyscrapers = $page->skyscrapers->find("limit=3, sort=random"); From memory, "skyscrapers" is actually a "featured skyscrapers" field, so is just a Page field that links to other pages (probably the most useful fieldtype there is. Here is the exact translation: "For the current page (homepage in this instance), find 3 random pages from the skyscrapers field". The $skyscrapers = bit is just storing the results in a PageArray (it's in the docs linked further up my post here) that can then easily be iterated through to print whatever output you desire. If you're wondering why the demo doesn't seem to pick three random pages, I think page caching must have been accidentally left on here so it's always showing the same 3 in the demo, but that's easy to switch off The syntax is based on jQuery and aims to be human-readable. If you imagine that there are a few database tables and queries behind that code, you can easily see how quick that is to write and all without a line of SQL. You can make all sorts of queries like: $architectsCalledPaul = $pages->find("template=architect, title*=Paul"); // finds all architects (pages with the template "architect" with the name Paul somewhere in the title field // and so on... The idea behind ProcessWire is that once you've learned the basics you can build pretty complicated data structures in the admin quicker than you'd be able to writing database tables from scratch and you have a hugely powerful set of functions at your fingertips to do with that data as you please. Most folks here would agree that it has shaved hours/days/weeks/months off their site build times depending on website scale, but any time saved is good!
    1 point
  25. MODX with getResource is slow & inflexible compared to ProcessWire, take a look at this traversing heaven. Something like this might work: foreach($pages->get('/CONTAINER/')->children as $p) { foreach($p->fields as $f) { echo $p->$f . "<br>"; } }
    1 point
  26. @gebeer: Have you tried if "Unpublished" (capital "U") works? Just a guess, but it could be that Edit: my guess was wrong; lowercase would work just fine. The issue is that the code Martijn posted above is from dev branch. If you're running stable (master) branch of ProcessWire, that won't work for you.
    1 point
  27. Or check with a string: `hidden, locked, unpublished, system, systemID` $page->is('unpublished'); (Teppo was quicker !)
    1 point
  28. Try $page->is() with status code flags. Example: if ($page->is(Page::statusUnpublished)) if (!$page->is(Page::statusUnpublished))
    1 point
  29. .. and of course there's always GitHub. If you're really wondering "what is function x, where does it come from and what does it do", try searching
    1 point
  30. Everyone learns different. I tend to think I'm like you Martijn. First read as much as you can then explore the code. Some others dive straight into the deep. @Chris: you can use Google to search the forum. I.e. the query "site:processwire.com wire function" would have given you loads of information.
    1 point
  31. It's because of scope. This answer has been given atleast 10 times on this forum. In ProcessWire we have variables like: $page, $pages, $sanitizer, $config, $user, $input, $templates etc. Those can't be accessed directly in function or class scope. They can be accessed via wire('page'), wire('config') etc. etc. and you can access them inside a class witch $this->pages. ( depending on the scope of the methode inside the class ). The wire('') function can be from accessed everywhere. More information is given on the api docs an throughout the forum here. Don't understand me wrong but I think you should read http://processwire.com/api/ before or while exploring demo's etc. The next question could be, where can I find the methode whitelist. etc. etc. I've read the api docs many times. There's next to loads of information, a way of thinking. It's all written very well & it will make you understand the whole philosophy of ProcessWire and it's enjoyable. At first it's a puzzle, but when the first pieces are in place, the rest will follow.
    1 point
  32. @dragan: take a look at ProcessChangelogHooks.module and especially it's logPageEvent method. It does a bit more than this, but you could probably use parts of it pretty much directly.
    1 point
  33. Thats why I always walk with 3 shoes, incase I loose one while walking.
    1 point
  34. also, i wonder if you could set these up not hierarchically - just have concerts, tours, and diary. then when you create a concert you just select which tour it is (page select); so this way if there is a concert that is not part of a tour it doesn't get stuck down in that page tree; depending on the diary entry format, you could have a selector on that for the tour and the concert... the more i work with pw, the more careful i get about pigeonholing certain content heirarchies, since i've run into some issues when the client changed their mind about the relationships of their content; so now i use a lot of page field references to connect things together and less relying on the page tree...
    1 point
  35. This might sound a bit crazy, but I wonder if doing this is more efficient; if($pages->get("parent=$tour, name=$concert->name, fotos.count>0")->id)
    1 point
  36. Actually, you can do this on the dev branch. Lets assume that cities are children of countries and that is reflected in your page structure (i.e. /countries/france/paris/). Create your 2 page fields (country and city), and configure 'country' as a single page field with "parent" set to "/countries/". Next, for the "city" field configuration, use the "Custom selector to find selectable pages", present on the "input" tab. In that field, enter "parent=page.country". Save and try it out. This works with select, selectMultiple and asmSelect fields (and possibly others), though not yet with checkboxes, radios or PageListSelect.
    1 point
  37. ProcessWire's API doesn't use SQL queries -- it uses selectors. SQL injection is a non-issue in ProcessWire. ProcessWire does not get involved with database abstraction layers, so if you are executing SQL queries then you are using PHP and MySQL (mysqli). You can always add your own database abstraction layers to do whatever you want. But typical usage of ProcessWire for developing a site does not involve SQL. If you are using SQL for something and you want to stick with the DB driver PW is using (PHP's mysqli) then you eliminate SQL injection by either using prepared statements or escaping your strings before putting them in a query. Use it the way you are supposed to and SQL injection is a non issue. Is it possible your company was asking about the security of the software itself? ProcessWire's own queries are well protected against SQL injection, of course. SQL injection is a problem of bad code. If one uses the database driver in the way it is supposed to be used, then you are never subject to SQL injection. Btw, I don't know about what CakePHP is doing, but the whole idea of trying to protect the user from SQL injection (outside of the DB driver) sounds like a security problem in and of itself. We've seen this with PHP's magic quotes, which was meant to protect the user from SQL injection. Anything that tries to protect you from yourself ultimately encourages bad programming practices by making security a grey area. That fosters an environment where many think they don't have to sanitize and validate input, which becomes an even bigger security problem.
    1 point
×
×
  • Create New...