--=REKLAMA=--

Newsfeed

Z Joomla!WikiPL

Opisywany element Selektor ID Selektor klasy Przyrostek
ul, div newsfeed moduleclass_sfx
Szablony dla: Joomla 1.0, Joomla 1.5
Zastosowany w: modules/mod_feed/tmpl/default.php
Stylizuje: listę, skrót wiadomości (nagłówek, opis)
.newsfeed {}

Przeznaczenie

Formatuje

Wykorzystany

W pliku: modules/mod_feed/tmpl/default.php

Kod PHP

<ul class="newsfeed<?php echo $params->get( 'moduleclass_sfx'); ?>"  >
<?php
$words = $params->def('word_count', 0);
for ($j = 0; $j < $totalItems; $j ++)
{
$currItem = & $feed->items[$j];
// item title
?>
   <li>
  <?php
  if ( !is_null( $currItem->get_link() ) ) {
  ?>
  <a href="<?php echo $currItem->get_link(); ?>" target="_child">
  <?php echo $currItem->get_title(); ?></a>
  <?php
  }
 
  // item description
  if ($params->get('rssitemdesc', 1))
  {
  // item description
  $text = $currItem->get_description();
  $text = str_replace('&apos;', "'", $text);
 
  // word limit check
  if ($words)
  {
  $texts = explode(' ', $text);
  $count = count($texts);
  if ($count > $words)
  {
  $text = '';
  for ($i = 0; $i < $words; $i ++) {
  $text .= ' '.$texts[$i];
  }
  $text .= '...';
  }
  }
  ?>
  <div class="newsfeed_item<?php echo $params->get( 'moduleclass_sfx'); ?>"  >
     <?php echo $text; ?>
  </div>
  <?php
  }
  ?>
  </li>
  <?php
  }
  ?>
</ul>

Kod HTML

 

Przykładowy kod CSS

 

Wynik

Dziękujemy za wkład

» Stefan Wajda [zwiastun],