Jump to content

onjegolders

Members
  • Posts

    1,147
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by onjegolders

  1. Thanks Ryan, this really helped me out, is there anything your not good at?! Is there anyway of passing a php variable to set the "rel" attribute. Ie: the $page->name and maybe the image description for the a "title" tag?
  2. Diogo's right this is perfect for child pages, your dealers template will just loop through all of its children and perhaps grandchildren if you want to set it up organized by country. PW is great at this sort of site, as you will see with many of Ryan's own sites
  3. Thanks Matthew you make a lot of really useful points. Wondering whether the Joomla horse at the end needs "putting down" I'm convinced that I only want to deal with Processwire for all normal sites and that to compete with the 5 minute £500 websites that small businesses want, I need to set up my own profiles within PW so I can give them what they want and still be profitable. I can mimic the other quickstart solutions but build it in PW - better for me and for them in the long run!
  4. I just can't see how ST2 can be bettered right now. I used to like Coda and Textmate and they're fine but ST2 just saves me so much time. The multiple selection commands, go to anything commands, select next etc Coding is just so fast with it, also the program itself is blistering, I've no idea how the developer manages it but it's everything is just so fast. At the very least worth trying out for those who haven't used it.
  5. Hi Wanze, clearing MarkupCache seems to have sorted it for me, thanks a lot. Will let you know if it comes back.
  6. Hiya Barry, without going into much detail as am a bit rushed at the moment, with PW you can easily use the API to add/edit/delete pages. This case sounds like it would be no different. Create page: $p = new Page(); $p->template = 'myTemplate'; $p->name = 'page_name'; $p->parent = '/parent_page/'; $p->of(false); $p>title = 'My New Page'; $p->save(); Edit page $p = $pages->get("/about/"); $p->of(false); // turn off output formatting $p->title = "New Title"; $p->my_field = "My Value"; $p->save(); Delete page $p = $pages->get("/about/"); $p->delete(); If you want to let members edit this, just place it all in an if statement and set up a form to input the data. Then make sure you sanitize the data before adding it to the new page. This can apply to users as well as normal pages. It is all editable via the API. There's tons of topics out there already on the forum but check out the API http://processwire.com/api/ And Soma's cheatsheet http://processwire.com/api/cheatsheet/
  7. Hi Wanze, I have no idea why but going to my analytics page now in admin crashes the whole page. I tried updating and now it's stuck with the loading image too. It seems to only happen to me with Chrome though (I'm on a Mac) though that may be as it's where I've been using it before. Can't think why it's doing this, any ideas? Thanks
  8. It gets better and better the more you learn, trust me! I knew nothing when I first started here and now I know a little bit more than nothing!
  9. Hiya Matthew, Ryan's right that Form Builder is an excellent tool for putting complicated forms out there quickly and easily but he's also right that it's pretty simple to do it yourself. I actually finished my templates just before purchasing Form Builder and I'm glad I did as it means I know how to make this all work with my own code but I also have a tool that can make life easier for me in the future. Form Builder is fantastic and well worth a look but have a go at creating pages yourself with the API, it's very satisfying and easy to get going. Let me know if you need any help with the code
  10. onjegolders

    FYI :-)

    Nice article and I love your site design - good work!
  11. Cheers Reno, so looks like if you don't add a selector then the whole page will be invisible until fonts are loaded - that may be preferable to be honest
  12. Yep that works for me, the wf-loading class is only when the fonts are being loaded so hiding any elements you want while that's happening seems to do the trick
  13. EDIT: <script type="text/javascript" src="http://use.typekit.com/xxxxxxx.js"></script> <script type="text/javascript">try{Typekit.load();}catch(e){}</script> <style type="text/css"> .wf-loading .blog-title, .wf-loading .post-title { /* Hide the blog title and post titles while web fonts are loading */ visibility: hidden; } </style> That's from this link http://blog.typekit.com/2010/10/29/font-events-controlling-the-fout/ in 2010 but worth a try
  14. Yep I've become accustomed to seeing this with my fonts in FF to be perfectly honest I haven't thought about a solution but I'll look into it.
  15. Also reminded me how much I love Museo Slab...
  16. Phenomenal, rare to find a developer with such a good eye for design but it's a lovely looking site Ryan, congratulations!
  17. Read up above Noose for ways of checking who is logged in. If you were extending the "user" template and adding images to it you could display them in a "profile" template. <!-- Profile Template --> <?php if ($user->isLoggedin()) { ?> <h2>Welcome back <?php echo $user->name; ?></h2> <?php if (count($user->images)) { ?> <p>Below are your photos</p> <?php foreach ($user->images as $image) { ?> <img src="<?php echo $image->url; ?>" width="200" height="150" alt="<?php echo $image->description; ?>" /> <?php } ?> <?php } ?> <?php } else { echo "<h4>Sorry you have to be logged in to visit your profile</h4>"; } That way, only a user who is logged in will see a profile and they will only see their particular page as it is tied to $user
  18. I like the idea of tools, one small frustration is having to occasionally go through two menus to get one thing done. Eg: Setup->fields, Setup->templates but it's no biggie but I guess a drop down may be a solution. I also like the idea of "Save & New", "Save & Return" buttons etc when creating new pages, templates and fields. Anything that can help with the natural flow in the backend. It's no biggie though
  19. Yeah, essentially a dropdown where you could make some (basic) changes without actually having to open up the page. That and any batch processes, it's all going to help speed up developing in the back end. Just idea though, it's already a great addition
  20. Sure, any page can be made to display only if the user is logged in, or has special permission. Again it's just a combination of using an "if" statement. Eg: <?php if ($user->isLoggedin()) { // display page } ?> Or: <?php if ($user->isGuest()) { echo "Sorry you have to be logged in to see this page"; } ?> As just two examples. I recommend checking out Soma's really helpful cheatsheet for working in the templates, after a while it becomes second nature but it's still a useful tool. http://processwire.com/api/cheatsheet/
  21. Url Segments can be turned on a per-template basis. Basically if you turned it on for the "member" template. You can manipulate the url to show different content. Say if on your member pages, each member had some profile information but also many images and some files. On your "member" template, you could do the following: <?php if ($input->urlSegment1 == "photos") { include("./photos.inc"); } elseif ($input->urlSegment1 == "files") { include("./files.inc"); } else { // Display normal page stuff } ?> Then on your photos.inc file: <?php $photos = $page->images; foreach ($photos as $photo) { ?> <img src="<?php echo $photo->url; ?>" width="200" height="200" alt="<?php echo $photo->description; ?>" /> <?php }
  22. <!-- Members Template --> <?php if ($user->isSuperuser() OR $user->hasRole("editor")) { $members = $page->children(); if ($members) { echo "<ul>"; foreach ($members as $member) { ?> <li><a href="<?php echo $member->url; ?>"><?php echo $member->title; ?></a></li> <?php } echo "</ul>"; } } else { throw new Wire404Exception(); } <!-- Member Template --> <?php if ($user->isSuperuser() OR $user->name === $page->name) { ?> <h3>Hi <?php echo $page->title; ?> Welcome back</h3> <?php if ($page->images) { ?> <h5>Here are your images</h5> <?php foreach ($page->images as $image) { ?> <img src="<?php echo $image->url; ?>" alt="<?php echo $image->description; ?>" /> <?php } ?> <?php } ?> <?php } else { throw new Wire404Exception(); } <!-- Login Template --> <?php $out = ""; $form = " <form action='./' method='post' id='login_form'> <label for='login_name'>Username</label> <input type='text' name='login_name' autofocus> <label for='login_pass'>Password</label> <input type='password' name='login_pass'> <input type='submit' id='submit' name='login_submit' value='login'> </form> "; if($input->post->login_submit) { // process submitted login form $name = $sanitizer->username($input->post->login_name); $pass = $input->post->login_pass; if($session->login($name, $pass)) { if ($user->isSuperuser()) { $session->redirect("../members"); } else { $session->redirect("../members/$name"); } } else $out = "<h2>Login failed, please try again.</h2>"; $out .= $form; } else { $out = "<h4>Please sign in, in order to view your profile page.</h4>"; $out .= $form; } include ("./header.inc"); echo $out; include ("./footer.inc");
  23. Hi Noose, will your client have access to the admin? I'm guessing yes. Essentially once you've done it once you will find it simpler. You will create pages of type "member" which will sit under "members". You will also create users. You want the username to match the name of their corresponding "member" page. In your templates you will check to see if user->name is equal to $page->name. If so, they can see the page. The easiest way is to get the member to login (I can show you all my templates if you like) If their login is successful, they will be redirected to their profile page which will be at /members/john-doe/ And this will contain any information which has been stored on their page, including images, files, anything relating to just them.
  24. As Apeisa says, within your foreach loop, you'll need an if statement so: foreach ($page->children() as $child) { if (count($child->images)) { echo "<li><div style='float:right;'><img style='margin:5px 0 5px 5px;' src='{$child->images->first()->size(232, 176)->url}' alt='' /></div>"; } echo "<div><a href='{$child->url}'>{$child->title}</a><br /><span class='summary'>{$child->summary}</span></div></li>"; } EDIT: Need to "count" to see if their are images
×
×
  • Create New...