Advertisement:

Author Topic: Grid listing  (Read 8498 times)

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: Grid listing
« Reply #15 on: January 28, 2014, 07:01:49 pm »
one day hopefully :)

szteam

  • Newbie
  • *
  • Posts: 4
Re: Grid listing
« Reply #16 on: February 05, 2014, 12:28:42 am »
Replace this:
Code: [Select]
<div class="latest_ads">
                    <h1><strong><?php _e('Latest Listings''modern'); ?></strong></h1>
                    <?php if( osc_count_latest_items() == 0) { ?>
                        <p class="empty"><?php _e('No Latest Listings''modern'); ?></p>
                    <?php } else { ?>
                        <table border="0" cellspacing="0">
                             <tbody>
                                <?php $class "even"?>
                                <?php while ( osc_has_latest_items() ) { ?>
                                 <tr class="<?php echo $class. (osc_item_is_premium()?" premium":""); ?>">
                                        <?php if( osc_images_enabled_at_items() ) { ?>
                                         <td class="photo">
                                            <?php if( osc_count_item_resources() ) { ?>
                                                <a href="<?php echo osc_item_url(); ?>">
                                                    <img src="<?php echo osc_resource_thumbnail_url(); ?>" width="75" height="56" title="<?php echo osc_item_title(); ?>" alt="<?php echo osc_item_title(); ?>" />
                                                </a>
                                            <?php } else { ?>
                                                <img src="<?php echo osc_current_web_theme_url('images/no_photo.gif'); ?>" alt="" title="" />
                                            <?php ?>
                                         </td>
                                        <?php ?>
                                         <td class="text">
                                             <h3><a href="<?php echo osc_item_url(); ?>"><?php echo osc_item_title(); ?></a></h3>
                                             <p><strong><?php if( osc_price_enabled_at_items() && osc_item_category_price_enabled() ) { echo osc_item_formated_price(); ?> - <?php } echo osc_item_city(); ?> (<?php echo osc_item_region();?>) - <?php echo osc_format_date(osc_item_pub_date()); ?></strong></p>
                                             <p><?php echo osc_highlightstrip_tagsosc_item_description() ) ); ?></p>
                                         </td>
                                     </tr>
                                    <?php $class = ($class == 'even') ? 'odd' 'even'?>
                                <?php ?>
                            </tbody>
                        </table>
                        <?php if( osc_count_latest_items() == osc_max_latest_items() ) { ?>
                        <p class='pagination'><?php echo osc_search_pagination(); ?></p>
                            <p class="see_more_link"><a href="<?php echo osc_search_show_all_url();?>"><strong><?php _e("See all offers"'modern'); ?> &raquo;</strong></a></p>
                        <?php ?>
                    <?php View::newInstance()->_erase('items'); } ?>
                </div>

With this:
Code: [Select]
<div class="latest_ads">
                    <h1><strong><?php _e('Latest Listings''modern'); ?></strong></h1>
                    <?php if( osc_count_latest_items() == 0) { ?>
                        <p class="empty"><?php _e('No Latest Listings''modern'); ?></p>
                    <?php } else { ?>
                        <style type="text/css">
ul.grid_view{margin: 8px 0px 22px 0px;}
.grid_view li {display: inline; list-style: none; width: 160px; height: 210px; float: left; margin: 0px 4px 8px 4px; text-align: center; border: 1px solid #CCC; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2); -moz-box-shadow: 0 1px 2px rgba(0,0,0,.2); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.grid_view li h3{ margin: 5px; max-height: 20px; overflow: hidden; text-overflow: ellipsis; background: #EEE; }
.grid_view li h3 a{  text-decoration: none; text-transform: uppercase;}
.grid_view li p{ max-height: 60px; overflow: hidden; text-overflow: ellipsis;}
.grid_view img{ border: 1px solid #EEE;}
</style>
<ul class="grid_view">
<?php while ( osc_has_latest_items() ) { ?>
<?php if( osc_images_enabled_at_items() ) { ?>
<li><h3><a href="<?php echo osc_item_url();?>"><?php echo osc_item_title();?></a></h3><?php if( osc_count_item_resources() ) { ?>
<a href="<?php echo osc_item_url();?>"><img src="<?php echo osc_resource_thumbnail_url() ; ?>" width="140px" height="110px" title="" alt="" /></a>
<?php } else { ?>
<a href="<?php echo osc_item_url();?>"><img src="<?php echo osc_current_web_theme_url('images/no_photo.gif') ; ?>" width="140px" height="110px" alt="" title=""/></a>
<?php } } ?>
<br/><p><?php if (osc_price_enabled_at_items()) { echo osc_item_formated_price(); }?><br /><strong><?php if (osc_item_city() != '') {echo osc_item_city();}if (osc_item_region() != '') {echo '(' osc_item_region() . ')';}echo ' - ' osc_format_date(osc_item_pub_date());?> </strong></p></li>
<?php ?>
</ul>
                        <?php if( osc_count_latest_items() == osc_max_latest_items() ) { ?>
                        <p class='pagination'><?php echo osc_search_pagination(); ?></p>
                            <p class="see_more_link"><a href="<?php echo osc_search_show_all_url();?>"><strong><?php _e("See all offers"'modern'); ?> &raquo;</strong></a></p>
                        <?php ?>
                    <?php View::newInstance()->_erase('items'); } ?>
                </div>

Is should give you grid view for Latest listings in Modern theme

design

  • Hero Member
  • *****
  • Posts: 2619
  • Osclass 3.5 MAC/PC w/ Modern Browsers
Re: Grid listing
« Reply #17 on: February 05, 2014, 01:07:37 am »
inline styling-- ???

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: Grid listing
« Reply #18 on: February 05, 2014, 03:27:25 am »
Occasional inline styling is not actually that bad, it loads faster in page and sometimes it is quick & dirty solution to style a particular element, without affecting general rules. But yes, this could be easily just placed inside main theme's css.

Regards

design

  • Hero Member
  • *****
  • Posts: 2619
  • Osclass 3.5 MAC/PC w/ Modern Browsers
Re: Grid listing
« Reply #19 on: February 05, 2014, 06:38:16 pm »
@ whomever is reading this thread. Please please for the love of the coding gods, don't use inline as a permanent solution to style something. It is a pain in the ass to go in a clean that out when upgrading.   :(  :'(

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: Grid listing
« Reply #20 on: February 05, 2014, 07:08:01 pm »
Hi design,

just don't forget that any theme upgrades (unless you rename it) will end up in rewritting all php files, in which case inline css would be the least of your problem, since any customisations, such as this, will be lost anyway. Core updates are now separated from themes, and essentially user(s) have to know what they are doing.

Regards

design

  • Hero Member
  • *****
  • Posts: 2619
  • Osclass 3.5 MAC/PC w/ Modern Browsers
Re: Grid listing
« Reply #21 on: February 05, 2014, 07:12:02 pm »
no truer words have been spoken! that should be a sticky quote  ;D