Jump to content

Joss

PW-Moderators
  • Posts

    2,862
  • Joined

  • Last visited

  • Days Won

    47

Everything posted by Joss

  1. Mellissa, what are the actual fields you have for your template and what values do you have for the check boxes? Also, since you are using check boxes, does this mean that something can be part of more than one category? If it should only belong to one, then checkboxes are a bad idea. You can set up several conditions: if (something && !somethingelse && !somerthingother){ But if you have variable categories, this is going to be very limiting. Normally, when I do categorisation, I use a select (via a page field) for the categories (that are saved separately) and then use find() to search for posts with a certain category.
  2. You could do something like if (!$child->seasonal) { Nothing to see here }else{ all my lovely results } If you want to display if it IS selected, then do not do if ($child->seasonal==1) { but rather if ($child->seasonal) {
  3. Install the profile exporter module http://modules.processwire.com/modules/process-export-profile/ It creates the install directory and comes with instructions.
  4. Wanze, I am always doing things like that. I develop web stuff on a local box where I create domain names with my own local top level domain which is a sort of in-family joke about a character I used to do for the kids - and then just massage my host file to point in the right place. When a client wanted to see something I was doing the other day, I happily emailed him a link. "What the hell is dot BEAR?" he replied
  5. The best one I ever did (many, many years ago) was to reformat a disc. I studiously backed up the contents to another drive and then reformatted the entire disc. I can't remember exactly what the point was when I remembered that the other drive was in fact just a partition of the same disc.....
  6. Warning, I think there is the odd typo in the tutorial, but others have managed to struggle through it!
  7. Actually, if you want to control some bits and pieces, you can simply create a hidden page with a template (without a template file) and call it something like settings. You could add a field, for instance, called site_title, and then call that field into perhaps your header of the site: <title><?=$pages->get("/settings/")->site_title ?></title> You could put other global bits in there like a name to call a theme css file and that sort of thing. Don't need a module for that. I always create a page like that with global bits and pieces in it and then just call the fields into which ever template files.
  8. Actually, don't bother backward engineering anything - what I set out really is the complete templating system. How you put those templates together structurally is exactly the same as if you were putting together a static site, with perhaps a bit of php to include the odd menu. The default website is one way of doing it, but not the only way. You can add any css framework, for instance, in exactly the same way you would for a static site. There is only one rule: files created in /site/templates that have a .php extension are candidates for template files. If they are anywhere else, they are not. The structure sort of works like this: field > template (in admin) > template file > page So, you create a pile of fields, add them to a template that is linked to a template file, then create a page with that template and view it in the front end. The pages are part of a tree, so even without a menu, you can find them from the front end. If you create a page called mypage as a child of the home page, the address will be: yoursite.com/mypage/ If you create another page as a child of the first one you created it will be yoursite.com/mypage/myotherpage/ To display a whole page, the template MUST have a template file, which is a bit obvious, but you can create templates without files for other purposes. Obviously, what you can do from that point on can get a lot more complicated, but that is the basis of it all. I have a tutorial on the wiki (which is getting a bit out of date) but it will give you some basic sense of what is where and how it works: http://wiki.processwire.com/index.php/Basic_Website_Tutorial I really need to rewrite the damned thing! Trust me, when I first played with ProcessWire, I really knew very little php (still do), but I decided to take one of my existing sites and rebuild it with PW. In two days it was up and running. I haven't used Modx, so I cant make a comparison, but PW at a basic level is piss easy!
  9. Here is the fastest 5 step template tutorial, but it is how it works: 1, Create a file in site/templates called mytemplate.php 2. Go into admin, go to template and create a new one - you will see your mytemplate.php listed. Click the checkbox and save. 3. Go to pages in admin, click on home and click on New to create a new page. Select your mytemplate template and put something in the title field. Save and then publish. 4. Open your very empty template files and write the following <?php echo $page->title; ?> Save it. 5. Go to the front end of the site - if you have used just the default installation you will see your new page in the top menu. Click on it. and you will see a very boring title on a very plain page. And that is the totality of the template system - the rest is up to your html and css imagination! Good luck.
  10. Short answer: Yes Slightly longer answer I do not have a dev background (actually a commercial composer and writer and occasional photographer) but I find I can work with this simply because the coding side of it really does start with html. If you have lots of php knowledge the sky is the limit. If you don't you can still design a solid, secure, client friendly website. And that is what you need 90% of the time. I am currently putting together a site with Edge Animate and the PW side will be very simple - but it is lovely to have it there!
  11. The way I did it on my music site was using media elements, I created two file fields, one for the ogg and one for the mp3 - this is as much to remind me to upload both! You could make both required as an extra hint! then I just did this: <?php if($page->audio_track){ ?> <audio id="player2" controls="controls" style="width:350px;"> <source id="mp3_src" src="<?php echo $page->audio_track->url; ?>" type="audio/mp3"> <source id="ogg_src" src="<?php echo $page->audio_track_ogg->url; ?>" type="audio/ogg"> </audio> <?php } ?> This is obviously aimed at Media Elements, but the principle is the same anyway you do it. I added the IF so I didn't get any errors if I didn't upload a file.
  12. Joss

    ProcessWire on the web

    *whistle whistle whistle* I think I probably ought to go out and walk the dog or something .......
  13. Joss

    ProcessWire on the web

    And his reply: http://ngo-hung.com/blog/2014/03/21/so-many-php-frameworks
  14. Diogos right - everything you need is in the API rather than by thinking in terms of what the database is up to. The DB structure that Ryan has designed allows anything to be related to anything else without having to change the structure (and everything is indexed so you don't get slowed down by any particular approach). The parent child/relationships that can be built either logically or from one branch to another, basically give you all the relational tools you want. So, at a very basic level, a set of children having a common parent will give you a very strict relationship, and a visual one too, since you can see it in the tree structure. But it goes further, very simply. One of the more powerful tool is the Page Field. Since this can be used to relate any page to one or more other pages (and, by logic, the other way round as well) you can easily move from a one to one, relationship to a one to many or many to many relationship. And you can build multiple relationships for each template (and by extension the page container based on the template) - as many as you like really. Also, if you remember that a page is simply a container that can hold one or more fields of data, plus any relationships via the page field, then you can see that you have a potentially very powerful beast. It really does help to forget that there is MySQL in the backend - just think of templates as tables and pages as rows (er, I think that works) and so think of the page system as your database. And off you go! Did any of that make sense? I got a bit lost somewhere....
  15. Joss

    ProcessWire on the web

    Yes, lets take a mean, lean, programming machine and make it all fat and podgy by stuffing it with another framework
  16. Joss

    ProcessWire on the web

    Ah, I didn't quite manage that ......
  17. Ah, that is an old screenshot - the tutorial got edited a long time ago to remove meta keywords (bit superfluous really) and change the way the images work, but the screenshot hasn't been changed. Why don't you think the meta description will work?
  18. I wonder if your day-to-day computer is like mine - stuffed to the brim with software that I tried once, forgot what it was and never got round to uninstalling it. I sometimes through my lists and think "I wonder what that did?" I also have a downloads full of mystery zips - I definitely downloaded them for something at sometime, but cant remember what. This is not helped that I have managed to keep a lot of my archives going from the mid nineties - some of those bits and pieces are probably freebees from the front of mags that are for windows 3.11 ..... Pity my memory is not quite as good.
  19. Oh, by the time you add all the full moderation tools, post reporting, posting via email, lists, and all the vast number of configurations and multiple permissions that you get with things like IP Board or SMF, then that is one pretty big wheel. A very basic forum is not a bad add on, but if you have enough users to warrant a forum in the first place, then you probably want something with a lot of configuration and management tools.
  20. Are you still using the Skyscraper demo? If you are, I strongly suggest you just download the default PW installation, do not add any other profiles, and start from there. Then you will have a clean starting point with very minimal content or markup to mess you up - you can just delete all the content and start from scratch with what you need to learn. You will get on a lot faster, I suspect.
  21. Nice one! Spreading the word is always nice to hear about
  22. not MORE plugins for Chrome - it gets slower ... and slower .... and slower.... I have started playing with Aurora for some light relief.
  23. Every time I have ever looked at integrated forums with other CMSs, it always feels like reinventing the wheel - generally, they are so complicated that they need their own team supporting them. The only integrated forum I have found that was half decent was the one with Liferay. But that is a bit of a beast. Generally, I think it is better to find one that is properly supported and then bridge - less worry!
×
×
  • Create New...