making description field link to original content through view in drupal 7 - drupal-7

i have created a taxonomy vocabulary and added few word with description. Now I'm displaying taxonomy term and its description through view module using grid format. I want to make description field to link to its original taxonomy term page. Please advice. Thanks.

Please do the following steps:
Add a field "Term ID" and do a "Exclude from Display" on it. Make sure this precedes the description field in the views.
Click on the description field in the view, and go to the section "Rewrite Results"
Check the checkbox "Output this field as a link". Check the replacement pattern for the term id. Usually it will be something like this [term-id].
In the Link Path, construct the url like this: taxonomy/term/[term-id]
Please let me know if you find any issues.

Related

Changing default "Taxonomy term" view to add a filter and change path in Drupal 7

I am trying to do a seemingly simple thing but unable to come up with anything.
I'll be specific here for what I want to achieve. I want to clone the existing Taxonomy term which has a path of /taxonomy/term/%. After cloning this view, I wanna make the following changes to it:-
Change the name to Document of Taxonomy Term
Add a filter to this view of a field called is_document. It's a checkbox which is when clicked shows that this node of my taxonomy term is a document.
Change path to /taxonomy/term/documents/%, which shows that I am opening all nodes of this term which are marked as document.
Now when I open my site, let's say with the URL www.mysite.com/organisation/company/documents, it doesn't pick the view. The URL www.mysite.com/organisation/company works as it picks the default Drupal View.
Any idea what I can do here?
I hope I was able to explain efficiently.
UPDATE
I used TVI, but it changes all the pages of my taxonomy terms. I don't wanna change my current scenario where normal taxonomy term pages are opened through /taxonomy/term/% (native Drupal view). I just wanna open all taxonomy terms with a document filter when /taxonomy/term/documents/% view is selected.
Thanks.
I suggest you to download and install Pathauto for URL aliases patterns.
In your Views, you set the path at: taxonomy/term/documents/%
In Pathauto settings, you to go "Patterns", then scroll to the taxonomy section where you can set a new URL pattern: [term:vocabulary]/[term:name]/documents
Then, go to Update tab and update all the paths for Taxonomy.
Enjoy your new Views.

Changing order of fields in Drupal's blog

I am using Drupal 7 and Zircon template. I am trying to change the order of fields of my blog. Basically, my blog shows (in front page):
Title
Date/Time
Body
Link to "Read more"
I created some categories using taxonomy and I want to show this category before the title.
In "Manage Display" from "Administration » Structure » Content types » Blog entry" I can just put the category after or before the Body field. I think I will need to change something in the code, but I don't know where. I found the file "field--taxonomy-term-reference.tpl.php" where I can customise some information about category, but not where it will appear.
Does anybody knows how can I do it?
Use Panels module else with coding you can override node template.
Cheers!!!

Addressing the tab menu in view when using taxonomy

I use taxonomy terms to address my menus(these taxonomy terms show the structure of my site) so when I create a view I should use the taxonomy path (instead of alias) for the page setting (the only way that I can link the view to my taxonomy address path as far as I know :P ). whenever I see the page URL I can see the alias. now I'm trying to set up a page that has 2 tabs. I have set it up but the problem is when I click in the tab I see the taxonomy path instead of alias ? (for example taxonomy/term/6/digital instead of CCTV/digital However default menu tab still work correctly and show the alias CCTV)
Is there any way to show the alias instead of taxonomy term address ?
I assume that you have a view that is filtering your taxonomy terms. If you render the results as fields, each field can have it's formatter. If you need a custom form of the output, you can define your own formatter or generate one via GUI with help of: custom formatters.
In case that you render your output as rendered entity, you need to find the right template file and use the drupal_get_path_alias() function within it.
As last I would hint you a great module that also might help you: taxonomy menu

Drupal 7 - How do I use pathauto taxonomy terms in views arguments

I have been banging my head against this problem all day. I'm using Drupal 7, and I'm trying to create a contextual filter that uses the pathauto string for a taxonomy term, not the taxonomy term ID.
So, I can make this work:
http://foobar.com/tags/1
But not:
http://foobar.com/tags/tagname
I have created a contextual filter of 'Content: has taxonomy term ID'. I have turned on the default taxonomy view and modified the path in it to try to create a URL that will work. I have gone into /admin/config/search/path/patterns and modified the taxonomy term path. As a result I can make the numeric ID appear in almost any URL with any prefacing text, but I can't get my view to use the pathauto-generated string for a taxonomy term instead of the taxonomy ID.
Any ideas? Am I missing something? All help is appreciated.
--Marshall
The default view "Taxonomy term," is using a contextual filter very similar to what you are trying to achieve, so possibly this could assist you in how to set something like this up. I would try creating a view of type taxonomy instead of content though.

Views Content Pane "Related content" by taxonomy

I'm currently developing a Drupal 7 site where I use Page Manager's "node_view" to customize the layout for my "Article" content type.
So, whenever viewing an Article I want to show a little box with "Related content".
I have a taxonomy vocabulary "Shared category" that I use in all my content types.
For example I also have a "Gallery" content type, so when viewing an article in with the "myTag" term - I want to show a Content Pane with images tagged with "myTag" from the "Shared category" vocabulary.
My question is about setting up the Contextual Filter for the Content Pane.
Should the "Argument input" be a Vocabulary or a Term? - I've tried both but can't get it to work.
Also I have another question: Is it possible to use a Content Pane as a block, that is shown with the Panel? - I guess not, sinse the Contextual filter value comes from Page Manager.
You won't want to manually input the argument in the panel, as it will vary for each article.
You'll want to set it automatically using a default argument that gets the tid from the node.
To get the related content block to show content based on the same terms as the node being viewed, you'd need to add a taxonomy term id argument to the view.
You can then try the 'Set a default argument' and use 'taxonomy term from URL' ( node option )
If that doesn't work, you may need to get the relevant tid from node using php code in the default argument area, with something like node_load or menu_get_object to load the node.
e.g something like
if($node = menu_get_object()){
if(isset($node->field_shared_category[$node->language][0]['tid'])){
return $node->field_shared_category[$node->language][0]['tid'];
}
}
Related content can be shown by using contextual filter in block views. This block view will contain content which are associated with the current content viewed by a user.
You can goto "Create related content block view based on terms in Drupal 7" blog post to get step by step instruction to create this block view.

Resources