I did an update to a site I have in development right now from 2.7 to 2.8 and found out it broke one of the views. Basically I have a couple of fields that need to be rewritten into one field. Specifically, Node:title, Content: Author, Taxonomy: All Terms, and another Taxonomy: All terms. They are being rewritten like so.
<div class="article-info">[title]
<div class="author-taxonomy">By: <em>[field_article_author_uid]</em> in: <em>[tid]</em></div>
<div class="topics">Topics: <em>[tid_1]</em></div>
</div>
The first taxonomy does not create any problems because it is only showing which category the article is in, but the second has multiple topics (tags) that the article has listed. With 2.7 it would list the terms with commas as expected, but with the upgrade to 2.8 this entire field including all of the code above is outputted for each term with a comma in between.
Example of what it looks like in 2.8 (the outputted code):
<div class="article-info">[title]
<div class="author-taxonomy">By: <em>[field_article_author_uid]</em> in: <em>[tid]</em></div>
<div class="topics">Topics: <em>[tid_1]</em></div>
</div>
,
<div class="article-info">[title]
<div class="author-taxonomy">By: <em>[field_article_author_uid]</em> in: <em>[tid]</em></div>
<div class="topics">Topics: <em>[tid_1]</em></div>
</div>
,
<div class="article-info">[title]
<div class="author-taxonomy">By: <em>[field_article_author_uid]</em> in: <em>[tid]</em></div>
<div class="topics">Topics: <em>[tid_1]</em></div>
</div>
...
It should only write all of the content once and then replace [tid_1] with the comma separated list of terms. Any more information can be provided.
| Comment | File | Size | Author |
|---|---|---|---|
| my view.txt | 6.9 KB | jdwfly |
Comments
Comment #1
merlinofchaos commentedThis was actually an improvement designed to allow people to rewrite the individual terms. In order to accomplish what you were previously doing, you will need to create a new field (There is a Global: Custom Text field), set your taxonomy field to exclude, and put the rewrite you have in the custom text.
Comment #2
jdwfly commentedDoes this work the same for all fields or just this one field?
I already knew I could do that with a Custom Text field, but I wanted to make sure there wasn't some type of weird bug introduced by 2.8.
Comment #3
dawehnerJust what earl says this is by design
Comment #4
gillesv commentedI'm facing the same problem.
On one hand, it's nice that you can rewrite each individual term, BUT on the other hand, it's annoying when you want to wrap it all in one tag.
You mention Custom Text Field; but there's a problem with that one:
Unlike the field itself, the custom textfield does not know if the targeted field/token is empty or not. So if I want to display all terms inside a container, but only if the there are terms available, I have a problem. The container element will always be displayed, whether there are terms to display inside or not.
Is there an easy solution for this?
Comment #5
merlinofchaos commentedWe probably need multiple fields to provide a prefix/suffix field so you can wrap the rewrite.
Comment #6
gillesv commentedThanks for picking this up, Merlin.
(I'm using Views 3 on Drupal 7, btw.)
Comment #7
mustanggb commented