Recent comments

  • List of recently viewed nodes in Drupal   7 years 41 weeks ago

    Hi Jan,

    How would you implement an "Others also viewed these units" block on your real-estate site?

    Regards,

    Hans

  • List of recently viewed nodes in Drupal   7 years 42 weeks ago

    Hi,

    No easier way to achieve this ?

    Thanks.

  • List of recently viewed nodes in Drupal   7 years 42 weeks ago

    This is brilliant; very clever method. Thank you!

    Installing the session API module did the trick perfectly for anonymous users- no need for any custom PHP :) Looking at the db table, it's just added another column to flag_table called 'sid', which runs alongside nid. Pretty clever.

  • List of recently viewed nodes in Drupal   7 years 46 weeks ago

    Thanks man, this worked so well for me!
    I've added the action of sending an email to that rule so I can keep track of what my students are doing! Great job!

  • Related content in Drupal   7 years 47 weeks ago

    Thank you for sharing this with us.
    It's an excellent tutorial and got me exactly what I needed.

    Thanks again.

  • Product comparison in Drupal   7 years 47 weeks ago

    Hi Pirmin
    I had a working workflow of flags and views until the views security update 6.2.13 came up, which broke the views functionality...

  • List of recently viewed nodes in Drupal   7 years 50 weeks ago

    Update on this: Views 2.15 and also 2.16 came out pretty quickly after v2.14, and when I upgraded from 2.14 to 2.16, suddenly my list of recently viewed nodes was restored. So just as an FYI, in my experience, Views 2.14 is not compatible for some reason with this. So just use a newer version and you should be golden :-D My recently viewed content is running great at http://www.marlincrawler.com. Browse to a few product pages and let me know how it looks. Thanks!

  • List of recently viewed nodes in Drupal   7 years 50 weeks ago

    Simply superb. I never thought this Flag can do much better unexpected things....

  • Programmatically creating menu items in Drupal   7 years 50 weeks ago

    i forgot...

    the menu_name i'am using is the default menu you can assign a content-type to

  • Programmatically creating menu items in Drupal   7 years 50 weeks ago

    thx also!

    in order to also adjust an existent menu item i came up with the following solution.
    of course you need to add the event "After updating existing content".

    $tMenu_name = explode( ':', $node->menu['parent']);
    $menu_name = $tMenu_name[0];

    $mlid = $node->menu['mlid'];

    $item = array(
    'link_path' => 'node/' . $node->nid,
    'link_title' => $node->title,
    'mlid' => $mlid,
    'menu_name' => $menu_name,
    'hidden' => 1
    );

    menu_link_save($item);

  • Related content in Drupal   8 years 15 hours ago

    Featured Content Module ...

    You may want to try out the Featured Content module at

    http://www.drupal.org/project/featured_content

    for your related content blocks as it is geared for non-technical users and is, thus, made to be simple and intuitive with inline descriptions/documentation. You can check out the user ratings at drupalmodules.com here:

    http://drupalmodules.com/module/featured-content

    Cheers,
    Kristen

  • List of recently viewed nodes in Drupal   8 years 5 days ago

    Mike, You need to create a custom module that would implement hook_cron() the way shawngo suggested. For information on how to go about creating a module, follow the tutorial at http://drupal.org/node/1074360. API documentation for hook_cron() can be found at http://bit.ly/vyiQ6T.

  • List of recently viewed nodes in Drupal   8 years 6 days ago

    shawngo,

    Could you please explain in detail how/where to implement your code snippet? I've never added anything to hook_cron(). How or where do I do this?

    Thanks!
    Mike

  • List of recently viewed nodes in Drupal   8 years 1 week ago

    Hello Jan,

    Today I upgraded Views for the critical security update to version 6.x-2.14 and now my List of recently viewed nodes is no longer appearing.

    Has anyone else experienced this? I don't know what Views is doing differently and don't even know where to start trouble shooting this :-(

    If anyone has a solution please post up, thanks!
    Mike

  • Product comparison in Drupal   8 years 1 week ago

    hi jan, first of all thanks for this tutorial, i learned quite a few things!!
    but unfortunately this set up just won't work for me.. i'm getting frustrated.

    i did everything exactly like described, but when i open the views page for the "product comaprison" i always get an empty page. neither the little menu with "edit export clone" appears, that usually shows up when hovering over a view, nor the empty text for a view without any results.

    it does work though when i change the setting in views-relationships from "only current user" to "any user". but this just not what i need.. :(
    i even tried to import your view, but without any luck.
    do you have or does anyone else has an idea what my problem could be?

    help much appreciated!! thanks again!

  • List of recently viewed nodes in Drupal   8 years 1 week ago

    There is a brandnew patch for the entity api module, that makes it work for anonymous users in D7 too! See & download here:
    http://drupal.org/node/1256906#comment-5219040

    So you can make it work in D7 liked described ins Jans original post now!

    BTW: Unfortunately there is a bug in the (d7) flag module, that causes PDO Exceptions from time to time when flagging nodes for anonmyous users.
    see here:
    http://drupal.org/node/1257038#comment-5214646

    Cheers,
    Simon

  • List of recently viewed nodes in Drupal   8 years 3 weeks ago

    Thanks a lot Simon!
    Unfortunately i can't get this to work anyway.
    Adding that condition type gives me an internal server error (ouch...) after chosing view-mode data,and anyway i discovered that an overriding of the node view template via panels (which i did), makes rules not triggering correctly.
    So i guess i don't have choice but to wait for a better integration between those two.
    (Correct me if i'm wrong please!!! :) )

  • List of recently viewed nodes in Drupal   8 years 3 weeks ago

    Wow! Thanks heaps for that, Simon!

  • List of recently viewed nodes in Drupal   8 years 3 weeks ago

    Since Rules 7.x still has problems triggering actions for anonymous users, I found workaround for this problem in D7:

    Do all the same a described in Jan's great tutorial, except for the rules part:

    - enable the core "PHP filter" module
    - now create a rule:
    Event
    -- Content is viewed
    Condition type
    -- Data comparison - > view-mode -> Full content
    Action
    -- Execute custom PHP code

    // Flag API code to execute with this rule:
    $flag = flag_get_flag('recently_viewed'); // exact machine name of your flag type
    $flag->flag('unflag', $node->nid); // unflag first to refresh the flagging time
    $flag->flag('flag', $node->nid);

    If the module "Session API" is installed it works like charm for anonymous guests in Drupal 7 this way! (and for authenticeted users anyway)

    Cheers,
    Simon

  • List of recently viewed nodes in Drupal   8 years 3 weeks ago

    Thanks a lot for this nice article!

  • Related content in Drupal   8 years 3 weeks ago

    Brilliant ! thank you !! :-D

  • Related content in Drupal   8 years 3 weeks ago

    It certainly is possible. You're gonna have to change the PHP snippet from the tutorial. There are two in the tutorial -- one picks just the very first term, the other one picks all, which must be your case. You need to make it return only terms that are not parents of other terms in the hierarchy. Have a look at taxonomy_get_tree() and the pair of {term}, {term_hierarchy} DB tables.

  • Related content in Drupal   8 years 3 weeks ago

    I have a taxonomy hierarchy, this is causing all taxonomy in the hierarchy to be related,

    Asia
    Thailand
    Phuket

    Where as I only need the last in the hierarchy (Phuket). Is this possible?

    Would really REALLY appreciate any help you can offer.

    Thanks in advance.

    Mike

  • Programmatically creating menu items in Drupal   8 years 5 weeks ago

    I think this is a nice idea. I have a triggered rule where the event is 'After saving new content'. Im just trying to get nodes into the primary links menu, so ive left out the plid. This has been integrated into the core in Drupal 7. Thank you.

  • List of recently viewed nodes in Drupal   8 years 5 weeks ago

    Sorry to hear that guys! Just like you I've had no problem setting it up for authorized users in Drupal 7, but I hit the wall getting it to work for anonymous users.

    Unfortunately the site:current-user data selector in Rules doesn't seem to be supported by SessionAPI.

    Please, let me know if you manage to get it working on your end. Cheers!