Hello,
I'm wondering why the term description is not filtered using description format when displaying the 'block' "term being viewed : description" inside a panel.
We use panels to override the default display of taxonomy/term/* pages. We display the term description using "Taxonomy term > term description" in panel "add content" dialog box. Description is displayed but only with _filter_autop and filter_xss_admin applied on it instead of using "filtered HTML" filter has it is currently defined in my term.
Related code is in the file ctools/plugins/content_types/term_context/term_description.inc line 23 :
$block->content = _filter_autop(filter_xss_admin($term->description));
And the fix for my problem is to replace this line by the following :
$block->content = check_markup($term->description, $term->format);
What is the reason why the filter set in term edit form is not used ?
Thanks !
Seb
Comment | File | Size | Author |
---|---|---|---|
#4 | ctools-formatTaxonomyDescription-1340950-4.patch | 670 bytes | pcavanaugh |
#3 | term_description_render-1340950-4.patch | 2.53 KB | idflood |
#2 | term-description.png | 34.06 KB | jenlampton |
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedHm. You are right; I would say this piece of content was not properly ported from D6. It is actually deprecated.
Instead, you should probably be using the Field for the term description instead of this content.
Comment #2
jenlamptonI stumbled across this too.
It turns out the term description is not a field, but see #569434: Remove taxonomy term description field; provide description field for forum taxonomy for more on that.
It looks like the code that is generating the broken Description pane is the "entity_context" and then "entity_field_extra" content type.
This is doubly confusing for the taxonomy entity, because it asks for a view mode. The only view mode that is enabled for terms by default is the "Default" view mode, and that is not an option in the pane config. If you choose the "Taxonomy term page" view mode, you probably won't get any output anyway.
Comment #3
idflood CreditAttribution: idflood commentedI have hit the same issue described in #3. I think it's not 100% identical as what is described in the original report. In my situation this happens when adding a term description referenced by a node. In this case this is the "ctools_entity_field_extra_content_type_edit_form" function which is called and not "ctools_term_description_content_type_render".
I've attempted to fix this but I doubt this is the best way to do that. I've also added the fix described in #0 since this seems good (but not tested on my side).
Comment #4
pcavanaugh CreditAttribution: pcavanaugh commentedThe patch/fix in #0 works for me. I don't have a test case for the additional problem described in #3. Here is my patch similar to that in #0.
Comment #5
aminalid CreditAttribution: aminalid commentedAlso the "term being viewed : description" pane do not work correctly with translations, it always output the original text.
I solved this by using a custom content pane and using the term context variables "%term:i18n-name", "%term:i18n-description".
Another option could be adding a new field to replace the description.
Hope this is useful here.
Comment #6
merlinofchaos CreditAttribution: merlinofchaos commentedMake sense. Committed the patch in #4.