Jump to content

Alex

Members
  • Posts

    90
  • Joined

  • Last visited

Everything posted by Alex

  1. You're right, I was using an 'images' field instead of an 'image' field, so I have corrected that on my portfolio template in the admin area. I'm getting new errors on my page now: http://www.alexcreedy.com/cog/ Exception: Method Pageimages::size does not exist or is not callable in this context (in /home/alexcree/public_html/cog/wire/core/Wire.php line 231) #0 /home/alexcree/public_html/cog/site/templates/home.php(15): Wire->__call('size', Array) #1 /home/alexcree/public_html/cog/site/templates/home.php(15): Pageimages->size(150, 200) #2 /home/alexcree/public_html/cog/wire/core/TemplateFile.php(88): require('/home/alexcree/...') #3 /home/alexcree/public_html/cog/wire/core/Wire.php(267): TemplateFile->___render() #4 /home/alexcree/public_html/cog/wire/core/Wire.php(229): Wire->runHooks(Array, Array) #5 /home/alexcree/public_html/cog/wire/modules/PageRender.module(236): Wire->__call('render', Array) #6 /home/alexcree/public_html/cog/wire/modules/PageRender.module(236): TemplateFile->render('render', Array) #7 /home/alexcree/public_html/cog/wire/core/Wire.php(267): PageRender->___renderPage() #8 /home/alexcree/public_html/cog/wire/core/Wire.php(229): Wire->runHooks(Object(HookEvent)) #9 /home/alexcree/public_html/cog/ I'll include my Home Template and Portfolio Template here, (Although I have now added the image field to my Portfolio template in the Admin area, I am not currently displaying that image field on my Portfolio template file, incase that is the problem) Home Template: <?php /** * Home template * */ include("./head.inc"); echo $page->body; echo "<ul id='portfolio_list'>"; $items = $pages->get('/portfolio/')->children("limit=6"); // Here we take children of portfolio page (limit=6) foreach($items as $item) { //Loop through them $thumb = $item->image->size(150, 200); // Small image from each, optional. Assuming that template that your portfolio children pages use have a field called "image" echo "<li><a href='{$item->url}'><img src='{$thumb->url}' alt='{$thumb->description}'>"; // If you don't use image there, then remove img tag here echo "{$item->title}<br />{$thumb->description}</a></li>"; } echo "</ul>"; include("./foot.inc"); Portfolio Template: <?php /** * portfolio-page template * */ include("./head.inc"); echo $page->body; //Display images if available if ($page->portfolio_images) { foreach($page->portfolio_images as $image) { $thumbnail = $image->size(550,0); echo "<div class='workWrap'><a class='workImg' href='{$image->url}'><img class='photo' src='{$thumbnail->url}' alt='{$image->description}' /></a>"; echo "<div class='workDescript'>{$image->description}</div></div>"; } } include("./foot.inc"); Regarding the sidebar list of links, it is working now. I had tried something similar to what was suggested which is encouraging. Thanks for the help to get it working. Thanks, Alex
  2. Thanks for adding the comments to that code, I want it to display the thumbnails, title & description on my Homepage Template, I'm getting an error: http://www.alexcreedy.com/cog/ Call to a member function size() on a non-object (line 15 of /home/alexcree/public_html/cog/site/templates/home.php) Here is my Home Template: <?php /** * Home template * */ include("./head.inc"); echo $page->body; echo "<ul id='portfolio_list'>"; $items = $pages->get('/portfolio/')->children("limit=6"); // Here we take children of portfolio page (limit=6) foreach($items as $item) { //Loop through them $thumb = $item->image->size(150, 200); // Small image from each, optional. Assuming that template that your portfolio children pages use have a field called "image" echo "<li><a href='{$item->url}'><img src='{$thumb->url}' alt='{$thumb->description}'>"; // If you don't use image there, then remove img tag here echo "{$item->title}<br />{$thumb->description}</a></li>"; } echo "</ul>"; include("./foot.inc"); Regarding the Sidebar, I was hoping to display a list of links to the children of the portfolio page. At the moment it displays a list of links specific to the page you are on, so it changes. This is the code used to display the links in the sidebar right now: <div id='topnav'><?php echo $pages->get('/')->children()->render(); ?></div> <?php if($page->url != '/'): ?> <div id='subnav'><?php echo $page->rootParent->children()->render(); ?></div> <?php endif; ?> </div> I would like it to always remain showing the portfolio children links. Thanks, Alex
  3. Hi Ryan, Thanks for that, I have got the subnavigation working so it shows the children of the page you are on. http://www.alexcreedy.com/cog/ What I would like to do is display the children of the portfolio page all the time in the sidebar. Also I don't really want the parent portfolio page visible in the top navigation, as that particular page won't be displaying any content. Is it possible to 'hide' that page but still call on its children? thanks Alex
  4. How do you install, or use these extra fields/inputs? I am keen on adding a title field to the images field. At the moment there is just the description field. thanks Alex
  5. Hi, I am working on a portfolio website, my first Processwire site. I have made a 'portfolio-page' template to display multiple images, they appear here in my top navigation as 'Work One & 'Work Two' http://www.alexcreedy.com/cog/ I would like to create subnavigation in my sidebar for these 'portfolio-page' template pages, and so they do not appear in the top navigation. Also would like to feature these pages on the homepage as a Thumnail image with Title and description, i have attached an image which roughly shows what I mean. Also here is my 'portfolio-page' template if any help: <?php /** * Page template * */ include("./head.inc"); echo $page->body; //Display images if available if ($page->portfolio_images) { foreach($page->portfolio_images as $image) { $thumbnail = $image->size(550,0); echo "<div class='workWrap'><a class='workImg' href='{$image->url}'><img class='photo' src='{$thumbnail->url}' alt='{$image->description}' /></a>"; echo "<div class='workDescript'>{$image->description}</div></div>"; } } include("./foot.inc"); Any pointers or links to examples much appreciated, cheers, Alex
  6. thanks - that works great I made the width a bit bigger: $image->size(400,0)
  7. Regarding image sizing in the template $image->size(200,200) can you define the width but allow the height to be in ratio for each individual image, if that makes sense... thanks Alex
  8. Those tutorials are really useful for my level, where i'm learning the basics. That kind of quick tutorial on different topics would be great to expand on. thanks, Alex
  9. the images aren't actually mine I just dragged them in from my 'cool images from the web' folder. eventually i will turn this site into a portfolio for an illustrator/artist who does really fantastic stuff. alex
  10. Hi Marty & Jasper, Yes that did it thanks, and the $n could be useful at some point too. cheers, Alex
  11. Yes i'm down in Melbourne, surely i'm not the second Australian to be using processwire... there must be more out there. Thanks for the replies. I tried Formmailer's code, got it to display description but not images, Have tried some code from the quickstart/images link which works for images and i added in the description field to this. See both bits of code below on my portfolio-page.php: <?php /** * Page template * */ include("./head.inc"); echo $page->body; //Display images if available if(count($page->portfolio_images)) { echo '<div id="gallery">'; $n = 0; foreach($page->portfolio_images as $image) { echo "<p><img class='photo' src='{$image->size(200,200)}' alt='{$image->description}' width='200' height='200' />"; echo "<br />{$image->description}</p>"; $n++; } echo "</div>"; } //Display images if available if ($page->portfolio_images) { foreach($page->portfolio_images as $image) { $thumbnail = $image->size(200,200); echo "<p><a href='{$image->url}'><img class='photo' src='{$thumbnail->url}' alt='{$image->description}' /></a>"; echo "<br />{$image->description}</p>"; } } include("./foot.inc"); and link to the live page: http://www.alexcreedy.com/cog/portfolio-page/ You can see where those images are not rendering there's just a double description. Does anyone know why? Also in Formailer's code what do these bits do: $n = 0; $n++; I am starting to understand the other parts . Thanks, Alex
  12. Hi, I'm starting to put together my first processwire site, it will be a portfolio style site for a friend of mine. I'm following the head.inc > page-template.php > footer.inc structure. I'm going to have a portfolio-page.php for each project. Sometimes there will be multiple images per project, and i want a piece of text attached to each image to display. I'm happy for the page to just scroll down when theres multiple images. The images will be on the large side. What is the best approach? – Is it best to create 'sub pages' under each project for each additional image? So there would be a template for individual images? – Or is there a way to add extra images with text straight to the main portfolio-page.php template? I have used the 'images' field but it doesn't display the description. I would prefer to wrap each image and text in a div. I'm not sure where to start in the API for this information?, I guess i am looking for examples of the code so I can understand it better. thanks, Alex
  13. Hi, On the demo page it mentions the 'Skyscrapers' source code is available in the download area. I am hoping this means the page templates to take a look through. Maybe I am blind but i can't find it? thanks Alex
  14. Hi Pete, Thanks - yes worked straight away! Thanks, I think i am on my way now, loving it so far. I added a date field in the Setup area and changed my news_story.php so it displays that date: <?php /** * News Story * */ include("./head.inc"); ?> <h1><?=$page->title?></h1> <p><strong>Date: </strong><?=$page->date?></p> <div id='bodycopy'> <?=$page->body?> </div> <?php include("./foot.inc");
  15. Hi, I am starting to play around with Processwire, I am looking at the news page example forum post here: http://processwire.com/talk/index.php/topic,442.0/prev_next,prev.html#new which talks about creating individual news story pages then displaying them on a news index page. Mine is not working yet, i have literally cut and paste what was in the above forum post... I created a news_story.php and news_index.php just using the basic example site templates Can someone point me in the right direction how to display the news stories on the news index page? Would be much appreciated to get me started on processwire basics. Here is a link to the live pages: http://www.hoof.net.au/pwire/news-page/ the code is here: news_story.php <?php /** * News Story * */ include("./head.inc"); ?> <h1><?=$page->title?></h1> <div id='bodycopy'> <?=$page->body?> </div> <?php include("./foot.inc"); news_index.php <?php include("./head.inc"); ?> <h1><?=$page->title?></h1> <?php // start the news stories list echo "<ul>"; // get the stories for this page $stories = $page->children("limit=4, sort=-date"); // note if you set the stories to sort by date descending on the /news/ page // in the admin, then you can omit the "sort=-date" above. // cycle through each story and print it in a <li> foreach($stories as $story) { echo " <li><a href='{$story->url}'>{$story->title}</a> <p><strong>Date:</strong> {$story->date}</p> {$story->body} </li> "; } echo "</ul>"; // get values for our placemarker headline $start = $stories->getStart(); $end = $start + count($stories); $total = $stories->getTotal(); $num = $input->pageNum; $lastNum = ceil($total / $stories->getLimit()); // output the placemarker headline echo "<h4>Showing $start - $end of $total Article/s | Page $num of $lastNum</h4>"; // output pagination links echo $stories->renderPager(); include("./foot.inc"); Regards, Alex
×
×
  • Create New...