Created
June 25, 2012 22:40
-
-
Save DevJohnC/2991902 to your computer and use it in GitHub Desktop.
How templates should probably work
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title>Home :: <? Theme::store_name() ?></title> | |
| </head> | |
| <body> | |
| <h1><? Theme::store_name() ?></h1> | |
| <h2>Home</h2> | |
| <p>Welcome to the store!</p> | |
| <? // here specials are products flagged as on sale or something in the admin and the loop is provided by the system | |
| if (Theme::hasProducts('specials')): while (Theme::hasProducts('specials')): Theme::theProduct(); ?> | |
| echo '<h3>Specials</h3>'; | |
| <h4><a href="<? Theme::theUrl(); ?>"><? Theme::theName(); ?></a></h4> | |
| <div><? Theme::productImage('thumbnail'); ?> </div> | |
| <p><? Theme::productPrice(); ?> </p> | |
| <button><? Theme::cartButton('buy-now' , 'learn-more'); ?> | |
| <? endwhile; endif; ?> | |
| <? // but here I want to look at something unique to this theme, maybe a highlighted category or w/e | |
| Theme::productQuery('hats', 'category=hats'); | |
| if (Theme::hasProducts('hats')): while (Theme::hasProducts('hats')): Theme::theProduct(); ?> | |
| echo '<h3>Hats are cool</h3>'; | |
| <h4><a href="<? Theme::theUrl(); ?>"><? Theme::theName(); ?></a></h4> | |
| <div><? Theme::productImage('thumbnail'); ?> </div> | |
| <p><? Theme::productPrice(); ?> </p> | |
| <button><? Theme::cartButton('buy-now' , 'learn-more'); ?> | |
| <? endwhile; endif; ?> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment