I have a project with Drupal.
I'm using Drupal 7.18.
I created a taxonomy called "Popularity" which has 3 elements: Popular,New,Most Rated.
I added a second language to drupal,
I translated my taxonomy into the second language. For ex,it is "Turkish".
I created a Content which has field related to that taxonomy. Let's say it is "C Programming".
I choosed "New" taxonomy item in related field.
After that, I translated the content that I have just created into Turkish,
now I have two contents, but they are translated form of each other.
Anyway then, the name "New" in English content turned to "Yeni" in Turkish content.My question is, when I create a view which shows "New" or "Yeni" Contents, I see two contents in table, but I want to see only the content which has same language with the current language of website.
Add a Content: Language filter to your view, set to Current user's language.
Related
What is the difference between name vs singular_name in Wordpress custom post types? Only name appears to have affect inside CMS.
The singular_name is used for the language in the CMS that should not be plural, whereas name is used for plural language (as you see in most of the CMS).
For example, if you go to Posts > Add New in the admin menu, you will see that the page heading reads "Add New Post".
In the wordpress core, it is using the singular_name to generate the word "Post".
When you add your own custom post type, the singular_name value of your custom post type will be used for the heading when adding a new post of your custom type.
There are also several other places in the CMS that use the singular_name value.
In addition, some themes will use the function get_post_type_labels() to get the singular_name and use it to generate information about what the user is reading. For instance, if your site sells foos and bars you could use the singular_name to generate a button that reads "buy this foo" or "buy this bar" without coding two separate buttons.
To read more about get_post_type_labels() see this page:
https://developer.wordpress.org/reference/functions/get_post_type_labels/
Here is a an example for visual learners:
I've just started learning Drupal 7 and I'm stuck on a problem.
I want to relate different content types using taxonomy. For example, how can I display blogs related to an article?
I know how to relate articles and basic pages but I don't know how can I relate blogs with articles?
Please help me.
Use reference field in blogs content type
like
field name is: related with
field type is reference
set reference type node
set node type is article
optional multivalued true
Now you have a relationship field in blogs
Now you can do every thing with this relationship
Hope this make sense
Thanks
You would create your taxonomy vocabulary and supply it with terms. On its own, this doesn't do anything, you need to add a field to each of your content types that are using this taxonomy.
If you go back to your content types, structure > content type > article. Here you would create a new field of type term reference. Inside the settings of the field you'd select your vocabulary and then also the widget eg. select list. You can re-use this field on the other content types where you want to share this vocabulary.
If you go back to your content for the types you added this field for and populate them with selections, when you view that page by default the term will appear as a link. If you click this link it will take you to a page view that will list all the other nodes that have that term form that vocabulary.
More information on taxonomies: https://www.drupal.org/docs/7/organizing-content-with-taxonomies/about-taxonomies
If you are creating a view and want to know how to pull in different tagged content there, I'd recommend reading this post which outlines the steps to do so https://drupal.stackexchange.com/questions/205921/how-do-i-show-related-content
The process:
Basic stages:
Create a “Content” view-block.
Add a contextual filter: “Has taxonomy term ID”.
Choose “provide a fixed value”.
(From type): “Taxonomy term ID from URL“.
Checking:
• Uncheck “Load default filter from the term page”. • Check “Load
default filter from node page, that’s good for related taxonomy
blocks”.
• Check “Limit terms by a vocabulary”. • Check your desired
vocabulary.
Select “Filter to items that share any term”.
Go down and check “Reduce duplicates”: This will several terms that relate to the same page – To appear. Only one will of them will.
in Drupal 7 you have two content types by default ("Article", "Basic page"). On this page www.site.com/admin/structure/types you can set up a new Content Type (e.g. "My type 1", "My type 2") having in mind your specific reasons. However, the list does not have a row height (ordering) option for this list and I am unable to find any solutions for that.
Given examples above, current Content Type list will always have the following sequence:
Article
Basic page
My type 1
My type 2
The problem is that when a content manager wants to create new content (www.site.com/node/add) he sees exactly same sequence of content type options and might intuitively choose "Article" rather than "My type 1" if not instructed.
In other admin pages like Blocks, Main Menu List Links etc. I have an option to move items up and down (or to "change weight"). How can I achieve the same for Content Type List, so that "Article" and "Basic" comes below "My type"?
I had the same problem, but never figured it out in a coding way. What I did is add a number before the name of content type. In your case, you can do like:
Content type:
1. Mytype
2. Article
3. Basic Page
If you want to do in a coding way, you need to hack into Drupal core, create a column in the database for content type, with auto increment. Then in drupal core, you need add a function to reorder the content type. But as you know, you will lose the change once you update drupal. Or you can create a custom module. Good luck
I have some texonomies in my Drupal website. Some of them have additional fields. I have some fields of type Term reference in my content-types.
When I am creating a new node of a content-type, I would like to have the ability to add a new term to the taxonomy while I'm filling the form of the Content-Type (with an "add item" link/popup...).
I can do that if I use Entity Reference fields, but I cannot using Term reference field. Could you help me, please?
Thanks
UPDATE: I installed "Taxonomy access fix" module (https://www.drupal.org/project/taxonomy_access_fix) and it allows me to set capabilities per each taxonomy based on user role. Now I only need to add a new term to a Taxonomy on a form level using Term reference field (I canno use autocomplete because I need the user to see all possible values like with a dropdown).
Any help?
If you change your widget to the autocomplete widget, it will let you add new values.
I agree with #Dark FlameS, in fact we are using the autocomplete widget for some of our students to add types of trees in the biology lab and they tag each with the scientific name.
And since we dont know these scientific terms, we let them add taxonomy terms to the list.
Slight difference however, we use the module Autocomplete Deluxe. Works like magic for us.
You are able to see what taxonomy terms are already available by clicking into the text area.
And as you type a taxonomy term, you will see what other terms are similar. If a tag is new, it will be added. one thing, dont allow them to delete your tags. We learned this the hard way.
See the image below on what it looks like as you add a tag.
Above is what you will see when you are adding the taxonomy field in your content type, this is after you install the Autocomplete Deluxe module
Above is What the user sees when they add or select a taxonomy tag.
I have to create a simple company blog within drupal-6. That means there should be only one single blog each user can post into.
What i have done so far is to create a custom content Type (blog) and a view that displays teasers of the recent blog entries with links to the full blog post.
Now i have to create a Tag-Cloud for this blog.
I created a taxonomy vocabulary for this "blog" content type and set the settings to Tags (Terms are created by users when submitting posts by typing a comma separated list.)
I also installed the Tagadelic Module and created a tag cloud with it, that works great and it displays all the Tags i entered when creating new blog entires.
But now to my problems:
First: If i click on an entry in this tag-cloud the default Taxonomy_term view is used to display the resulting blog entries. Thats bad because i would like to have it displayed the same way as in the view i already defined to show the blogs. Is there a way to use my view to display the results of the tag-cloud?
Second: On my view, below each blog-teaser should be a link to related blog entries (the ones that share the same terms). I do not have a clue how to do that.
is this even possible with the setting i have now or should i maybe take a whole other approach to create that company blog with tag clouds and related blog entries?
You should be able to solve both problems pretty easily, while keeping your current approach:
Take a look at your views list ('admin/build/views/list'). You should see a view called 'taxonomy_term (default)', which is usually disabled by default. This is an optional override of the built in taxonomy term page. You can enable this and configure it to look like the blog view you created.
Alternatively, you could leave that one disabled, but add another display of type 'page' to your already existing blog view, and configure that as an override to the built in taxonomy term. For this you'll need to set the path of that display to 'taxonomy/term/%' and adjust the display to use the term id argument as a filter (look at the above override for how this works).
You could also do it the other way round - use the default taxonomy_term override view, configure its output according to your blog view needs, and add another display for your recent blog entries to that. After this, delete your own blog view and use the new display of the taxonomy term override instead.