pedig nem olyan nehéz. "Node
pedig nem olyan nehéz.
"Node ID from URL" - kell választani és annyi kb.
$view = new view; $view->name = 'gyerekek'; $view->description = ''; $view->tag = ''; $view->view_php = ''; $view->base_table = 'node'; $view->is_cacheable = FALSE; $view->api_version = 2; $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */ $handler = $view->new_display('default', 'Defaults', 'default'); $handler->override_option('fields', array( 'title' => array( 'label' => 'Cím', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'target' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'empty' => '', 'hide_empty' => 0, 'empty_zero' => 0, 'link_to_node' => 1, 'exclude' => 0, 'id' => 'title', 'table' => 'node', 'field' => 'title', 'relationship' => 'none', ), )); $handler->override_option('arguments', array( 'field_szulo_nid' => array( 'default_action' => 'default', 'style_plugin' => 'default_summary', 'style_options' => array(), 'wildcard' => 'all', 'wildcard_substitution' => 'Minden', 'title' => '', 'breadcrumb' => '', 'default_argument_type' => 'node', 'default_argument' => '', 'validate_type' => 'none', 'validate_fail' => 'not found', 'break_phrase' => 0, 'not' => 0, 'id' => 'field_szulo_nid', 'table' => 'node_data_field_szulo', 'field' => 'field_szulo_nid', 'validate_user_argument_type' => 'uid', 'validate_user_roles' => array( '2' => 0, ), 'relationship' => 'none', 'default_options_div_prefix' => '', 'default_argument_user' => 0, 'default_argument_fixed' => '', 'default_argument_php' => '', 'validate_argument_node_type' => array( 'delicious_feed' => 0, 'delicious_item' => 0, 'page' => 0, 'story' => 0, ), 'validate_argument_node_access' => 0, 'validate_argument_nid_type' => 'nid', 'validate_argument_vocabulary' => array(), 'validate_argument_type' => 'tid', 'validate_argument_transform' => 0, 'validate_user_restrict_roles' => 0, 'validate_argument_php' => '', ), )); $handler->override_option('access', array( 'type' => 'none', )); $handler->override_option('cache', array( 'type' => 'none', )); $handler = $view->new_display('block', 'Blokk', 'block_1'); $handler->override_option('block_description', ''); $handler->override_option('block_caching', -1);
és a tartalom típus
$content['type'] = array ( 'name' => 'Írás', 'type' => 'story', 'description' => 'Az <em>írás</em> megjelenésre ugyan az <em>oldalhoz</em> hasonlít, ám célja olyan időszerű információk megjelenítése, amelyek informálják vagy bevonják a webhely látogatóit. Sajtóközlemények, webhely hírek, blogbejegyzésre hasonlító tartalmak közlésére ideális az <em>írás</em> típus. Alapértelmezésben az <em>írások</em> a honlapon lévő tartalmi listában is megjelennek, és lehetővé teszik hozzászólások beküldését.', 'title_label' => 'Cím', 'body_label' => 'Törzs', 'min_word_count' => '0', 'help' => '', 'node_options' => array ( 'status' => true, 'promote' => true, 'sticky' => false, 'revision' => false, ), 'language_content_type' => 0, 'old_type' => 'story', 'orig_type' => 'story', 'module' => 'node', 'custom' => '1', 'modified' => '1', 'locked' => '0', 'comment' => 2, 'comment_default_mode' => 4, 'comment_default_order' => 1, 'comment_default_per_page' => 50, 'comment_controls' => 3, 'comment_anonymous' => 0, 'comment_subject_field' => 1, 'comment_preview' => 1, 'comment_form_location' => 0, ); $content['fields'] = array ( 0 => array ( 'label' => 'szülő', 'field_name' => 'field_szulo', 'type' => 'nodereference', 'widget_type' => 'nodereference_autocomplete', 'change' => 'Alapadatok megváltoztatása', 'weight' => '31', 'autocomplete_match' => 'contains', 'size' => '60', 'description' => '', 'default_value' => array ( 0 => array ( 'nid' => NULL, '_error_element' => 'default_value_widget][field_szulo][0][nid][nid', ), ), 'default_value_php' => '', 'default_value_widget' => NULL, 'required' => 0, 'multiple' => '0', 'referenceable_types' => array ( 'story' => 'story', 'delicious_feed' => 0, 'delicious_item' => 0, 'page' => 0, ), 'advanced_view' => '--', 'advanced_view_args' => '', 'op' => 'Mező beállításainak mentése', 'module' => 'nodereference', 'widget_module' => 'nodereference', 'columns' => array ( 'nid' => array ( 'type' => 'int', 'unsigned' => true, 'not null' => false, 'index' => true, ), ), 'display_settings' => array ( 'label' => array ( 'format' => 'above', 'exclude' => 0, ), 'teaser' => array ( 'format' => 'default', 'exclude' => 0, ), 'full' => array ( 'format' => 'default', 'exclude' => 0, ), 4 => array ( 'format' => 'default', 'exclude' => 0, ), ), ), ); $content['extra'] = array ( 'title' => '-5', 'body_field' => '0', 'revision_information' => '20', 'comment_settings' => '30', 'menu' => '-2', );
Palócz István
https://palocz.hu | https://tanarurkerem.hu
- A hozzászóláshoz regisztráció és bejelentkezés szükséges
A nagyobb betü
A nagyobb betü megoldása a style.css ben a következő:
.breadcrumb { margin-top: 10px; margin-bottom: 20px; font-size: 1.8em; }
A breadcrumb áthelyezése pedig a page.tpl.php -ben
De inkább bemásolom az egészet egy-kis rendrakás után mert az eredetiben nem nagyon lehet kiigazodni :(
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language; ?>"> <head> <title><?php print $head_title ?></title> <meta http-equiv="Content-Style-Type" content="text/css" /> <?php print $head ?> <?php print $styles ?> <?php print $scripts ?> </head> <body> <div id="container"> <div id="main"> <div id="content"><?php if ($mission): ?> <div id="mission"> <div id="missioncontent"><?php print($mission) ?> </div> </div> <?php endif; ?> <em><?php if ($breadcrumb): print $breadcrumb; endif; ?></em> <?php if ($tabs): print '<div id="tabs-wrapper" class="clear-block">'; endif; ?> <?php if ($title): print '<h2'. ($tabs ? ' class="with-tabs"' : '') .'>'. $title .'</h2>'; endif; ?> <?php if ($tabs): print $tabs .'</div>'; endif; ?> <?php if (isset($tabs2)): print $tabs2; endif; ?> <?php if ($help): print $help; endif; ?> <?php if ($messages): print $messages; endif; ?> <?php if ($above_content): print $above_content; endif; ?> <?php print($content) ?> </div> <?php if ($sidebar_top or $sidebar_left or $sidebar_right or $search_box or isset($secondary_links)): ?> <div id="sidebar"><?php if ($sidebar_top): ?> <div id="bothcols"> <div id="bothcolscontent"> <?php print $sidebar_top; ?> </div> </div><?php endif; ?> <?php if ($sidebar_left): ?> <div id="leftcol"> <?php if (isset($secondary_links)) : ?> <?php print theme('links', $secondary_links, array('class' => 'links secondary-links')) ?> <?php endif; ?> <?php print $sidebar_left; ?> </div><?php endif; ?> <?php if ($sidebar_right or $search_box): ?> <div id="rightcol"> <?php if ($search_box): ?> <div class="block block-theme"> <?php print $search_box ?> </div><?php endif; ?> <?php print $sidebar_right; ?> </div> <?php endif; ?> </div> <?php endif; ?> </div> <div id="header"> <?php if ($site_name): ?><h1 class='site-name'><?php print $site_name ?></h1><?php endif; ?> <?php if ($site_slogan): ?><h2 class="site-slogan"><?php print $site_slogan ?></h2><?php endif; ?> </div> <div id="nav"> <?php if (isset($primary_links)) : ?> <?php print theme('links', $primary_links, array('class' => 'links primary-links')) ?> <?php endif; ?> </div> <div id="footer"> <?php if ($footer_message) : ?><?php print $footer_message;?><p>Designed by <a href="http://www.seoposition.com">SEO Position</a> and <a href="http://blamcast.net">Blamcast</a></p><?php endif; ?> </div> <div id="footershim"> </div> </div> <?php print $closure ?> </body> </html>
- A hozzászóláshoz regisztráció és bejelentkezés szükséges
Gondolkodtam rajta...
arra juttottam, hogy ha időzített módon jelenik meg a 3 videó, vagy a szerkesztő egyszerre küldi ki őket, akkor a 3 videó közé soha nem fog "bekeveredni" más tartalomtípusból, így leválogatni sem kell őket.
Emiatt elég időrendben rendezned a legfrissebb tartalmakat, és a 3 videó mindig együtt marad.
Ha kirakod egy mezőben a kategóriát (video), akkor valami ilyen lesz views a kimenete a napi 15 hírrel:
<div class="views-azonosito"> <div class="views-row">...</div> <div class="views-row">...</div> <div class="views-row">...video...</div> <div class="views-row">...video...</div> <div class="views-row">...video...</div> <div class="views-row">...</div> <div class="views-row">...</div> <div class="views-row">...video...</div> <div class="views-row">...video...</div> <div class="views-row">...video...</div> <div class="views-row">...</div> <div class="views-row">...</div> <div class="views-row">...video...</div> <div class="views-row">...video...</div> <div class="views-row">...video...</div> </div>
Tehát a videó tartalomtípusok egymás mellett lesznek, és tartalmazzák a video tag-et, a többi tartalomban viszont nem lesz video tag.
Ha egy ciklussal átpörgeted a sorokat, akkor a video tag-es sorok köré tudsz rakni egy wrapper div-et.
Ha ez sikerül, akkor kb. ilyen lesz a views kimenete:
<div class="views-azonosito"> <div class="views-row">...</div> <div class="views-row">...</div> <div class="video-wrapper"> <div class="views-row">...video...</div> <div class="views-row">...video...</div> <div class="views-row">...video...</div> </div> <div class="views-row">...</div> <div class="views-row">...</div> <div class="video-wrapper"> <div class="views-row">...video...</div> <div class="views-row">...video...</div> <div class="views-row">...video...</div> </div> <div class="views-row">...</div> <div class="views-row">...</div> <div class="video-wrapper"> <div class="views-row">...video...</div> <div class="views-row">...video...</div> <div class="views-row">...video...</div> </div> </div>
Ha ez megvan, akkor css-el szerintem már meg lehet oldalni azt a formázást amit szeretnél, mert a video-wrapper class alatt egyedileg tudod formázni és float-olni az elemeket.
--------------------------------
A legnehezebb rész tulajdonképpen az, hogy hogy rakd a wrapper div-et a video tag-es sorok köré.
http://api.drupal.org/api/views/theme!views-view-unformatted.tpl.php/7
Ha nem formázott listát használsz a views-ban, akkor ebben ^^^ a template-nek a módosításával berakhatod a plusz div-eket. (views source-ra kattints rá)
<?php $previous_tag = ''; $current_tag = ''; foreach ($rows as $id => $row) { // Check if actual row has video tag? if (preg_match('/\/tag\/video/', $row) ) { $current_tag = 'video'; } else { $current_tag = ''; } // If row has video tag but previous not -> add open wrapper div if ($current_tag == 'video' && $previous_tag != 'video') { print '<div class="video-wrapper">'; } // Print row content. Copied from views template. ?><div <?php if ($classes_array[$id]) { print 'class="' . $classes_array[$id] .'"'; } ?>> <?php print $row; ?> </div><?php // If row's current tag not video but previous row's was video -> add close wrapper div if ($current_tag != 'video' && $previous_tag == 'video') { print '</div>'; } // Set $previous_tag for next iteration. $previous_tag = $current_tag; } // If in last iteration row's tag was video, then wrapper div must be closed. if ($current_tag == 'video') { print '</div>'; } ?>
Nem próbáltam a kódot, biztos kell rajta javítani, hogy menjen. De a logika látszik, remélem érthető.
Elegánsabb views-os megoldás persze jobb lenne, ha van.
- A hozzászóláshoz regisztráció és bejelentkezés szükséges
Ezek nálam jól működnek,
tedd be egy modulba és nézd meg, hogy nálad mit csinálnak.
/** * Implements hook_image_default_styles(). */ function mymodule_image_default_styles() { $styles = array(); // Exported image style: test_gallery_thumb. $styles['test_gallery_thumb'] = array( 'name' => 'test_gallery_thumb', 'label' => 'Gallery thumbnail (90x90)', 'effects' => array( 13 => array( 'label' => 'Aránytartó méretezés', 'help' => 'Arányos átméretezés esetén az eredeti kép oldalarányai megmaradnak. Ha csak a szélesség, vagy a magasság van megadva, akkor a másik automatikusan lesz kiszámolva.', 'effect callback' => 'image_scale_effect', 'dimensions callback' => 'image_scale_dimensions', 'form callback' => 'image_scale_form', 'summary theme' => 'image_scale_summary', 'module' => 'image', 'name' => 'image_scale', 'data' => array( 'width' => 90, 'height' => 90, 'upscale' => 0, ), 'weight' => 1, ), 14 => array( 'label' => 'Define canvas', 'help' => 'Define the size of the working canvas and background color, this controls the dimensions of the output image.', 'effect callback' => 'canvasactions_definecanvas_effect', 'dimensions callback' => 'canvasactions_definecanvas_dimensions', 'form callback' => 'canvasactions_definecanvas_form', 'summary theme' => 'canvasactions_definecanvas_summary', 'module' => 'imagecache_canvasactions', 'name' => 'canvasactions_definecanvas', 'data' => array( 'RGB' => array( 'HEX' => '', ), 'under' => 1, 'exact' => array( 'width' => 90, 'height' => 90, 'xpos' => 'center', 'ypos' => 'center', ), 'relative' => array( 'leftdiff' => '', 'rightdiff' => '', 'topdiff' => '', 'bottomdiff' => '', ), ), 'weight' => 2, ), ), ); // Exported image style: product_full. $styles['product_full'] = array( 'name' => 'product_full', 'label' => 'product_full', 'effects' => array( 8 => array( 'label' => 'Aránytartó méretezés', 'help' => 'Arányos átméretezés esetén az eredeti kép oldalarányai megmaradnak. Ha csak a szélesség, vagy a magasság van megadva, akkor a másik automatikusan lesz kiszámolva.', 'effect callback' => 'image_scale_effect', 'dimensions callback' => 'image_scale_dimensions', 'form callback' => 'image_scale_form', 'summary theme' => 'image_scale_summary', 'module' => 'image', 'name' => 'image_scale', 'data' => array( 'width' => 478, 'height' => 478, 'upscale' => 0, ), 'weight' => -10, ), 12 => array( 'label' => 'Define canvas', 'help' => 'Define the size of the working canvas and background color, this controls the dimensions of the output image.', 'effect callback' => 'canvasactions_definecanvas_effect', 'dimensions callback' => 'canvasactions_definecanvas_dimensions', 'form callback' => 'canvasactions_definecanvas_form', 'summary theme' => 'canvasactions_definecanvas_summary', 'module' => 'imagecache_canvasactions', 'name' => 'canvasactions_definecanvas', 'data' => array( 'RGB' => array( 'HEX' => '', ), 'under' => 1, 'exact' => array( 'width' => 478, 'height' => 478, 'xpos' => 'center', 'ypos' => 'center', ), 'relative' => array( 'leftdiff' => '', 'rightdiff' => '', 'topdiff' => '', 'bottomdiff' => '', ), ), 'weight' => -9, ), ), ); return $styles; }
Üdv!
Dudás József
- A hozzászóláshoz regisztráció és bejelentkezés szükséges

semmi...
A változók nem postolódnak el az a bibi csak azt nem tudom miért...
ugye van egy form ami:
<form id="h" name="h" method="POST" action="kuld.php" onSubmit="return FormCheck(this)">
atán a formon belül van:
<?php $datum = date("Y-m-d H:i:s"); global $user; $felh= $user->name; $wfeid= $user->wfe_id; $u_uid= $user->uid; $profil->uid = $user->uid; profile_load_profile($profil); $telj_nev= $profil->profile_nev; $telszam= $profil->profile_telszam; ?>
és egy ilyen:
<?php if ($wfeid==0){ $uz = pg_query("SELECT uz_nev, uz_id FROM uz, torzs WHERE to_rgaz_uz_id=uz_id"); while ($sor = pg_fetch_assoc ($uz)) { echo '<input name="uznev" id="uznev" readonly="readonly" value="'.$sor["uz_nev"].'">'; echo '<input name="uzid" id="uzid" type="hidden" value="'.$sor["uz_id"].'">'; } } else{ $uz2 = pg_query("SELECT uz_nev, uz_id, fe_nev, fe_id, uf_nev, uf_id FROM felh, uz, ugyf, web_user WHERE wfe_id=fe_id and fe_uf_id=uf_id and uf_uz_id=uz_id and wfe_id=$wfeid"); while ($sor = pg_fetch_assoc ($uz2)) { echo '<input id="uznev" name="uznev" readonly="readonly" value="'.$sor["uz_nev"].'">'; echo '<input id="uzid" name="uzid" type="hidden" value="'.$sor["uz_id"].'">'; echo '<input id="fenev" name="fenev" type="hidden" value="'.$sor["fe_nev"].'">'; echo '<input id="feid" name="feid" type="hidden" value="'.$sor["fe_id"].'">'; echo '<input id="ufnev" name="ufnev" type="hidden" value="'.$sor["uf_nev"].'">'; echo '<input id="ufid" name="ufid" type="hidden" value="'.$sor["uf_id"].'">'; } } ?>
ez szépen megy is vagyis bekerülnek a változó értékek de nem kerul át a kuld.php-nek
- A hozzászóláshoz regisztráció és bejelentkezés szükséges
Gondolom valami ilyenre vágysz...
Szia.
A template.php fájlba tedd bele az alábbi blokkot:
function phptemplate_username($object) { if ($object->uid && $object->name) { // Shorten the name when it is too long or it will break many tables. if (drupal_strlen($object->name) > 20) { $name = drupal_substr($object->name, 0, 15) .'...'; } else { $name = $object->name; } if (user_access('access user profiles')) { $output = l($name, 'user/'. $object->uid, array('title' => t('View user profile.'))); } else { $output = check_plain($name); } // Get user's status: $interval = time() - variable_get('user_block_seconds_online', 900); $onl_query = db_query('SELECT u.uid FROM {users} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.timestamp >= %d AND s.uid = %d ORDER BY s.timestamp DESC', $interval,$object->uid); $online = db_fetch_object($onl_query); if ($online) { $output .= " (online)"; } else { $output .= " (offline)"; } } else if ($object->name) { // Sometimes modules display content composed by people who are // not registered members of the site (e.g. mailing list or news // aggregator modules). This clause enables modules to display // the true author of the content. if ($object->homepage) { $output = l($object->name, $object->homepage); } else { $output = check_plain($object->name); } $output .= ' ('. t('not verified') .')'; } else { $output = variable_get('anonymous', t('Anonymous')); } return $output; }
A sminkelése legyen önnálló feladat...
Üdv: Zoli
- A hozzászóláshoz regisztráció és bejelentkezés szükséges
A smink template.php-jában
A smink template.php-jában van ez a függvény, ez állítja elő a margin-left számára az értéket a $user_image['width']-ből:
function marinelli_preprocess_comment(&$vars) { $vars['classes_array'][] = $vars['zebra']; // No.. I don't use style $user_image['width'] = $size[0]; } else{ //Yes... I use style if ($picture = file_load($vars['comment']->picture->fid)) { } } } $vars['image_width'] = $user_image['width'] + 25; }
Ezen a nyomon lehet elindulni, hogy miért marad nulla a $user_image['width'] értéke...
- A hozzászóláshoz regisztráció és bejelentkezés szükséges
Ha látnánk a view-t akkor
Ha látnánk a view-t akkor lehetne segíteni, de így nehéz, de talán sikerül.
A Contextual filtered biztos hülyeség, mert Te nem a felhasználót nézed, így az id-je biztos nem jöhet az url-ből.
Kell két reláció. Az első neve legyen "Szerző" ez a cikk szerzőjét tartalmaző felhasználót kapcsolja a tartalomhoz. Ezután kell egy "A szerző műve" nevű reláció, aminél használod a korábban létrehozott "Szerző" relációt.
Ezután kell két contextual filter, mindkettő a "Content nid from url" lesz, de az egyik használja a "A szerző művei" relációt és excludol, ezzel kizárjuk a listából az éppen nézett művet.
Végezetül a fieldeknél, a title mezőnél is használjuk az előbbi relációt.
Tesztelni úgy tudod, hogy a tartalom nid-jét kétszer beírod perjellel pl.: 3/3
(btw a tanarurkerem.hu-n a views kurzus többek között ezt is tartalmazza. :))
És emitt a view:
Palócz István
https://palocz.hu | https://tanarurkerem.hu