Skip to content
This repository
Browse code

section blog layout with divs added

  • Loading branch information...
commit 98f47ce772ba90fd8c19f77f904e4b8a8210d877 1 parent d89ccab
authored November 23, 2011
110  html/com_content/section/blog.php
... ...
@@ -0,0 +1,110 @@
  1
+<?php // no direct access
  2
+defined('_JEXEC') or die('Restricted access');
  3
+$cparams =& JComponentHelper::getParams('com_media');
  4
+?>
  5
+<div class="inner-text">
  6
+<?php if ($this->params->get('show_page_title', 1)) : ?>
  7
+<div class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
  8
+	<?php echo $this->escape($this->params->get('page_title')); ?>
  9
+</div>
  10
+<?php endif; ?>
  11
+<div class="blog<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>" cellpadding="0" cellspacing="0">
  12
+<?php if ($this->params->def('show_description', 1) || $this->params->def('show_description_image', 1)) :?>
  13
+<div>
  14
+
  15
+	<?php if ($this->params->get('show_description_image') && $this->category->image) : ?>
  16
+		<img src="<?php echo $this->baseurl . '/' . $cparams->get('image_path') . '/'. $this->category->image;?>" align="<?php echo $this->category->image_position;?>" hspace="6" alt="" />
  17
+	<?php endif; ?>
  18
+	<?php if ($this->params->get('show_description') && $this->category->description) : ?>
  19
+		<?php echo $this->category->description; ?>
  20
+	<?php endif; ?>
  21
+
  22
+</div>
  23
+<?php endif; ?>
  24
+<?php if ($this->params->get('num_leading_articles')) : ?>
  25
+<div class="leading">
  26
+	
  27
+	<?php for ($i = $this->pagination->limitstart; $i < ($this->pagination->limitstart + $this->params->get('num_leading_articles')); $i++) : ?>
  28
+		<?php if ($i >= $this->total) : break; endif; ?>
  29
+		<div>
  30
+		<?php
  31
+			$this->item =& $this->getItem($i, $this->params);
  32
+			echo $this->loadTemplate('item');
  33
+		?>
  34
+		</div>
  35
+	<?php endfor; ?>
  36
+	
  37
+</div>
  38
+<?php else : $i = $this->pagination->limitstart; endif; ?>
  39
+<?php
  40
+$startIntroArticles = $this->pagination->limitstart + $this->params->get('num_leading_articles');
  41
+$numIntroArticles = $startIntroArticles + $this->params->get('num_intro_articles');
  42
+if (($numIntroArticles != $startIntroArticles) && ($i < $this->total)) : ?>
  43
+<div class="intro" >
  44
+
  45
+		<?php
  46
+			$divider = '';
  47
+			if ($this->params->def('multi_column_order', 0)) : // order across, like front page
  48
+				for ($z = 0; $z < $this->params->def('num_columns', 2); $z ++) :
  49
+					if ($z > 0) : $divider = " column_separator"; endif; ?>
  50
+					<?php
  51
+					$rows = (int) ($this->params->get('num_intro_articles', 4) / $this->params->get('num_columns'));
  52
+					$cols = ($this->params->get('num_intro_articles', 4) % $this->params->get('num_columns'));
  53
+					?>
  54
+					<div 						style="width:<?php echo intval(100 / $this->params->get('num_columns')) ?>%"
  55
+						class="article_column<?php echo $divider ?>">
  56
+						<?php
  57
+						$loop = (($z < $cols)?1:0) + $rows;
  58
+
  59
+						for ($y = 0; $y < $loop; $y ++) :
  60
+							$target = $i + ($y * $this->params->get('num_columns')) + $z;
  61
+							if ($target < $this->total && $target < ($numIntroArticles)) :
  62
+								$this->item =& $this->getItem($target, $this->params);
  63
+								echo $this->loadTemplate('item');
  64
+							endif;
  65
+						endfor;
  66
+						?></div>
  67
+				<?php endfor; 
  68
+						$i = $i + $this->params->get('num_intro_articles') ; 
  69
