I have added an image field to a vocab. This allows me to create a new term and associate an image with that term.
When I create a new content type I want to add a Term Reference field but display the image and not the term.
Any ideas on how to achieve this?
Maybe you can use:
https://www.drupal.org/project/taxonomy_image
or also templating the content type you can put the image into the description or a new field into taxonomy and use taxonomy therm page at the display.
Regards.
Related
Let's say I defined a IBM WCM authoring template called "AT-Image"; it creates content item "CT-Image" that contains elements such as an Image of type "Image", Description of type "Short Text", Keywords of type "Text", and other fields that serve as meta for that image resource.
Now, I need to create a content item called "CT-Article" based off from its "AT-Article" authoring template. Let's say that "Article" item has 3 elements: Title, Summary, and Image. Title and Summary are of type "Short Text". But Image needs to be of type "CT-Image" and not Image or Image component.
Is this possible Out-of-the-Box or is this something I need to implement myself via WCM API?
From my point of view you should use a menu component in the following way:
Let's assume you have got your CT-Image and CT-Article in a common sitearea called "MyArticle" like this:
MyArticle
CT-Article
CT-Image
Furthermore you need a WCM Menu component which uses two selection criteria:
current sitearea as location
CT-Image as authoring template
So then rendering CT-Article with a presentation template PT-Article you can reference the menu component. Therefore, you reference the menu component in the presentation template markup. The menu component then will pick up the CT-Image and render it as it is located in the same sitearea as your CT-Article.
That's rather a content design approach then a technical approach. It's all there out-of-the-box and saves custom development effort.
If I understand correctly, basically you want to create pre-defined images and then pick one of them to display when you create an article. Correct?
Well, the easiest way would be to utilize what WCM already gives you: create an Image Component. You will be able to upload the image and also provide a description, but you won't be able to set keywords or metadata. The workaround for this would be to set the keywords/metadata as part of the article. If that is okay, this would probably be the best way to do it.
By doing that, all you would have to do is select the relevant Image Component from your Image Element in AT-Article.
If you really need the images to be their own content items (rather than components) so that they have their own keywords and other information, then the next "easiest" way is probably to use an HTML Element inside AT-Article. In this HTML Element you will have to use the "Insert Tag" option, and then choose an Element Tag and use "Selected" rather than "autofill" or "current" to navigate to the content item that you want (the one with the image).
The code will look like this:
[Element name="[path]" type="content" context="selected" key="[element]"]
Where [path] is the path to the content item and [element] is the element that you actually want to pull from that content item (such as image, description, keywords, etc.)
context="selected" is the key there. Then you just need to set up your Presentation Template to be able to use this information that you are pulling in from the HTML Element.
WCM 8.5 has the InContext tag.
The InContext tag renders a tag body within a specified context. The new context can be specified as a predefined context by using a UUID, or by path.
For eg. in this case you can use below where key="Image" in InContext tag is the Link element to the CT-Image content item :
[InContext uuid="[Element context='current' type='content' key='Image' format='id']"]
[Element context="current" type="auto" key="Image"]
[Element context="current" type="auto" key="Description"]
[/InContext]
On my taxonomy term pages for a specific vocabulary I want to display the child terms and any products associated with those child terms.
My taxonomy for this vocabulary is 2 levels deep in some areas and 3 levels deep in others.
I can override the default taxonomy page with a view based on CONTENT but that doesn't easily allow me to display the child terms AND associated products.
I have sucessfully created a view based on TERM that will display child terms AND associated products correctly but Drupal is serving the default taxonomy page over this view even though this view's URL is set correctly.
I assume it is because Drupal wants to display a content view for a taxonomy term by default.
Is there anyway to override this behaviour or another way to accomplish this?
Can I use a page preprocess function to set a specific view and override the default taxonomy page?
The only other possible solution I have would be to create a custom template for the vocabulary and manually query the database for what I need.
You might need to use the path "taxonomy/term/%" instead of just "taxonomy/term".
Using TVI module might help you overriding default taxonomy views
The TVI (Taxonomy Views Integrator) module allows selective overriding
of taxonomy terms and/or vocabulary with the view of your choice.
Using TVI you can easily create custom views to output all terms in X
vocabulary.
I have a view which shows title and an image to the article where an image is uploaded within any post. This is shown through a block in a region.
It looks something like this:-
I show it on top of a landing page of a taxonomy; the landing page of the taxonomy page has all the articles which come under the respective taxonomy. Here lies the problem.
I want the article which is returned by the view to be from the taxonomy which shows it. Right now, an article is returned whichever has an uploaded Featured Image; what I Want is that the view returns an article which has an uploaded image and it belongs to the same category (taxonomy) of which landing page I am opening.
Thanks.
Add a Taxonomy Term ID contextual filter to the view. Then choose to provide a default argument, and under type choose Taxonomy Term ID from URL.
I'm new to Drupal, and I'm working with a content panel.
I want to create a news content containing a 'category' taxonomy reference field. However, my vocabulary has 2 levels and over 100 terms, so it's hard to choose an category using the simple widgets.
I don't want to create new add content panel, but the panel of Drupal. So any ideas for that?
Try using the Hierarchical Select module.
There's also a tutorial on how to use it at http://eureka.ykyuen.info/2012/05/29/drupal-7-mutiliple-selection-list-for-taxonomy-using-hierarchical-select/.
(The one caveat is that there isn't yet support for using it with exposed Views taxonomy fields.)
I am new in drupal 7 and I want to create one view blog in which I can list out taxonomy as category and in under that I want to display two articles and a read more link to that category. Can any one explain in details how can i do that.
If you use a content type with a Term reference field for your category, it wil automatically create pages for each category with the articles tagged with that category listed within it.
If you want to have more control over these pages generated by the Taxonomy module, you can turn on the Taxonomy Term example view in de Views UI and add and remove the fields you want to display. The layout of these pages can be edited by creating a custom template file in you themes template folder for the file page--taxonomy.tpl.php.
There you could als create an additional block display (I assume you mean block when you say blog), and in the Page settings area, you can turn on de More link, and this will display a more link when more articles are available then you have set you pager to display (i.e. Use pager - Display a specified number of items - Items per page = 2). Make sure you change de setting from For all displays to This block (override) to not override the other displays.
This block you can place in any region on any page via the Blocks UI and is should do what you want.