I guess you are right.. i just wanted my hook_menu_alter to help me out here but turns out that it cannot support dynamic titles.. I can always replace &quot;View&quot; by &quot;Take a look&quot; from the hook but dynamic part does not work.. Plus it would have been good if menu would not get cached by default.. <div>
<br></div><div>Yeah, i&#39;ve added the ellipsis in my code, forgot to copy that here.. <br clear="all"><br>Cheers,<br>Mukesh<br>
<br><br><div class="gmail_quote">On Thu, May 27, 2010 at 10:49 AM, sumeet pareek <span dir="ltr">&lt;<a href="mailto:positivecharge@gmail.com">positivecharge@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hey.. that looks to me a perfectly valid way. You could try and use the &#39;themer&#39; module from the devel family to check how else that can be done. A preprocess function in the template file is not a bad way either. I dont see you triming and adding an ellipsis in your code.<br>

<br><div class="gmail_quote"><div><div></div><div class="h5">On Thu, May 27, 2010 at 10:24 AM, Mukesh Agarwal <span dir="ltr">&lt;<a href="mailto:mike4u4ever2001@gmail.com" target="_blank">mike4u4ever2001@gmail.com</a>&gt;</span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5">
Ok, so a bad way is to write the following code in your template.php<div><br></div><div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">


<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
function THEMENAME_preprocess_page(&amp;$vars) {</blockquote><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">


<span style="white-space:pre">                </span>if (arg(0) ==  &#39;node&#39; &amp;&amp; is_numeric(arg(1))) {</blockquote><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">


<span style="white-space:pre">                        </span>$node = $vars[&#39;node&#39;];</blockquote><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">


<span style="white-space:pre">                        </span>if ($node-&gt;type == &#39;XXXX&#39;) {</blockquote><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">


<span style="white-space:pre">        </span>                          $vars[&#39;tabs&#39;] = str_replace(&#39;View&#39;, $node-&gt;title, $vars[&#39;tabs&#39;]);</blockquote><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">


<span style="white-space:pre">                        </span>}</blockquote><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">


<span style="white-space:pre">                </span>}</blockquote><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">


}</blockquote></blockquote><div><br></div><div>and it works but i would really want to know if there is a cleaner way to do it..  </div><br>Cheers,<br><font color="#888888">Mukesh</font><div><div></div><div><br>

<br><br><div class="gmail_quote">On Thu, May 27, 2010 at 9:57 AM, Mukesh Agarwal <span dir="ltr">&lt;<a href="mailto:mike4u4ever2001@gmail.com" target="_blank">mike4u4ever2001@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Hi,<div><br></div><div>I&#39;m trying to change the title of the menu item &quot;View&quot; on a node page.. I want to change the tab name to be the title of the node (with an ellipsis if it goes beyond a limit).. This means the title of the tab here will be dynamic.. I&#39;ve tried using hook_menu_alter and tried to change the title of the menu item &#39;node/%node/view&#39; with some code.. I tried 3 ways -- one, get the title using a query with arg(1), two, by page_get_title, and 3 by menu_get_object to get the respective node and then the title.. None of the approaches has worked for me.. If you guys know a quick solution, that would be wonderful.. I dont want to change it via tpl for sure..</div>



<div><br></div><div>PS: I&#39;ve also tried hook_menu_link_alter but it did not work<br clear="all"><br>Cheers,<br>Mukesh<br>
</div>
</blockquote></div><br></div></div></div>
<br></div></div>--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br></blockquote></div><br><br clear="all"><br>-- <br>Cheers<br><font color="#888888">Sumeet Pareek<br>
</font><br>--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br></blockquote></div><br></div>