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
egyszerű esetben ehhez nem kell feltétlen panels
vagy page manager. ha csak a profiloldalba akarsz rakni egy blokkot, a profil alá vagy mellé valamelyik oldalsávba, akkor egyszerűen csinálsz egy nézetet, ami egy blokkot jelenít meg. egy argumentumot használ, user: uid, provide default argument, user id from url.
hogy ne kelljen sokat gépelni, itt egy ilyen nézet. beimportálod, létre fog hozni egy "felhasználó tartalmai" blokkot, azt beteszed mondjuk a content régióba és kész vagy. kedvedre módosítgatod, amíg az argumenthez nem nyúlsz működni fog. ;)
tadaaa:
$view = new view; $view->name = 'user_content'; $view->description = 'Felhasználó tartalmait jeleníti meg a profil oldalon.'; $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( 'created' => array( 'label' => '', '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, 'html' => 0, 'strip_tags' => 0, ), 'empty' => '', 'hide_empty' => 0, 'empty_zero' => 0, 'date_format' => 'time ago', 'custom_date_format' => '', 'exclude' => 0, 'id' => 'created', 'table' => 'node', 'field' => 'created', 'relationship' => 'none', ), 'title' => array( 'label' => '', '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, 'html' => 0, 'strip_tags' => 0, ), 'empty' => '', 'hide_empty' => 0, 'empty_zero' => 0, 'link_to_node' => 1, 'exclude' => 0, 'id' => 'title', 'table' => 'node', 'field' => 'title', 'relationship' => 'none', ), 'type' => array( 'label' => '', '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, 'html' => 0, 'strip_tags' => 0, ), 'empty' => '', 'hide_empty' => 0, 'empty_zero' => 0, 'link_to_node' => 0, 'machine_name' => 0, 'exclude' => 1, 'id' => 'type', 'table' => 'node', 'field' => 'type', 'relationship' => 'none', ), )); $handler->override_option('sorts', array( 'created' => array( 'order' => 'DESC', 'granularity' => 'second', 'id' => 'created', 'table' => 'node', 'field' => 'created', 'relationship' => 'none', ), )); $handler->override_option('arguments', array( 'uid' => array( 'default_action' => 'default', 'style_plugin' => 'default_summary', 'style_options' => array(), 'wildcard' => 'all', 'wildcard_substitution' => 'All', 'title' => '%1 tartalmai', 'breadcrumb' => '', 'default_argument_type' => 'user', 'default_argument' => '', 'validate_type' => 'none', 'validate_fail' => 'not found', 'break_phrase' => 0, 'not' => 0, 'id' => 'uid', 'table' => 'users', 'field' => 'uid', 'validate_user_argument_type' => 'uid', 'validate_user_roles' => array( '2' => 0, ), 'relationship' => 'none', 'default_options_div_prefix' => '', 'default_argument_fixed' => '', 'default_argument_user' => 0, 'default_argument_php' => '', 'validate_argument_node_type' => array( 'page' => 0, 'story' => 0, ), 'validate_argument_node_access' => 0, 'validate_argument_nid_type' => 'nid', 'validate_argument_vocabulary' => array( '1' => 0, ), 'validate_argument_type' => 'tid', 'validate_argument_transform' => 0, 'validate_user_restrict_roles' => 0, 'validate_argument_php' => '', 'override' => array( 'button' => 'Override', ), ), )); $handler->override_option('filters', array( 'status' => array( 'operator' => '=', 'value' => '1', 'group' => '0', 'exposed' => FALSE, 'expose' => array( 'operator' => FALSE, 'label' => '', ), 'id' => 'status', 'table' => 'node', 'field' => 'status', 'relationship' => 'none', ), )); $handler->override_option('access', array( 'type' => 'none', )); $handler->override_option('cache', array( 'type' => 'none', )); $handler->override_option('style_plugin', 'list'); $handler->override_option('style_options', array( 'grouping' => 'type', 'type' => 'ul', )); $handler->override_option('row_options', array( 'inline' => array(), 'separator' => '', 'hide_empty' => 0, )); $handler = $view->new_display('block', 'Block', 'block_1'); $handler->override_option('block_description', 'Felhasználó tartalmai'); $handler->override_option('block_caching', -1);
ahhoz hogy a page managert ajánljam, sokkal szaftosabb helyzet kéne, mondjuk aszerint, hogy a user éppen milyen role, tök más kiosztású és tartalmú profiloldalt akarsz mutatni. de önmagában talán még ez is kevés lenne, hogy a nem kicsit nehézsúlyú panels ctools page manager kombinációt kelljen bevetni, hiszen akár az előfeldolgozóban is adhatok másik "template suggestion" -t role -onként és akkor is olyan kiosztást csinálok amilyet akarok, csak hát azt .tpl.php -ba kell majd variálni ugye, nem "klikk-klikk-kész". még azt tenném hozzá, hogy ha sose láttál belülről panelst, akkor page managerrel se lesz "klikk-klikk-kész" :) hanem klikk-klikk-mérnem?! klikk-klikk-hátmegőrülökmérnem?! és ez még sokáig, aztán egyszercsak jó lesz. :)
keep it simple. azt mondják a nagyok. elég jó tanács.
-
clear: both;
- A hozzászóláshoz regisztráció és bejelentkezés szükséges
hehe, mázlid van
véletlenül pont volt egy ilyen példa a játszóterembe :)
$view = new view; $view->name = 'newcontent'; $view->description = 'Shows all new activity on system.'; $view->tag = 'default'; $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( 'type' => array( 'id' => 'type', 'table' => 'node', 'field' => 'type', 'label' => 'Type', ), 'title' => array( 'id' => 'title', 'table' => 'node', 'field' => 'title', 'label' => 'Title', 'link_to_node' => TRUE, ), 'name' => array( 'id' => 'name', 'table' => 'users', 'field' => 'name', 'label' => 'Author', 'link_to_user' => TRUE, ), 'comment_count' => array( 'id' => 'comment_count', 'table' => 'node_comment_statistics', 'field' => 'comment_count', 'label' => 'Replies', 'set_precision' => FALSE, 'precision' => 0, 'decimal' => '.', 'separator' => ',', 'prefix' => '', 'suffix' => '', ), 'last_comment_timestamp' => array( 'id' => 'last_comment_timestamp', 'table' => 'node_comment_statistics', 'field' => 'last_comment_timestamp', 'label' => 'Last Post', 'date_format' => 'small', 'custom_date_format' => '', ), 'timestamp' => array( 'id' => 'timestamp', 'table' => 'history_user', 'field' => 'timestamp', 'label' => '', 'comments' => 1, 'relationship' => 'none', 'link_to_node' => 0, 'comment' => 1, ), 'new_comments' => array( 'id' => 'new_comments', 'table' => 'node', 'field' => 'new_comments', 'label' => '', 'set_precision' => FALSE, 'precision' => 0, 'decimal' => '.', 'separator' => ',', 'prefix' => '', 'suffix' => ' new', 'link_to_comment' => 1, 'no_empty' => 1, 'relationship' => 'none', ), )); $handler->override_option('sorts', array( 'last_comment_timestamp' => array( 'id' => 'last_comment_timestamp', 'table' => 'node_comment_statistics', 'field' => 'last_comment_timestamp', 'order' => 'ASC', 'granularity' => 'second', ), )); $handler->override_option('arguments', array( 'uid_touch' => array( 'default_action' => 'default', 'style_plugin' => 'default_summary', 'style_options' => array( 'count' => TRUE, 'override' => FALSE, 'items_per_page' => 25, ), 'wildcard' => 'all', 'wildcard_substitution' => 'All', 'title' => '', 'breadcrumb' => '', 'default_argument_type' => 'current_user', 'default_argument' => '', 'validate_type' => 'none', 'validate_fail' => 'not found', 'id' => 'uid_touch', 'table' => 'node', 'field' => 'uid_touch', 'relationship' => 'none', 'default_argument_fixed' => '', 'default_argument_php' => '', 'validate_argument_node_type' => array( 'page' => 0, 'story' => 0, ), 'validate_argument_php' => '', 'validate_user_argument_type' => 'uid', 'validate_user_roles' => array( '2' => 0, ), 'default_options_div_prefix' => '', 'default_argument_user' => 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, ), )); $handler->override_option('filters', array( 'status' => array( 'id' => 'status', 'table' => 'node', 'field' => 'status', 'operator' => '=', 'value' => '1', 'group' => 0, 'exposed' => FALSE, 'expose' => array( 'operator' => FALSE, 'label' => '', ), 'status' => array( 'id' => 'status', 'table' => 'comments', 'field' => 'status', 'operator' => '=', 'value' => 0, 'group' => 0, 'exposed' => FALSE, 'expose' => array( 'operator' => FALSE, 'label' => '', ), 'relationship' => 'none', ), ), 'timestamp' => array( 'operator' => '=', 'value' => '', 'group' => '0', 'exposed' => FALSE, 'expose' => array( 'operator' => FALSE, 'label' => '', ), 'id' => 'timestamp', 'table' => 'history_user', 'field' => 'timestamp', 'relationship' => 'none', ), )); $handler->override_option('access', array( 'type' => 'role', 'role' => array( '2' => 2, ), )); $handler->override_option('cache', array( 'type' => 'none', )); $handler->override_option('title', 'New content since your last login'); $handler->override_option('items_per_page', '25'); $handler->override_option('use_pager', TRUE); $handler->override_option('style_plugin', 'table'); $handler->override_option('style_options', array( 'override' => 1, 'order' => 'desc', 'columns' => array( 'type' => 'type', 'title' => 'title', 'name' => 'name', 'comment_count' => 'comment_count', 'last_comment_timestamp' => 'last_comment_timestamp', 'timestamp' => 'title', 'new_comments' => 'comment_count', ), 'info' => array( 'type' => array( 'sortable' => 1, 'separator' => '', ), 'title' => array( 'sortable' => 1, 'separator' => ' ', ), 'name' => array( 'sortable' => 1, 'separator' => '', ), 'comment_count' => array( 'sortable' => 1, 'separator' => '<br />', ), 'last_comment_timestamp' => array( 'sortable' => 1, 'separator' => ' ', ), 'timestamp' => array( 'separator' => '', ), 'new_comments' => array( 'separator' => '', ), ), 'default' => 'last_comment_timestamp', )); $handler = $view->new_display('page', 'Page', 'page'); $handler->override_option('path', 'new-content'); $handler->override_option('menu', array( 'type' => 'normal', 'title' => 'New Content', 'description' => '', 'weight' => '0', 'name' => 'navigation', )); $handler->override_option('tab_options', array( 'type' => 'none', 'title' => NULL, 'description' => '', 'weight' => NULL, 'name' => 'navigation', ));
beimportálod viewsba, létrejön egy "newcontent" nevű nézet. ez egy page megjelenítőt készít, a navigation menübe egy menüpontot is rak ami erre mutat, a menüpont neve "New Content". csak olyan tartalmakat mutat, amikre igaz:
(szerzője az aktuális user VAGY kommentelt rá) ÉS van új tartalom a legutolsó megtekintés óta
biztos nem tökéletesen pontosan azt csinálja amit szeretnél, de gyors volt :) és az elvet szépen mutatja, végülis pont ezt az argumentumot és szűrőket kell használnod minden mást alakíthatsz ahogy akarsz.
-
clear: both;
- A hozzászóláshoz regisztráció és bejelentkezés szükséges
Rájöttem és leírom a megoldást az utókor számára.
Szántó Gábor egyik írása vezetette az én problémám megoldásra:
Nem szűrőt, hanem felhasználó
Views –ban tudtam megoldani és ott a felhasználó azonosító argumentumot kellet használni:
Ezek után az user-profile.tpl.php – megjelenítettem így:
<?php print views_embed_view('felhasznalok_profile', 'default', $node->nid); ?>