+			else : // otherwise, order down, same as before (default behaviour)
  70
+				for ($z = 0; $z < $this->params->get('num_columns'); $z ++) :
  71
+					if ($z > 0) : $divider = " column_separator"; endif; ?>
  72
+					<div valign="top" width="<?php echo intval(100 / $this->params->get('num_columns')) ?>%" class="article_column<?php echo $divider ?>">
  73
+					<?php for ($y = ($z<($this->total % $this->params->get('num_columns')))? -1:0; $y < intval($this->total / $this->params->get('num_columns')); $y ++) :
  74
+						if ($i < $this->total && $i < ($numIntroArticles)) :
  75
+							$this->item =& $this->getItem($i, $this->params);
  76
+							echo $this->loadTemplate('item');
  77
+							$i ++;
  78
+						endif;
  79
+					endfor;?>
  80
+					
  81
+					</div>
  82
+				<?php endfor;
  83
+ 
  84
+		endif; ?> 
  85
+
  86
+</div>
  87
+<?php endif; ?>
  88
+<?php if ($this->params->get('num_links') && ($i < $this->total)) : ?>
  89
+<div >
  90
+		<div class="blog_more<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
  91
+			<?php
  92
+				$this->links = array_splice($this->items, $i - $this->pagination->limitstart);
  93
+				echo $this->loadTemplate('links');
  94
+			?>
  95
+		</div>
  96
+</div>
  97
+<?php endif; ?>
  98
+<?php if ($this->params->get('show_pagination')) : ?>
  99
+<div class="pagination">
  100
+		<?php echo $this->pagination->getPagesLinks(); ?>
  101
+</div>
  102
+<?php endif; ?>
  103
+<?php if ($this->params->get('show_pagination_results')) : ?>
  104
+<div>
  105
+		<?php echo $this->pagination->getPagesCounter(); ?>
  106
+
  107
+</div>
  108
+<?php endif; ?>
  109
+</div>
  110
+</div>
49  html/com_content/section/blog_item.php
@@ -6,10 +6,10 @@
6 6
 		<?php echo JHTML::_('icon.edit', $this->item, $this->item->params, $this->access); ?>
7 7
 	</div>
8 8
 <?php endif; ?>
9  
-<div class="contentpaneopen<?php echo $this->item->params->get( 'pageclass_sfx' ); ?>">
  9
+<div class="article">
10 10
 
11 11
 <?php if ($this->item->params->get('show_title')) : ?>
12  
-<h2 class="contentheading<?php echo $this->item->params->get( 'pageclass_sfx' ); ?>">
  12
+<h1 class="contentheading<?php echo $this->item->params->get( 'pageclass_sfx' ); ?>">
13 13
 	<?php if ($this->item->params->get('link_titles') && $this->item->readmore_link != '') : ?>
14 14
 	<a href="<?php echo $this->item->readmore_link; ?>" class="contentpagetitle<?php echo $this->item->params->get( 'pageclass_sfx' ); ?>">
15 15
 		<?php echo $this->escape($this->item->title); ?>
@@ -17,13 +17,29 @@
17 17
 	<?php else : ?>
18 18
 		<?php echo $this->escape($this->item->title); ?>
19 19
 	<?php endif; ?>
20  
-</h2>
  20
+</h1>
21 21
 <?php endif; ?>
22 22
 
23 23
 <?php  if (!$this->item->params->get('show_intro')) :
24 24
 	echo $this->item->event->afterDisplayTitle;
25 25
 endif; ?>
26 26
 
  27
+<div class="article-content">
  28
+<?php if (isset ($this->item->toc)) : ?>
  29
+	<?php echo $this->item->toc; ?>
  30
+<?php endif; ?>
  31
+<?php echo $this->item->text; ?>
  32
+<?php if ($this->item->params->get('show_readmore') && $this->item->readmore) : ?>
  33
+	<a href="<?php echo $this->item->readmore_link; ?>" title="<?php echo $this->item->title; ?>" class="readon">
  34
+			<?php if ($this->item->readmore_register) : ?>
  35
