Skip to content

Instantly share code, notes, and snippets.

@baisong
Created July 13, 2011 17:30
Show Gist options
  • Save baisong/1080809 to your computer and use it in GitHub Desktop.
Save baisong/1080809 to your computer and use it in GitHub Desktop.
A little jQuery hack to overcome a drupal views issue http://drupal.org/node/750172
@baisong
Copy link
Author

baisong commented Jul 13, 2011

I didn't want to modify contributed module code (views),
and couldn't find a simple template.php workaround...

...so, here's a fun little script that expects any number
of incorrectly formatted user profile picture links like:

<div class="fix-link">
    <div class="display-none nid">
        $nid
    </div>
    <div ...>
        <a href="$wrong_url">
            $user_picture
        </a>
    </div>
</div>

...and for each one, returns:

<div class="fix-link">
    <div class="display-none nid">
        $nid
    </div>
    <div ...>
        <a href="node/$nid">
            $user_picture
        </a>
    </div>
</div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment