Hi,

I stumpled upon this module browsing reptags and was wondering if with this module may be my userrequest could be granted.
Namely getting the possibility to have the terms which the node is assigned to per vocabulry in the node-title , node-body or other cck field.

Thanks a lot in advance for considering this!

greetings,
Martijn

Comments

Roi Danton’s picture

Title: Not just a termid, but the first, second etc.. term per vocab which the node is assigned to inside node-title/body/cck » Tag option: Embed terms by node ID using all vocabularies connected with that node

I'm answering vice versa:
a) You can use Linodef tags in every textfield which allows filtered content. As I know the node title never allows filtered content (?) but node body and cck textfields do.
b) You want to do that:

  1. you have a certain node
  2. you want to get all vocabularies that are assigned to the node
  3. you want to display all the terms of all those vocabularies like 1, 2 or 3?
    1. list
      • Vocab 1: Term 1-1, Term 1-2, Term 1-3, ..., Term 1-y
      • Vocab 2: Term 2-1, Term 2-2, Term 2-3, ..., Term 2-y
      • Vocab x: Term x-1, Term x-2, Term x-3, ..., Term x-y
    2. string, separated by comma:
      Term 1-1, Term 1-2, Term 1-3, ..., Term 1-y, Term 2-1, Term 2-2, Term 2-3, ..., Term 2-y, Term x-1, Term x-2, Term x-3, ..., Term x-y
    3. string, separated by space:
      Term 1-1 Term 1-2 Term 1-3 ... Term 1-y Term 2-1 Term 2-2 Term 2-3 ... Term 2-y Term x-1 Term x-2 Term x-3 ... Term x-y

Is b.3.1) or b.3.2) or b.3.3) correct?

(talking to myself (no paper and pen here): Filter: $node->taxonomy, Buttons API: a subfunction of getnodebycontenttype -> split that option from option string -> show all terms instead of nodetitle)

Summit’s picture

Hi Roi,

Thinking my request and your answer over, I will explain exactly what I have in mind.
1) Node-title
The node-title can't be touched by your module or Reptags, so I think I have to get to the node-title through the automatic nodetitle module (http://drupal.org/project/auto_nodetitle).

2) Vocabulary/terms
What I would like is to set up a vocabulary: From, set up another vocabulary To, and set up a third vocabulary: Subject.
Inside the node-body and possible cck fields I would like to be able to use these termnames from the terms inside these vocabularies.
Say Vocabulary From term: India, Vocabulary To term: Nepal, Vocabulary Subject term: flight
The url of the node would be: a term from From/a term from To/ a term from Subject.
So in this case it will be www.example.com/India/Nepal/flight
I will try to get to these url's through pathauto ==> Any remarks on this absolutely appreciated.

3) Getting from the terms to the Tags => Here comes hopefully your module inside the scope

The url is: www.example.com/India/Nepal/flight/himalaya
The node-title is hopefully possible to make India-Nepal-flight-himalaya (through autonodetitle)

Then I would like to use the url-arguments India, Nepal and flight as tags within the body content.
SO I would like to make ONE node with these tags inside:

The [tag3]{flight} from [tag1]{India} to [tag2]{Nepal} shows the [tag4]{himalaya}

Within {} the results because of the arguments in the url.

This way there is a filled taxonomy, only One node which is a node-template, and related to the url as many pages as url's inside my site.
Do you follow me please?
Is this possible using your thinking of your module-enhancements?

Thanks a lot for your quick reply already!

greetings,
Martijn

Roi Danton’s picture

Title: Tag option: Embed terms by node ID using all vocabularies connected with that node » How to embed terms by a path which is created by several vocabularies (vid1/vid2/vid3)
Component: Code (general) » Miscellaneous
Status: Active » Fixed

As far as I know Token (used by pathauto and autonodetitle) only supports the topmost vocab (but I may be wrong/there might be another approach).

But in general this approach is realizable very hard. Though the path creation would work with hook_menu() & hook_theme() it would be an awful method. Though I could create a Linodef option which reads the path, validate and embed the term (e.g. [#2,vid,path]) the way you created the node path (if successful) is still painful and doesn't fit the Drupal layout.

Instead I recommend a much easier way. Use the views module, create a custom view and set the terms of vocabularies as arguments 1,2,3. Views arguments create a path as you described 1/2/3 and term x of vocab 1 is called if term x == "1". Then theme the output (The 3 from 1 to 2 shows the 4) and voila, you have the result you desired. Here at drupal.org or in help files included in views module you'll find many & good information about the usage of views.

Summit’s picture

I hear you in using views.
But how about not having to type in every url, but generate them from the terms with pathauto, is this also possible using views?
And can you theme the view so it works as a template? I will look through drupal.org for this also..

greetings,
Martijn

Roi Danton’s picture

Category: feature » support

Yes, the arguments creates the path, so assign your vocabularies to arguments and you have a path for each combination of terms. I recommend to read the documentation about views arguments (included into the views module).

I never themed a view but it provides template files so you can place a template file at your theme which overrides the default one. I recommend to read the documentation about theming views.

Local views documentation.

Summit’s picture

Hi Roi,

Looked more deeply in this. The problem still is to get to the terms inside the node-body.

What I did is, I build a view with argument handling code
I got nodes based on the argument handling code.

But what I would like is to be able is to have arguments inside the node-body of a particular node, to say:

Something along the lines of:
The terms in the node are: ''Term1" for country, and "Term2" for local information

I thought about using the insert-view module for this.
But:

[view:viewblock_location=1=arg1]

Is not working..
Do you have any tips?

Thanks a lot for your quick reply already!

greetings,
Martijn

Roi Danton’s picture

Insert view module doesn't return the current arguments but just passes the arguments to the view. So this won't help.

With views 1.x I've got the arguments with this code:

global $current_view;
print $current_view->args[0];

Unfortunately doing this with Views 2.x doesn't work anymore. I've had a quick look into the new Views API but haven't found the objects to use yet.

Nevertheless it has to work similar to views 1. You can get the arguments with the help of php code into your body or somewhere else where you can enter php code. E.g. using the views header to display your row would be the easiest way.

Summit’s picture

Hi Roi,

I can't figure it out using taxonomy/term... views...
the problem is off course I only have then the specific term id for something like ..taxonomy/term/11 (= himalaya) with the taxonomy/term view.
The url of himalaya term is because of urlaliasing: www.example.com/India/Nepal/flight/himalaya
But the url views sees is: www.example.com/taxonomy/term/11

How to get to the India, Nepal, flight terms to get the title in my template idea in the header of the taxonomy/term view..?

$term_grantgrantparent = India
$term_grantparent = Nepal
$term_parent = flight
$term = himalaya

Could you help with this please?
Thanks a lot in advance!

Ok for now that it is view1. From working then to view2 is my preferred scenario.
EDIT: Hi Roi, how to get to the argument-handling-code in views2 is described on this page: http://agaricdesign.com/note/using-taxonomy-term-associated-with-a-node-...

uggghh I just can't get this to work in views 1, sight.. :(

EDIT: Roi, I have some results.
Only with custom view, because then I can get the termnames in the url.
Do you know how I can use html or div's etc.. in the view header?

Greetings,
Martijn

Roi Danton’s picture

Well, at least the function to get the current view object is the same for View 1 & 2. Therefore paste something like this in the header of your view (using PHP filter) to get the current arguments:

$this_view = views_get_current_view();
print('The '. $this_view->args[2] .' from '. $this_view->args[0] .' to '. $this_view->args[1] .' shows the '. $this_view->args[3]);

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.