Jump to content

Search the Community

Showing results for tags 'checkbox if else'.

  • 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 everyone I have a problem to solve here and I can't get it to work. Kinda new to php and processwire. This is what I want to do: It's some kind of shop. Article with fields (Title, image, description, price and article_reserved checkbox). I need a foreach line and an if else statement in it. This is the foreach line: <?php foreach ($pages->get('/shop/')->children() as $article): ?> <table class="col-xs-5 col-sm-5 col-md-3 col-lg-3"> <tr> <th class="item"><?php echo $article->title;?></th> </tr> <tr> <td class="item"><a href=""><img class="article-image" src="<?php echo $article->article_image->url; ?>"></a></td> <td class="item"><?php echo $article->article_description; ?></td> <td class="item">Size: <?php echo $article->article_size; ?></td> <td class="item">Price CHF: <?php echo $article->article_price; ?></td> <td class="button"><button type="button" class="btn btn-primary btn-sm">Order</button></td> </table> <?php endforeach; ?> When the article is checked as "reserved" (field: article_reserved), then there should be a class .reserved added to the image tag. if not, then not. Any ideas? Thanks.
×
×
  • Create New...