Jump to content

Joss

PW-Moderators
  • Posts

    2,862
  • Joined

  • Last visited

  • Days Won

    47

Everything posted by Joss

  1. Hey, Mr Stevens, glad to see Foundwire helped someone. Rather than go to the trouble of installing Ruby and the rest, either go grab Scout or PrePros Scout is free and PrePros has a free and paid version. PrePros has the advantage that it will handle less and sass as well as minify JS, HTML and the rest. Nice clean site, btw
  2. Joss

    principlededu.com

    Nice one Neeks and thanks for demonstrating so clearly the difference between WP and PW (see what I did there?) when it comes to developing for the actual client. Nice graphics and site, too.
  3. Jees - I swear you guys managed to "like" that post while I was still writing it!!!!
  4. I am not a dev, but as I said before, all they are doing is using a line of JQuery to put the url of the linked-to page into the address bar. If you look at the source, the modal is in a div with the class "module Closeup canClose" This div is written (using ajax, I would guess) into a div called appendedContainer, which remains on the page unpopulated if you don't click on anything - it is simply a target for the retrieved page The css for the the closeup div is: .App .appendedContainer>.Module { -webkit-overflow-scrolling: touch; overflow-y: scroll; bottom: 0; left: 0; position: fixed; right: 0; top: 0; z-index: 680;} As you can see, it positions itself over the home page content with a z-index to put it on top. The actual homepage which is being overlaid is in a div called "ajax HomePage Module," just for interest and to help you find your way through the source. sooooo... What needs to be done here (by some nice person who can write a couple of lines of code) is for your link to call, by ajax, an actual PW page using its own template (possibly render() - though you would need to get rid of header and footer bits), write it into a div as above and at the same time, pop the URL of that page into the address bar. I am pretty sure that is how Pinterest are doing it, though foolishly, without PW It is probably about 4 lines of code and a couple of lines of JQuery to sort out the address bar bit. I am really not certain how to do it as I am an ajax virgin, but someone should be able to do it on the back of what I have just written. By the way, I do not see any SEO advantage to this method - the page is only called in by ajax when the user actually clicks on the image/link and the address bar is only populated at that same point. From a Search Engines point of view, it will just look at the link on the image, whether or not it has a nice flash popup Does that help steer you in the right direction? I am sorry I don't quite know enough to post the actual few lines of the solution. I could probably work it out eventually, but that would just be by asking everyone here how to do it! haha. PS: It is very definitely NOT an underpop - though I love that term! It is an overlay.
  5. Looks interesting Dave - I will play with it later! (after some gardening...)
  6. I never get error free validation - css3 tends to fail all over the place. I was amused to notice that even stackoverflow is full of errors Thankfully, none of my low value clients even know what wc3 is. Interesting blog posts, SiNNut
  7. Okay, not sure if this helps, but PW is sort of built on top of arrays - called wirearray For your purposes, just about anything can end up in an array unless you tell it not to. So, if you shove the children of a page into a variable: $myarray = $page->children; Then you have created an array - you can foreach through it to your hearts content! If you have an images field, if you have set the max number of images to be anything other than "1" then you will have an array - when you set it to 1, you can treat it as if it is not. When you go find() anything, you will end up with an array, even if you only have one thing in it. apeisa is right - the blog profile is pretty advanced, mostly because Ryan neatens everything down to as short as possibly which makes it hard to follow. If you have done my basic website tutorial on the wiki, and then moved onto the simple news system, however, that is pretty blog-like (if rather basic) and has lots of looping in it!
  8. Hi Jason - I am currently writing a loooooonggggg tutorial for people like you, but it is a long way from being finished. However, to get you started: Your template file (as opposed to a template) is just html with some bits shoved in it. So the best way to get started is to create a template file called something.php and make sure it is inside the site/templates/ directory. For the moment, dont worry about headers or footers, but just write a bit of very ordinary html. Now, to get around you really need some navigation, but to get you started we will even forget about that. In admin, go to setup > templates and create new. You will see your something.php listed. Click on it and save it. Now, go to Pages, click on Home and click on new. Call your new page, My Page (why not?) and select the template that you have created. Save it, then publish it. Now, to to the front end of your website and in the address bar type yoursite.com/my-page/ And your page will come up - completely blank. But it is a start! Most of this you already know, but there is a good reason for reminding you - when you are lost, it is easier to start with the basics. Now, open your template file something.php in your editor. Somewhere in the body you need to tell the template file to use the fields that are in the associated template in the backend. At the moment, you only have one field: title. So, open a php statement: <?php and we then need to echo out the title: $page - that says we want a field directly related to this page -> tells the system that we are going to define something title - that is the name of the field (not the label, but the actual name) so .... echo $page->title; and end the php with ?> The final thing can be written in one line <?php echo $page->title; ?> Save that and reload the page and you will see the title appear. From this point on, basically EVERYTHING you do will use this workflow: Field > Template > Page > Template file. Now, admittedly it gets a bit more complicated after a while but the principle remains the same - in the template file (or in any file you are including into the template file) you simply retrieve the data you have in the fields and you echo them out so you can see them. Now, that is very, very basic - but that principle is core to the way you will work and once you have understood that, everything else is just variations on a theme!
  9. Fun! Nice one Diogo
  10. At which point exactly does it simply explode?
  11. Oh, one little tip if you like using JQuery plugins. The default PW installation comes with Styles and Scripts folders inside of templates. However, a lot of frameworks and JS plugins use css and js as folder names. When I start a new PW project, the first thing I do is change the names to css and js - I get less puzzling surprises that way!
  12. It might be worth you just doing one of the easy tutorials - they are a bit like being taught to suck eggs (sorry, I tend to write like that) but they will give you a good idea of how to think your way through the process. Again, they are just one way of doing things, but they are very clear. http://wiki.processwire.com/index.php/Category:Long_Tutorials The basic website tutorial is as a good a place as any.
  13. Oh, I told my text editor that .inc is the same as .php - it tried to go all logical and objectionable on me but I beat it into submission in the end.
  14. Okay, three four of us posted at once! There is a good reason for that, however. The reason we all love working in PW is it is a little like wandering off to do some nice happy HTML with a powerful database and API attached. For instance, I use Bootstrap and sometimes Foundation and lots of JQuery plugins - but none of them have to be changed to suit PW, you can use them out of the box, just as you would in a static site. This makes it incredibly powerful - nothing is off limits or requires someone to produce the "PW" version of something as you would in Drumlapress. So, just write your templates, or bits and pieces to be included into templates, as you would any other html page - but do it with the PW API supplying the content.
  15. Hi Mike and welcome! The thing about PW is that it really does not have any fixed structure - it is up to you how you want to work. There is one fixed rule, however - for a file to be available as a template file is must have a php ending and it must be directly in the templates folder. And that is it. After that is is up to you. For instance, I tend to have my main templates like home, basic-page, gallery - whatever I think I need. But things like my header and footer I put in an includes folder within templates and the just include them into the file. Likewise, I split out much of my logic into functions in one or more functions.inc files and stick those in the includes folder. It doesn't make any difference to PW itself, but it help me think my way through it. PW is a lot less restrictive than drupal!
  16. Take a tip from the PW tutorial I am currently writing: Make a coffee, get a huge piece of paper, a pencil and an eraser, lie on the floor and get planning. You will get your approach worked out ten times as fast as you will on some new-fangled computer gizmo!
  17. This is the sort of thing I normally either do with a bit of jquery - you can look at the height of the first div and then use JQuery to write the height and width into the second div. I cant remember if this is the plugin I used or not - but it is the same sort of thing: https://github.com/mattbanks/jQuery.equalHeights
  18. Well dont forget you can resize the image using the api and create many different versions at the same time. And there is also the thumbnails module if you want to create a bespoke set of thumbnails at upload http://modules.processwire.com/modules/fieldtype-crop-image/
  19. I had to search on Google today for something relating to a client and I still came back with me! Damn ... that is so unfair! Separately and aside from that and in answer to the OP - yes, all of that can be done with PW one way or another, but I warn you, there maybe more than one way you can do it! I suspect you will need to use a bit of php to do the adding up, but that is what it is there for, really.
  20. Being that I was sorting through pages and then sorting through a repeater and then sorting through an image field array and then only wanted one and really didn't care which one it was as long as it was one of them and it was possibly different each time or at least as often as no one noticed. I was so glad to find that there is such a thing as getRandom() just now! Happiness can be easily won.
  21. ooh! My first best answer (I think) Only took me 1,367 posts ....
  22. try: sort=-created to use "date" you would need to have created a filed called Date, I think.
  23. Quick question, why do you need to use the same image multiple times in the same field? This maybe something you can solve better at the template-file level http://processwire.com/api/fieldtypes/images/
  24. ah good - was hoping someone would actually play with it!
×
×
  • Create New...