By donkasok on
Hi,
My content is tagged with taxonomy. So in those pages i can see the taxonomy link on top .If i mouse over the that i can see www.mysite.com/taxonomy/term/31 , Is there any way to fetch the 31, i think its tag id and print it in the respective page
Please help to resolve this....
Comments
arg() function
why are you not used arg() funtion for getting arguments? Suppose you need 3 argument from URL then you can use arg(2).
Thanks,
vijay
Thanks,
Vijay Thummar
Hi, Thanks for the replay...
Hi,
Thanks for the replay... My issue is
I HAVE TWO WEBSITES (www.exam1.com , www.exam2.com) . I created same taxonomy for both websites. both have same vocabulary and terms.
I printed the taxonomy link on page .tpl using the below code.
The above code is fetching the current page taxonamy (www.exam1.com/taxonomy/term/10). I need to fetch only term/10 or taxonomy/term/10). How can i accomplish this.Please help me.
with regards,
Don
Below code
Hi from the below code you can get the path of taxonomy.
Output of this is
but still i confused that why do you need only these path? And BTW in the print theme('links', $terms) function you have to pass whole $terms not onlt these array else it will not generate path and will through errors.
Regards,
vijay
Thanks,
Vijay Thummar
Thanks a lot...
I need the terms id to accomplish a unusual task.
Currently i am having two website (www.exam1.com , www.exam2.com, www.exam3.com) using domain access module . I created same taxonomy for both websites. both have same vocabulary and terms.
If user is reading an article in www.exam1.com In the bottom page i need to show a link saying that "related topics on exam2 " and "related topics on exam 3" Once he click on "related topics on exam2 " it will navigate into a page "www.exam2.com/taxonomy/term/31". If i am able to retrieve the term id i only need to append it with the respective urls to accomplish this.
with regards,
Don
OK so now from above code,
OK so now from above code, your problem is solved, Right? Or you need any more help?
Thanks,
Vijay Thummar
HI, THANKS
hi thanks 4 ur replay.. i am putting those codes now . i was not around last day .. So i am going to check it now... thanks a lot for your concern
DoN
Not Printing
Hi,
I am having some issues with these codes... While i put all the codes inside page.tpl and refreshed the browser. The entire page disappears. Its not showing any content. Ince i removed the code everything works fine
DoN
http://api.drupal.org/api/fun
http://api.drupal.org/api/function/taxonomy_node_get_terms/6
gives you a nice array of term data, not the cooked link.
.dan.
if you are asking a question you think should be documented, please provide a link to the handbook where you think the answer should be found.
| http://www.coders.co.nz/ |
.dan. is the New Zealand Drupal Developer working on Government Web Standards
Please help
Hi,
Ho can i use this function in page.tpl.php.
DoN
Don't do it in page.tpl.php,
Don't do it in page.tpl.php, node information is in node.tpl.php.
For more help you will have to demonstrate what you've actually tried so far.
If you haven't tried, you can't be helped.
.dan.
if you are asking a question you think should be documented, please provide a link to the handbook where you think the answer should be found.
| http://www.coders.co.nz/ |
.dan. is the New Zealand Drupal Developer working on Government Web Standards
THANKS ITS WORKING BUT HOW CAN I FETCH THE VALUE
Hi,
Thanks a lot its working superb. Its printing an array object. I am so new to this i know this is an array i think this is an multidimensional array i am not sure about it can you please tell me how can i fetch this array objects.
Array ( [30] => stdClass Object ( [tid] => 30 [vid] => 7 [name] => Relatives [description] => [weight] => 0 ) [31] => stdClass Object ( [tid] => 31 [vid] => 7 [name] => Friends [description] => [weight] => 0 ) )
how can i retrieve the term id 30 and 31 and assign to an php variable for example i need to retrive the friends and relatives and assign it to $friends and $relatives , so that i can create a hyperlink 'www.website2.com/taxonomy/term/".$friends."+".$relatives'
DoN
Hi i found this solution
if i use
foreach ($node->taxonomy as $tid) {
print $tid->tid ."+";
}
it will print all the tids, but i need to get the count of tid first so that i cann append each with +
DoN