Jump to content

phil_s

Members
  • Posts

    30
  • Joined

  • Last visited

Everything posted by phil_s

  1. Sorry to revive this old topic: I was wondering if anybody knows what set_time_limit() actually does, when put in the image loop? If you add e.g. set_time_limit(8) to each of the image loops, what happens if that 8 seconds is not "enough"? I suppose the script will stop, and when the page is reloaded it would continue from where it stopped? So adding the time limit wouldn't have any adverse effects on site performance once the script has run through the initial load, right? Cheers Phil
  2. @apeisa, sorry, edited the initial post to make this more clear: I want to output x number of posts, and "package" them into slides (each slide containing three posts). Makes more sense?
  3. Thanks guys, much appreciated! Apologies for the late reply, I have been busy learning/building my first PW sites, hope to finish them soon. For anybody just starting out I highly recommend this video Marty_Walker was kind enough to share, helped me understand the basics really quickly: cheers
  4. I am finishing up my first processwire site (yay), and this last bit is giving me a bit of a headache: For a news slider, I want to output x number of posts, with three posts per slide. (for a theoretically unlimited number of slides) I figure in theory this should work something like the code below, however the looping logic, among other things is still somewhat beyond me: <?php $items_per_page = 3; $start = ($pages->get("/news/")->find("sort=sort")->pageNum - 1) * $items_per_page; $total = count($pages->get("/news/")->find("sort=sort")); $slicedarticles = $pages->get("/news/")->find("sort=sort")->slice($start, $items_per_page); foreach ($slicedarticles as $slicedarticle => $total) { echo "<div class='slide'>"; foreach ($slicedarticle as $article) { echo "<h3>{$article->title}</h3><p>{$article->body}</p>"; } echo "</div>"; } ?> Can someone point me in the right direction with this? Much appreciated! Cheers, Phil
  5. Hi folks, Another long-time Textpattern (and Textdrive VCII, anyone remember?) user here who wants to convert to Processwire. I've always felt the textpattern interface was rather unsuitable for non-blog sites with all its unused fields and options, and I'm really looking forward to getting familiar a new structure. I know my way around HMTL/CSS/Jquery, and I am learning/copying/pasting/googling PHP Thanks to all the tutorials, documentation and fine users posting in here I think I've already started to get a grip on things, but I am still confused by some of the main ideas of processwire. As a first project, I would like to build a simple portfolio single-site. It should have three sections: projects, exhibitions, and about. - The projects sections should be a list of projects with each project entry containing Name, Year, Description, multiple imgs - Exhibitions should be a list of exhibitions, with each exhibition entry containing Name, Year and Description - About should be a simple biography text (I'll leave this out from the detailed write-up below, think I can handle this..) I can already see that Processwire is much more flexible than the article based approach that textpattern uses, and coming from the latter I suppose it simply takes some time to make sense of things… Anyways here's what I would do next or rather how I imagine processwire to function–I am not sure if this is the "right" way or order to do it so any input would be very much welcome! 1. Setup - Set up the fields needed for the project and exhibition articles. - Set up the templates needed for each of the articles pages (e.g. article_project, article_exhibition), add fields - Set up the templates needed for each of the (invisible) overview pages (overview_projects, overview_exhibitions) 2. Pages - Create the (invisible) Projects & Exhibitions pages, assigning each of the pages the overview_xxx templates I created - Create subpages and assign them the article_xxx templates I created 3. Structure/Code - Create template file for the main page (e.g. index.php) and assign this to the home page in the backend - Create foreach loops for both exhibitions and projects Does that make any sense? Looking forward to learning new things! Cheers Phil
×
×
  • Create New...