Jump to content

Peter Knight

Members
  • Posts

    1,419
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by Peter Knight

  1. Agree. I'm coming from that CMS and I really like the ability to not have to rely on includes so much.
  2. Thanks Soma. Happy days @mr-fan Re. RTFM you're right. I need to familiarise myself with selectors more and how to use them. hazards of choosing a new CMS on a tight deadline.
  3. Can it be done with Soma's SimpleMarkupNavigation? It seems to have more control over setting the options but I can only seem to work it by starting at the root and not the parent <?php $treeMenu = $modules->get("MarkupSimpleNavigation"); // load the module $options = array( 'parent_class' => 'parent', 'current_class' => 'current', 'has_children_class' => 'has_children', 'levels' => true, 'levels_prefix' => 'level-', 'max_levels' => 1, 'firstlast' => false, 'collapsed' => true, 'show_root' => true, 'selector' => '', 'selector_field' => 'nav_selector', 'outer_tpl' => '<ul>||</ul>', 'inner_tpl' => '<ul>||</ul>', 'list_tpl' => '<li%s>||</li>', 'list_field_class' => '', 'item_tpl' => '<a href="{url}">{title}</a>', 'item_current_tpl' => '<a href="{url}">{title}</a>', 'xtemplates' => '', 'xitem_tpl' => '<a href="{url}">{title}</a>', 'xitem_current_tpl' => '<span>{title}</span>', 'date_format' => 'Y/m/d', 'code_formatting' => false, 'debug' => false ); echo $treeMenu->render($options); // render default menu ?>
  4. In MODX there's a snippet call Ultimate Parent. I use it for building sub-menus on the left navigation of my pages. IE Whereas my top nav would list all level 1 pages, UltimateParent would only list sub-pages of the current Page. Is there a PW module for this or would it be simply a case of using some PHP with the API?
  5. That would normally be my own setup. In this instance, it doesn't work. Well, it works for the homepage but any sub-pages dont work. I suspect my issue is one to do with my shared hosting environment Because the domain name has yet to be setup, I am working on on a "domain reference" where my hosting company names a folder on a server after the name of my site IE I have my rewrite based set to RewriteBase /mysite.com/ But my working homepage (until domain is working) is http://217.199.187.73/mysite.com/
  6. I'm having some problems with css, include and image paths and wondered what the advice was for the location of following assets (folder in root) - scripts - images - css Currently I have it in the root but perhaps it should be located in the default site/assets/ directory which comes with PW? Reason I ask is because I have a templates folder with a homepage and basic-page template located at site/templates. Both files are located in exactly the same level but both require different paths for the CSS Homepage only works with <link rel="stylesheet" href="assets/scripts/foundation/css/normalize.css"> <link rel="stylesheet" href="assets/scripts/foundation/css/foundation.css"> <link rel="stylesheet" href="assets/scripts/foundation/css/foundation-custom.css"> <link rel="stylesheet" href="assets/css/styles.css"> Basic page only works if I add "../" before above <link rel="stylesheet" href="../assets/scripts/foundation/css/normalize.css"> <link rel="stylesheet" href="../assets/scripts/foundation/css/foundation.css"> <link rel="stylesheet" href="../assets/scripts/foundation/css/foundation-custom.css"> <link rel="stylesheet" href="../assets/css/styles.css"> I should probably make the above into a single include but I'd rather solve this mystery first.
  7. Ooohhhh, what is fieldsettabs and where is the documentation?
  8. I was looking for a way to group fields within the admin today and came across this wiki entry which does just that http://wiki.processwire.com/index.php/Template_Tabs IE have fields nested under certain categories when editing a page such as General Content (heading/category) Summary (nested field) Body (nested field) Featured Content (heading/category) Homepage images (nested field) Homepage summary (nested field) I was wondering if there were plans to make this a little more straightforward and perhaps use Categories or Tags. We already use Tags to group fields on the main fields (admin >setup >fields) and could this be extended slightly?
  9. Thanks for keeping this open. Just had same question and found this thread
  10. Horst - finally got this to work. Updated the original thread here https://processwire.com/talk/topic/7270-3-cols-of-featured-content-best-practice/
  11. Hey uprightbass360 I was literally about to post an update when your latest post apepared. After days of getting nowhere and a looming deadline, I wondered if perhaps my issues were a result of a local environment so I reinstalled PW on my www hosting, setup all the same fields, templates, pages etc (zzzz) and the same code worked beautifully. The only changes I actually made were to set a max of 1 image on the image field. I think there was something locally preventing me from using CropImage properly on my local install. I can tell now because when I crop an image on my remote site, the image in the "featured_image" field reflects the cropped image. On my local install, the image was allegdely cropped but always displayed the fullsize image with the image field. Whew! Anyway, I'm finally moving forward again and building my clients site. Thanks everyone for the help.
  12. Any screen grabs?
  13. Cheers Horst. I'll get a chance to try again tomorrow. Appreciate the help.
  14. Hi Horst My field called Featured_Image is an image field as link below. It has field type seto to CropImage http://modules.processwire.com/modules/fieldtype-crop-image/ Currently it just has a single image within it,
  15. Can someone sanity check this for me? I have a field called "Featured_Image" and a crop setting called "thumbnail". To outout this thumbnail image, I am trying the following code: <img src={$featured->Featured_Image->first()->getThumb('thumbnail')} /> Currently it's throwing an error and I'm not sure if it means either My module isn't installed properly I'm calling the image incorrectly etc Error: Call to a member function getThumb() on a non-object (line 9 of /Users/mymac/Sites/SiteDev/site/templates/includes/get-featured.inc)
  16. I am getting an eror of: I think everything is set up correctly. I created an image field with the appropriate "CoprImage" type assigned it to the 3 pages I am calling content from setup a crop called "featuredimage" and set the settings to thumbnail,100,100 featuredimage,330,158 cropped the images manually via the popup crop interface and hit save So based on my pervious working code which displays fullsize images, this <div class="layer layer-is-featured"> <div class="row"> <?php foreach ($pages->get(1)->Featured_Content->find('limit=3') as $featured){echo " <div class='small-12 medium-4 columns'> <img src={$featured->images->first()->url} /> <h3 class='feature-heading'>{$featured->title}</h3> {$featured->summary} <div class='divider'></div> <a href='#'>Read more</a> </div> ";} ?> </div> </div> should change to this <div class="layer layer-is-featured"> <div class="row"> <?php foreach ($pages->get(1)->Featured_Content->find('limit=3') as $featured){echo " <div class='small-12 medium-4 columns'> <img src={$featured->images->first()->getThumb('featuredimage')} /> <h3 class='feature-heading'>{$featured->title}</h3> {$featured->summary} <div class='divider'></div> <a href='#'>Read more</a> </div> ";} ?> </div> </div> What does this actually mean? Call to a member function getThumb() on a non-object
  17. Small typo on the Modules page. Should be You can change the settings for each field in the Setup->Fields->CropImageField Input tab:
  18. By "the thumbnail generator", you mean the module I linked to above by apesia? Looks very cool. Thanks for the recommendation.
  19. Wonderful. Thank you so much. I'll try this on Monday.
  20. Thanks Soma I hadn't seen your reply earlier. it doesn't work for me but once again, it's my lack of php skills here showing. I guess I'm used to tags and Wayfinder and MODX doing all the hardwork for me.
  21. Martijn Thankyou - I have downloaded the pedigree profile and am looking at the .inc Unfortunately, it's way beyond my level of PHP understanding. Although I have a sense of what it's doing, I couldn't confidently tweak it to my own requirements. Mainly I'd like to combine this <div class="row"> <ul class='topnav'> <?php foreach ($pages->get(1)->Top_Navigation->find() as $topnav){echo " <li><a href='{$topnav->url}'>{$topnav->title}</li> "; } ?> </ul> </div> with MarkupSimpleNavigation but I cam not sure how to pass $topnav array to MarkupSimpleNavigation or vice versa.
  22. I guess what I meant was slightly different? I made a simple top navigation bar on my site. It's a global navigation bar beside the logo. But I'm restricting the pages that appear here to 6 or 7 pages which my client chooses via the page fieldtype (called "Top_Navigation". <div class="row"> <ul class='topnav'> <?php foreach ($pages->get(1)->Top_Navigation->find() as $topnav){echo " <li><a href='{$topnav->url}'>{$topnav->title}</li> "; } ?> </ul> </div> I was wondering how I could combine the above with <?php $treeMenu = $modules->get("MarkupSimpleNavigation"); // load the module echo $treeMenu->render(); // render default menu ?> allowing me to inject some classes into my list etc and specify active classes etc etc.
  23. I presume this navigation module can be combined with the page fieldtype? https://processwire.com/videos/page-fieldtype/ IE My client could pick and choose a bunch of pages they want to appear in a top navigation bar?
  24. I have this working now with the three columns I want . I basically select the three pages from a page field on the homepage called "Featured_Content". Each of those pages has a title, image and summary. <div class="layer layer-is-featured"> <div class="row"> <?php foreach ($pages->get(1)->Featured_Content->find('limit=3') as $featured){echo " <div class='small-12 medium-4 columns'> <img src={$featured->images->first()->url} /> <h3 class='feature-heading'>{$featured->title}</h3> {$featured->summary} <a href='#'>Read more</a> </div> ";} ?> </div> </div> I'm wondering what the best way to crop each featured image to a specified dimension would be. If I ask my client to ensure each image is 330 x 158, she's going to mess this up. This looks like it might be my solution (http://modules.processwire.com/modules/fieldtype-crop-image/) but I'd rather specify in the code that each image should be cropped to 330 / 158. I have read through the ProcessWire image API docs (http://processwire.com/api/fieldtypes/images/) but I'm not sure how to combine this with my code above. foreach($page->images as $image) { $large = $image->width(500); $thumb = $image->size(100, 100); echo "<a href='$large->url'><img src='$thumb->url'></a>"; }
  25. Hi uprightbass360 That would be very helpful. I've no plans to allow any more than 3 but would be very interested to see some example code. I presume it uses PHP if/else statements ?
×
×
  • Create New...