-
Posts
7,479 -
Joined
-
Last visited
-
Days Won
146
Everything posted by kongondo
-
Not wishing to hijack this thread, I'd love to know more how you accomplish this please? (if you can share, i.e.) How do you model/store data coming in from another database using PW templates and fields? Thanks.
-
@Diogo, We'll put. True...there are times I find myself constrained by a framework and step out of it for minute to do my thing and pick it up a couple of lines down..
-
Hi Jonathan, First, welcome to the forums! Music producer forum sounds like Joss? Sorry, I don't have specific answers but I think one of the main problems you'd run into is .htaccess. From what I understand, Webmatrix does not support that. PHP and MysQL will be fine (I think) from what I've read. If you really want to try PW locally, I'd suggest you use WAMP or XAMPP if you are on a PC, which I guess you are since you use Webmatrix?
- 6 replies
-
- how to
- web martix
-
(and 1 more)
Tagged with:
-
I think the idea with frameworks is to help you stop writing the same code over and over every time you have a new project. Of course you can stop doing that by using your "own framework" or bare-bones if you like. For guys who don't use CSS frameworks, I believe you have some code in your snippets stash that you reuse for various projects? That is your framework. Interestingly....I think CSS is the last frontier where people still want to have total freedom. For PHP we have some well-established classes that have withstood the test of time (e.g. PHP Mailer class) that are used over and over by loads of people. For javascript, it's almost a cliche in some quarters if you say you use jQuery (Duh!) [What happened to mootools btw?]. Of course I am not comparing PHP to CSS , just thinking out loud here. Bottom line, we use what floats our boats....until Internet Explorer comes along and sinks us all! ...until we conquer it (or forget it )
-
About websites looking the same: As you rightly say, lately, you've been seeing awesome designs. Technically speaking, actually, all websites look the same if you remove the CSS, to expose the bare HTML, hehe! It's all a bunch of blocks - (mainly DIVs; or Tables! Help! Does anybody still use Tables for layout?!) - arranged on a canvas. I moved to Foundation from Blueprint which seemed to have expired? I am still on Foundation 3; I don't understand the new classes in 4 and don't have time to learn, ATM
-
PWired, This article at A List Apart is a must read if you haven't seen it and are interested in responsive design. I wouldn't say responsive design is "hard". It's about being consistent and sensible . I am a firm believer of not re-inventing the wheel. For instance, no matter how good I was at coding (which am not, hehe), I wouldn't bother coding a PHP application to do what PW did because it's already doing all that I want and does it well. So I use the existing tool. This is not to discourage anyone from coding their own app. One should do so if there is a particular need not being met, IMHO. What am I saying? There's already dozens of HTML and CSS frameworks out there that do responsive design out of the box such as Bootstrap and Foundation. I love Foundation and it is what I use. I don't care about floats and DIVs misbehaving because Foundation takes care of that for me. Of course we might get into the argument about some frameworks using non-semantic classes, but I think at times that argument just gets in the way. Besides, leading frameworks now take such matters into account. These things have been tested with screen readers and perform really well. Just Google the subject. In a similar vein, in PW, most of the time I don't care about sql queries since PW takes care of that for me. I would suggest to find a good framework and use it. Of course you don't have to use all the bells and whistles it comes with. Download a custom build, the bare necessities and code away. So, no, it doesn't have to be hard. And you can still learn the basics of responsive design even as you use a framework. It's all about ems, %s and @media queries in CSS3 really These may be of interest... Which Is Right for Me? 22 Responsive CSS Frameworks and Boilerplates Explained | Design Shack Fluid Images — Unstoppable Robot Ninja css3-mediaqueries-js - css3-mediaqueries.js: make CSS3 Media Queries work in all browsers (JavaScript library) - Google Project Hosting Beginner’s Guide to Responsive Web Design - Treehouse Blog What The Heck Is Responsive Web Design? Responsive Web Design Patterns | This Is Responsive Responsive Web Design: What It Is and How To Use It | Smashing Coding How to Design a Mobile Responsive Website - UX Booth | UX Booth Media Queries for Standard Devices | CSS-Tricks 37 Responsive CSS Frameworks Every Developer Should See | Web Design Principles A List Apart: Articles: Responsive Images: How they Almost Worked and What We Need Edit: Difference between responsive, adaptive and fluid http://teamtreehouse.com/library/websites/build-a-responsive-website/introduction-to-responsive-web-design/fixed-fluid-adaptive-and-responsive Edit 2: Forgot to add - of course you'll still have your custom CSS file called after your framework's CSS to have the final say on styling particular elements. But you knew this already
- 32 replies
-
- 11
-
Change sort by "value DESC" to "sort=-value"
kongondo replied to kongondo's topic in API & Templates
Diogo, I used the second option. Works a treat! Muito obrigado! -
Hi, I have a situation where a sort value is being sent by GET to be processed by another PHP file in PW. The value is being sent via AJAX. The script I am using uses "value ASC" or "value DESC" as sorting parameters. For instance, the sort value could be "name DESC", (sort by name descending). The value is passed to a PW find() to grab some results and sort them according to the sent sort value. Obviously the following will not work with PW selectors: $pages->find("template=basic-page, limit=10, sort=name DESC");// sort will not work How can I convert the sort value coming in via AJAX ("name DESC") (without hacking the core of that script) to achieve "-name" for use in PW selectors as follows? $pages->find("template=basic-page, limit=10, sort=-name"); Thanks.
-
This also from the API docs.... http://processwire.com/api/selectors/
-
Thank you folks!
-
Hi all, Before you ask, this is part of my learning process so am not busy breaking somebody's site OK, I am now comfortable enough using foreach loops in PW. I am now onto "while loops". How can I replicate the following "while loop" code in PW? I've learnt that it is common to use similar code to access tables in a database. While there are still results, keep on getting them and add them to an array... $rows = array(); $results = $db->query("SELECT id, name, data FROM some_table"); while($row = $results->fetch_array()) { $rows[] = $row; } Now, in my case, my data is in PW as normal PW pages. I do not need to do the $db->query thing. I can use PW selectors. The $results bit is straightforward, .e.g using $pages->find('something'); I also know $pages->find(); will return an array (PageArray). Where am getting stumped is how to use the while loop to do the same thing the above code is doing but using PW API. Specifically, what I don't get is how to replicate the $results->fetch_array() bit using PW API. I have Googled the forum and haven't found anything but examples of querying external tables as shown above. I have also checked the API documentation but nothing has worked for me yet. I am either getting endless loops (white screen) or no items get added to the array . Here's my question in code. I know the $results->fetch_array() will not work here $rows = array(); $results = $pages->find('template=basic-home, limit=20'); while($row = $results->fetch_array())//how to replicate this fetch_array bit? { $rows[] = $row; } Or, should I not use the while loop in such a case? Use something else? Thanks!
-
I would have thought this would suffice <?php /** * Demo site header include file (HTML5) * * Note that this file has nothing to do with ProcessWire. We just split our common * header and footer markup into separate files (head.inc and foot.inc) like this, * since it was common to all of our templates. * */ ?> That's taken right of head.inc....
-
Could Apeisa's module be of help?
-
Hi Bart, Welcome to ProcessWire! Check out this reference page. It might have what you want? Maybe $session->remove($name) The docs say: This is not my area, just wondering.
-
And the classic PHP 101 by Vikram Vaswani. It's old, but still a gem...This is written in fun, easy-to-follow tongue-in-cheek style in 15 parts. Some is way advanced for mortals like myself and I'll probably never need to be that advanced. It's the best PHP tutorial I've seen anywhere. BTW: You''ll get 404s for some of the lessons but nothing that Google wasn't able to find...
-
lol
- 32 replies
-
- manipulation
- imagesizer
-
(and 3 more)
Tagged with:
-
No problem at all. PW can do this already . You can even set up a page with lots of images to act as images container and pull them from there into other pages...BUT this is the in WYSIWYG mode, of course, which we are trying to avoid here...
-
Good question. This is one of those "one man's meat is another man's poison" sort of situation. There are so many different approaches to doing your template files...No one approach is superior (in most cases ) to another. It is an issue of preference. You can even decide you want all your HTML code with PHP inside in one file. This can result in very long, hard-to-grasp code though. You can decide not to name your includes as .inc but .tpl..PHP will happily include them when asked to do so....Or, you can have as many .inc as you wish to make your head spin trying to guess what is including what . I hope it doesn't confuse you more but have a look at this thread. It has lots of wonderful ideas about approaching your template files. Having .inc files also helps with dynamism. For instance, your website can have the same header throughout but different footers depending on the page being viewed. There can be a sidebar.inc as well, which will only appear in certain pages and show a sub-menu, a featured article, etc.... I am working on a short tutorial part of which I hope to post here soon...(and on my website whenever that materialises ) about visualizing your site structure before you build it. Planning is important in these things. Again, people have different approaches. I like to think diagrammatically, at the whole system level. Such an approach helps me visualise the template approach to adopt for a particular job. For instance, what areas of the website are common/shared? What is unique to some pages? How best can I code/design/plan my templates and template files to achieve what I want making best use of logic, KISS and DRY principles and balancing this against common sense and ease of understanding the code? If I come back to the code in a month's time, or if somebody took over my task, would I/they be able to make sense of it all? Sorry for digressing somewhat
-
@adrian, curious why you are not on 2.3? Just a btw...
-
Probably no need to delete all the fields. You may need some, e.g. headline, summary, body. Just rename them, their labels and description as you see fit. That can save you some time
-
Aah
- 14 replies
-
- 1
-
I'm guessing maybe the subtle silhouetted figure in the background.. She was there a minute ago...now she's gone...
- 14 replies
-
- 1
-
Ryan, I'm really impressed, amazed at your level of productivity, responsiveness (and generosity)!
- 74 replies
-
- 5
-
- fields
- alter table
-
(and 1 more)
Tagged with:
-
- 14 replies
-
Thanks all!