PDA

Zobacz pełną wersję : Sobi 2 i style V-CARD Template.



yimusse
28-01-2014, 17:10
Witam,

Zmodyfikowałem trochę szablon V-CARD aby w widoku przed tytułem wpisu wyświetlała się nazwa kategorii i podkategorii w stylu linków.

Kod wygląda tak:


<?php
/**
* @version $Id: sobi2.vc.tmpl.php 5462 2010-08-18 08:25:37Z Sigrid Suski $
* @package: Sigsiu Online Business Index 2 (Sobi2)
* ================================================== =
* @author
* Name: Sigrid & Radek Suski, Sigsiu.NET GmbH
* Email: sobi[at]sigsiu.net
* Url: http://www.sigsiu.net
* ================================================== =
* @copyright Copyright (C) 2006 - 2010 Sigsiu.NET GmbH (http://www.sigsiu.net). All rights reserved.
* @license see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU/GPL.
* You can use, redistribute this file and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation.
*/

/* Please do not remove this line */
defined( '_SOBI2_' ) || exit("Restricted access");

/* ------------------------------------------------------------------------------
* This is the template for the V-Card View
* ------------------------------------------------------------------------------
*/
/* Don't remove this line! */
function sobi2VCview($id, $style, $ico, $img, $title, $fieldsObjects, $fieldsFormatted, $plugins, $editButton = null, $deleteButton = null)
{
// For advanced templating comment in the next line if you need to access other sobi2 object proporties
$mySobi = new sobi2( $id );
// $config =& sobi2Config::getInstance();
// $waySearchLink = HTML_SOBI::createWaySearchUrl( $id );
?>
<!-- here starts the template -->

<td <?php echo $style; ?>>
<?php
$config =& sobi2Config::getInstance();
$catSep = "<br/>";
$pathSep = " - ";
$mySobiCategories = array_flip( $mySobi->myCategories );
foreach ( $mySobiCategories as $cid ) {
$cats = array();
$config->getParentCats( $cid, $cats );
if( is_array( $cats) && !empty( $cats ) ) {
$catParts = array();
foreach ( $cats as $catid ) {
$category = new sobi2Category( $catid );
$url = sobi2Config::sef( "index.php?option=com_sobi2&amp;catid={$category->catid}&amp;Itemid={$config->sobi2Itemid}" );
$catParts[] = "<a href=\"{$url}\" title=\"{$category->name}\">{$category->name}</a>";
}
$catParts = array_reverse( $catParts );
echo implode( $pathSep, $catParts );
}
echo $catSep;
}
?>
<?php echo $editButton; ?>
<?php echo $deleteButton; ?>
<?php echo $ico; ?>
<?php echo $img; ?>

<?php echo $title; ?>
<?php echo HTML_SOBI::customFieldsData($fieldsFormatted);?>

<!-- here ends the template -->

<!-- Don't remove these lines! -->
</td><?php
}
?>


Jednak mam teraz taki problem. Nie mogę oarnąc jaką komendę mam wstawić w pliku CSS aby wystylizować te tytuły kategori i podkateggorii. Odnalazłem w pliku css odpowiednie miejsce do edycji styli V-CARD ale za chiny ludowe nie mam pojęcia jaki parametr podać aby móc użyc do nieo odpowiednich styli.

Tak wygląda fragment css do edycji styli V-CARD

/* Style for Entries in Category View (Cards View) */
/* -------------------------------------------------------- */
table.sobi2Listing {
width: 98%;
margin-bottom: 10px;
}

table.sobi2Listing td {
border-style: none;
border-color: #3a4794;
border-width: 2px;
margin-top: 0px;
vertical-align: top;
}

/* Style for empty Cards (Placeholder) */
table.sobi2Listing td.sobi2EmptyCell {
border-style: none;
background-color: #ffffff;
}
table.sobi2Listing input {
float:left;
}

/* Style of Icon (Small Image) */
.sobi2Listing img {
float: right;
border-style: none;
padding-top: 5px;
padding-right: 5px;
}

/* Style of Title (Name of Entry) */
p.sobi2ItemTitle {
margin-left: 5px;
margin-top: 5px;
padding-left: 5px;
padding-top: 5px;
clear:left;
font-weight: bold;
}
p.sobi2ItemTitle a {
font-size: 13px;
}

}

}


Pozdrawiam.

thc
03-02-2014, 13:51
A korzystasz z dodatku Firebug dla Firefoxa? Dzięki niemu w łatwy sposób można rozwiązać większość spraw związanych ze stylami css, myślę że i w tym przypadku mógł by pomóc