views argumentum cck_fieldbol
nos en ugy latom az insert_view nem kezel valtozokat,
a viewfieldnel is csak %nid, %author es %viewer valtozokat lehet hasznalni mint argumentum.
meg gondolkoztam, hogy talan a panels modullal megoldhato lenne de ott sem talaltam megoldast, ugyhogy irni kell egy kis kodot.
ez egy pelda ami a node cck_fieldjet hasznalja a megjelenitett a view argumentumakent:
if (!( arg(0) == 'node' && is_numeric(arg(1)) )) { return; } $node = node_load(arg(1)); $category = $node->field_category[0]['value']; print t('Products in category @category', array('@category' => $category)); $view_name = 'viewneve'; $limit = 0; // number of returns $view_args = array($category); $view = views_get_view($view_name); print views_build_view('embed', $view, $view_args, FALSE, $limit);
ezt a kodot belerakod egy blokkba, es igy barhol megjelenitheted az oldalon..
- A hozzászóláshoz regisztráció és bejelentkezés szükséges
Preprocess block
A kododbol valoban hianyzik az img tag. Valamint a masodik divnek bezaronak kell lennie (</div>).
Javitott verzio. Illeszd a template.php-be:
/** * Override or insert PHPTemplate variables into the templates. */ function phptemplate_preprocess_block(&$vars) { global $user; if ($user->uid > 0 && isset($user->picture) && $user->picture) { if ($vars['block']->module == 'user' && $vars['block']->delta == 1) { $vars['block']->content = '<div class="userpic">' . theme('image', $user->picture, $user->name, $user->name) . '</div>' . $vars['block']->content; } } }
Majd menj erre az oldalra es uritsd a cache-t: admin/settings/performance
- A hozzászóláshoz regisztráció és bejelentkezés szükséges
részletek
Drupal a /drupal alkönyvtárba
Tárhely gyökérkönyvtár .htaccess-be (domain név: domainnev.hu):
Options -Indexes RewriteEngine on Options +FollowSymLinks RewriteCond %{HTTP_HOST} !^domainnev\.hu$ [NC] RewriteRule .* http://domainnev.hu/ [L,R=301] RewriteRule ^$ drupal/index.php [L] RewriteCond %{DOCUMENT_ROOT}/drupal%{REQUEST_URI} -f RewriteRule .* drupal/$0 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* drupal/index.php?q=$0 [QSA]
/drupal/sites/default/settings.php:
$base_url = 'http://domainnev.hu';
/drupal/.htaccess
# a kovetkezo sorba irt XXX miatt az egesz rewrite resz kimarad <IfModule XXXmod_rewrite.c> RewriteEngine on # If your site can be accessed both with and without the 'www.' prefix, you ... # RewriteBase / # Rewrite URLs of the form 'x' to the form 'index.php?q=x'. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^(.*)$ drupal/index.php?q=$1 [L,QSA] </IfModule>
Nem igazán vagyok otthon az apache konfigban.
Fox Mulder
- A hozzászóláshoz regisztráció és bejelentkezés szükséges


Palócz Paal Pál, a drupal.hu admin csoportjának tagja



imagefield + imagecache első mező
Csinálsz egy imagecache szabályt, legyen mondjuk small_images.
beállítod, hogy a teaserben ne mutasson semmit.
beleteszed ezt a node.tpl.php-ba, a print $content helyére:
rohanásban vagyok, i hope, h nem törött a kód.
ps: a sört lécci a pp-nek add :)
ninja - http://alleycat.hu