How to achieve this?
I have followed activating block on php expert mode like this
[code]
if (arg(0) && arg(0) == 'user' && arg(1) && is_numeric(arg(1)) && !arg(2)) { return TRUE; }
[/code]
but nothing...
How to achieve this?
I have followed activating block on php expert mode like this
[code]
if (arg(0) && arg(0) == 'user' && arg(1) && is_numeric(arg(1)) && !arg(2)) { return TRUE; }
[/code]
but nothing...
Comments
Comment #1
pramudya81 commentedanyone figured this out yet?
Comment #2
crizH,
is the block showing up without the php mode?
Comment #3
pramudya81 commentedYup the block showed up without php mode. Just simply shows on a block. But not on user profile.
Comment #4
crizOk, this php snippet only manages that the shortest route block is only displayed on the user profile page (/user/USERID)...
Comment #5
pramudya81 commentedNo, it only appears on block but not in user profile page.
How to do this?
Comment #6
crizwhy don't you just show the block in the content or header region? would be very simular...
Comment #7
pramudya81 commentedYup might be similar but still different and does not make a sense. Since the block will appear every time while user profile only when we choose on user account. Never mind I might re-consider this module.
I was just expecting this feature cos the docs says it can be done.
Regards
Comment #8
criz1) For sure it is possible to insert shortest routes in user profiles. But it's more or less a bit complicated, depending on what userprofile modules you use (core, bio or nodeprofile).
2) Of course it makes sense to display shortest routes as a block. With the help of the above posted snippet ths block would only be displayed on userpages (if you use core user profiles). For nodeprofiles you would have to adopt it a little bit.
And with block regions you have all possibilites to display the shortest route block. Show it in the content region and it will appear directly above/under the content/node. Of course, this depends on your used theme. Furthermore, you could define your own block regions, even in nodes or user profiles, but this is definitely an advanced use case.
3) You say, the docs say it can be done. Probably you mean the last sentence in the readme file: "Now the shortest route block should appear on every users profile page". This howto is about enabling the shortest route block on user pages (user/UID). It is no guidance for displaying shortest route INSIDE user profiles. But maybe this last sentence could be a little bit misunderstanding...
Comment #9
pramudya81 commentedDear criz,
Yeah, sorry I misunderstood the documentation. As you said in point number 3. I was expecting the shortest route to appear only in user profile not in a block.
And what about point number 1? Is it possible? Yet to be developed?
But you said in point no 3 that it is actually a block but only appear when we are visiting user profile pages right?
Regards
Comment #10
crizWith a little bit of theming you could insert any block/view in your user profile. I have no idea what profile solution you use, with nodeprofile or bio it would be absolutely no problem, with core userpages (user/UID) it would be somehow different.
Some links for more info:
Inserting blocks in nodes directly: http://drupal.org/node/164799
Defining customized block region: http://drupal.org/node/29139
But as I said, i would recommend using the header or the content region. With some very small changes in your page.tpl.php you can place this regions wherever you want. Or you use the great panels module. There are a lot of possibilities.
On the other side it would be great if the shortest route module would provide some API functions, or just a theming function, for such use cases (inserting shortest routes in templates or other modules). I don't think it's really the case right now...
cheers,
criz
Comment #11
pramudya81 commentedHmm... ok thanks for your input and info. I'll try nodeprofile and bio since Im using core profile.
I'll figure this out.
Regards
Comment #12
criz