Jump to content

Search the Community

Showing results for tags 'echo count'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 1 result

  1. Hi guys Managed to get a complex (to me anyway) image count and if/else echo going. <?php // if Background_Image contains more than 1 echo those images in a slideshow if($page->Background_Image->count > 1 ){ $bgimage = $page->Background_Image; foreach ($bgimage as $image) { echo" <script> $.backstretch('$image->url'); </script> ";} } else // otherwise echo a single image on its own if($page->Background_Image->count == 1 ){ $bgimage = $page->Background_Image; foreach ($bgimage as $image) { echo" <script> $.backstretch(['$image->url',], {duration: 3000, fade: 750}); </script> ";} } ?> I'm not sure how to handle the last part of the echo though. The Script I'm using says that an image slideshow should be outputted in following format $.backstretch([ "http://dl.dropbox.com/u/515046/www/outside.jpg" , "http://dl.dropbox.com/u/515046/www/garfield-interior.jpg" , "http://dl.dropbox.com/u/515046/www/cheers.jpg" ], {duration: 3000, fade: 750}); IE each image needs a comma but the last image should have no comma then a square bracket and then the remainder. With my code, I'm currently getting three separate <script> $.backstretch('/site/assets/files/1/016---dc3420.jpg'); </script> <script> $.backstretch('/site/assets/files/1/021---dc3420.jpg'); </script> <script> $.backstretch('/site/assets/files/1/photo-bathroom.jpeg'); </script> instead of the desired structure
×
×
  • Create New...