+				<?php echo JText::_('Register to read more...'); ?>
  36
+			<?php else : ?>
  37
+				<?php echo JText::_($this->item->params->get('readmore','Read more...')); ?>
  38
+			<?php endif; ?>
  39
+	</a>
  40
+<?php endif; ?>
  41
+</div>
  42
+
27 43
 <?php
28 44
 if (
29 45
 ($this->item->params->get('show_create_date'))
@@ -38,7 +54,7 @@
38 54
 
39 55
 <?php if ($this->item->params->get('show_create_date')) : ?>
40 56
 	<span class="createdate">
41  
-		<?php echo JHTML::_('date', $this->item->created, JText::_('DATE_FORMAT_LC2')); ?>
  57
+		<?php echo JHTML::_('date', $this->item->created, JText::_('DATE_FORMAT_LC1')); ?>
42 58
 	</span>
43 59
 <?php endif; ?>
44 60
 
@@ -58,7 +74,7 @@
58 74
 		<?php if ($this->item->params->get('link_section')) : ?>
59 75
 			<?php echo '</a>'; ?>
60 76
 		<?php endif; ?>
61  
-			<?php if ($this->item->params->get('show_category')) : ?>
  77
+		<?php if ($this->item->params->get('show_category')) : ?>
62 78
 			<?php echo ' - '; ?>
63 79
 		<?php endif; ?>
64 80
 	</span>
@@ -69,7 +85,7 @@
69 85
 			<?php echo '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catslug, $this->item->sectionid)).'">'; ?>
70 86
 		<?php endif; ?>
71 87
 		<?php echo $this->item->category; ?>
72  
-		<?php if ($this->item->params->get('link_section')) : ?>
  88
+		<?php if ($this->item->params->get('link_category')) : ?>
73 89
 			<?php echo '</a>'; ?>
74 90
 		<?php endif; ?>
75 91
 	</span>
@@ -102,7 +118,8 @@
102 118
 <?php if ($this->item->params->get('show_url') && $this->item->urls) : ?>
103 119
 	<span class="article-url">
104 120
 		<a href="http://<?php echo $this->item->urls ; ?>" target="_blank">
105  
-			<?php echo $this->item->urls; ?></a>
  121
+			<?php echo $this->item->urls; ?>
  122
+		</a>
106 123
 	</span>
107 124
 <?php endif; ?>
108 125
 </div>
@@ -110,12 +127,7 @@
110 127
 
111 128
 <?php echo $this->item->event->beforeDisplayContent; ?>
112 129
 
113  
-<div class="article-content">
114  
-<?php if (isset ($this->item->toc)) : ?>
115  
-	<?php echo $this->item->toc; ?>
116  
-<?php endif; ?>
117  
-<?php echo $this->item->text; ?>
118  
-</div>
  130
+
119 131
 
120 132
 <?php if ( intval($this->item->modified) != 0 && $this->item->params->get('show_modify_date')) : ?>
121 133
 	<span class="modifydate">
@@ -123,17 +135,10 @@
123 135
 	</span>
124 136
 <?php endif; ?>
125 137
 
126  
-<?php if ($this->item->params->get('show_readmore') && $this->item->readmore) : ?>
127  
-	<a href="<?php echo $this->item->readmore_link; ?>" title="<?php echo $this->item->title; ?>" class="readon<?php echo $this->item->params->get('pageclass_sfx'); ?>">
128  
-			<?php if ($this->item->readmore_register) : ?>
129  
-				<?php echo JText::_('Register to read more...'); ?>
130  
-			<?php else : ?>
131  
-				<?php echo JText::_('Read more...'); ?>
132  
-			<?php endif; ?>
133  
-	</a>
134  
-<?php endif; ?>
  138
+
135 139
 
136 140
 </div>
137 141
 
138 142
 <span class="article_separator">&nbsp;</span>
139 143
 <?php echo $this->item->event->afterDisplayContent; ?>
  144
+

0 notes on commit 98f47ce

Please sign in to comment.
Something went wrong with that request. Please try again.