Tartalomhoz feltöltött cck kép linkeljen a galériára, ha node_reference mezőben galériát kapcsoltak a tartalomhoz

The spam filter installed on this site is currently unavailable. Per site policy, we are unable to accept new submissions until that problem is resolved. Please try resubmitting the form in a couple of minutes.
Kategória: 
Snippet

Már rövid időn belül kétszer is volt hasonló kívánság, levésem gyorsan, hogyan is praktikus.

Szóval a feladat: Van egy hír, vagy egy esemény tartalomtípus. Van galériakezelés is az oldalon, az kvázi most mindegy milyen, a lényeg, hogy a galéria egy node, amire a hír vagy az esemény tartalomtípusban node_reference -szel lehet hivatkozni.

Van ám ezekben a tartalomtípusokban egy vezérkép nevű cck mező, ami a tartalom fő illusztrációja. Tehát a lényeg, hogy a tartalom teljes nézetében ez a kép mutasson a galériára.

Fontos, hogy a node_reference-ből egy tartalomhoz egyet lehet csak kapcsolni, ha többet lehetne, az már gyakorlatilag usability fail, hiszen ilyenkor melyikre mutasson a kép?

Pláne, hogy konkrétan esetemben a képhez egy cck mezőcsoportban hozzá is lett pattintva a node_reference. Szóval azt eleve feltételezzük, hogy csak egy szem node_reference-ünk van.

Akkor most szedjük elő a sminkünk template.php-jét, és csapjunk hozzá egy preprocess-t:

[geshifilter-drupal6]function SMINKNEVE_preprocess_content_field(&$vars) { if ($vars['field_name'] == 'field_KEP_MEZO_NEVE' && $vars['page']) { if (isset($vars['node']->field_NODE_REF_MEZO_NEVE)) { foreach ($vars['items'] as &$item) { $node = node_load($vars['node']->field_NODE_REF_MEZO_NEVE['0']['nid']); $item['view'] = l($item['view'], 'node/' . $node->nid, array('attributes' => array('title' => $node->title,), 'html' => 'TRUE',)) ; } } } return $vars; }[/geshifilter-drupal6]

Hozzászólások

9ion1u2 h6ai2wtd7x Billige

9ion1u2 h6ai2wtd7x Billige Fodboldtrøjer jm4sgwp e40cpuf\n n8j9pguf 2q0nsy fotballdrakter hf5t96kj 12gczp4u\n vmabns5d dieq1a8jr Fodboldtrøjer hy931rijf gw2cyt3\n

Passion the site-- really

Passion the site-- really individual pleasant and lots to see! sites:ggglese.com
maglie calcio a poco prezzo http://www.miami-limo-services.com/UserProfile/tabid/43/UserID/2554520/D...

Thank you for sharing this

Thank you for sharing this cool web site.

You've possibly the best

You've possibly the best internet websites.

Wow cuz this is extremely

Wow cuz this is extremely good job! Congrats and keep it up.

Thanks for the purpose of

Thanks for the purpose of providing these types of superior post.

Fantastic page, Carry on the

Fantastic page, Carry on the good job. Thanks a lot!|

Simply just needed to express

Simply just needed to express Now i am grateful I stumbled onto your page!|

It's remarkable to go to see

It's remarkable to go to see this web page and reading the
views of all friends on the topic of this post, while I am also eager of getting know-how.

My brother suggested I might

My brother suggested I might like this website. He was entirely right.
This post actually made my day. You can not imagine just how much time I had spent for this info!
Thanks!

Link exchange is nothing else

Link exchange is nothing else however it is just placing the
other person's web site link on your page at appropriate place and other person will
also do similar in favor of you.

Link exchange is nothing else

Link exchange is nothing else however it is simply placing the other person's blog link
on your page at proper place and other person will also
do similar in support of you.

First off I want to say

First off I want to say terrific blog! I had a quick question which I'd like to ask if you don't mind.
I was curious to find out how you center yourself and clear your head before
writing. I've had a difficult time clearing my mind in getting my ideas out there.
I do take pleasure in writing however it just seems like the first 10 to 15
minutes are wasted simply just trying to figure out how
to begin. Any suggestions or hints? Cheers!

I quite like reading through

I quite like reading through a post that will make men and women think.
Also, thank you for permitting me to comment!

Heya! I'm at work surfing

Heya! I'm at work surfing around your blog from my new apple iphone!
Just wanted to say I love reading through your blog and look forward to all your posts!

Carry on the excellent work!

It's remarkable in support of

It's remarkable in support of me to have a website, which is
useful in favor of my knowledge. thanks admin

Én eztet a node.tpl-ben

Én eztet a node.tpl-ben csináltam meg, úgy hogy csak egy node reference mezőt használtam a galériára.

<?php
if ($field_kapcsolodo_galeria[0]['nid']) {
foreach ($field_kapcsolodo_galeria as $value) {
$galeria = node_load($value[nid]);
$galeria = node_build_content($galeria);
print l(theme('imagecache', szovegkep, $galeria->field_kepek[0]['filepath']), url("honlapom/node/".$galeria->nid), array('html' => TRUE));
}
}
?>

Hozzászólás

A mező tartalma nem nyilvános.
  • Internal paths in double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or relative path.
  • Engedélyezett HTML elemek: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <del> <img>
  • A webcímek és email címek automatikusan linkekké alakulnak.
  • A sorokat és bekezdéseket a rendszer automatikusan felismeri.
  • Engedélyezett HTML elemek: <a> <blockquote> <br> <cite> <code> <dd> <del> <div> <dl> <dt> <em> <li> <ol> <p> <span> <strong> <ul>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <bash>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <mysql>, <php>, <python>, <ruby>, <sql>. The supported tag styles are: <foo>, [foo].
  • Minden email cím át lesz alakítva ember által olvasható módon, vagy (ha a JavaScript engedélyezett) ki lesz cserélve kattintható, de biztonságos hivatkozásra.