Jump to content

StephenOC

Members
  • Posts

    10
  • Joined

  • Last visited

StephenOC's Achievements

Jr. Member

Jr. Member (3/6)

2

Reputation

  1. Thanks guys. This works perfectly now. I have a lot to learn, but I am loving the way ProcessWire works.
  2. So to get $portfolioPage do I need to do what I done to start with? $portfolioPage = $pages->get('/portfolio/');?
  3. Sorry LostKobrakai ... I don't understand. Can you clarify further for me please? Thanks.
  4. Thanks LostKobrakai, however this is not in the order that my portfolio items appear on my portfolio page, this is the order they appear in the admin of ProcessWire. On the portfolio page I have a 'projects' field which is of type 'page' and I use ASM Select to select the portfolio items I want to appear on the portfolio page and what order they appear in. Is there a way to tie the previous/next links to the order that they appear on the portfolio page? Thanks.
  5. I am fairly new to PW and I am struggling to get my previous/next links to work once the end/beginning is reached. I have a list of portfolio items displayed in a specific order (ASM Selector) on my portfolio page. I'd like the previous/next links to follow the order of the portfolio items on the portfolio page. So in each portfolio item page I have the following code: <div class="pagination"> <?php $portfolio_pages = $pages->get('/portfolio/')->projects; ?> <div class="left-arrow"> <a href="<?php echo $page->prev($portfolio_pages)->url; ?>" title="Previous Project"><?php echo file_get_contents('assets/static-images/left-arrow.svg'); ?></a> </div> <div class="all-projects"> <a href="<?php echo $config->urls->root; ?>portfolio/" title="All Projects"><?php echo file_get_contents('assets/static-images/all-projects-icon.svg'); ?></a> </div> <div class="right-arrow"> <a href="<?php echo $page->next($portfolio_pages)->url; ?>" title="Next Project"><?php echo file_get_contents('assets/static-images/right-arrow.svg'); ?></a> </div> </div> But when the beginning or end is reached there is no previous/next link url, it's just blank. How can I get my links to link back to the end/start once the first/last item is reached? Thanks.
  6. Hi guys, Thanks for the feedback and advice. I didn't think my way was going to be the best way to do things. I'll have a look at the modules suggested and see which one best fits my situation, on quick glance the CroppableImage one looks good, but I will need to test it out. Thanks again.
  7. Hello. I am very new to ProcessWire and I am currently building our company website with it. For the most part I understand what is going on and understand how to use the API to get data from the database to the front-end, and I love the way it allows me to do exactly what I want without forcing me to do things 'the ProcessWire way' like other CMS' like WordPress do. But I have a few questions regarding the Image Resize Functions and how they relate to the performance at the front-end of the site. For example, I have a blog view page where I have a full width hero image at the top of the page and I am looking to utilise ProcessWire's Image Resize Functions along with PictureFill to server the appropriate image to the user depending on their screen size. Now, in some instances the image I am serving - to a desktop with a retina display for example - is massive, 3840px by 1100px. I am just wondering what would be the best way to go about this? Should I get the user (of the CMS) to upload an image of that size to the CMS and then let ProcessWire take care of all the other resizes? And if so, how long would that take to process before displaying the page? Currently I have the following in my template: <?php $mobile_2x = $page->blog_image->size(1464, 700); $mobile_1x = $page->blog_image->size(732, 350); $tablet_2x = $page->blog_image->size(2448, 640); $tablet_1x = $page->blog_image->size(1224, 320); $desktop_2x = $page->blog_image->size(3840, 1100); $desktop_1x = $page->blog_image->size(1920, 550); echo "<picture>"; echo "<!--[if IE 9]><video style=" . '"display: none;"' . "><![endif]-->"; echo "<source srcset='{$desktop_1x->httpUrl}, {$desktop_2x->httpUrl} 2x'" . ' media="' . '(min-width: 1240px)"' . ">"; echo "<source srcset='{$tablet_1x->httpUrl}, {$tablet_2x->httpUrl} 2x'" . ' media="' . '(min-width: 768px)"' . ">"; echo "<!--[if IE 9]></video><![endif]-->"; echo "<img srcset='{$mobile_1x->httpUrl}, {$mobile_2x->httpUrl} 2x'" . "alt='{$blog_post->blog_image->description}'>"; echo "</picture>"; ?> When I first loaded the page it took a long time to show, obviously this is not great for my users, or is it? Does it only take a long time to load once? I'm not sure how it all works... Any advice would be much appreciated. Thanks.
×
×
  • Create New...