Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Question about publisher_fields

Status Resolved
Add-on / Version Publisher 1.6.2
Severity
EE Version 2.9.2

Gavin Lawrie

Apr 01, 2015

This is probably a typo or something, but would value help with resolving it.

Have some simple test code to expose values of publisher fields for items in a channel:

<body>
                 <div  smaller; color: black; direction: ltr; background-color: #35508e;">
                        {exp:publisher:switcher style="links"}
                 </div>
{exp:channel:entries channel="person" status="open|Open_fr|Open_ar" dynamic="no publisher_fields="y""}

                    <!--                  here is the start -->
                 <div  smaller; color: black;">
                     <table>
                         <tr>
                             <td>Name</td><td>{name_in_english}</td>
                         </tr>
                         <tr>
                             <td>has newer draft?</td><td>{has_newer_draft}</td>
                            </tr>
                            <tr>
                                <td>is translation complete?</td><td>{is_translation_complete}</td>
                            </tr>
                            <tr>
                                <td>has translation?</td><td>{has_translation}</td>
                            </tr>
                            <tr>
                                <td>has pending approval?</td><td>{has_pending_approval}</td>
                            </tr>
                            <tr>
                                <td>publisher lang id</td><td>{publisher_lang_id}</td>
                            </tr>
                            <tr>
                                <td>publisher status</td><td>{publisher_status}</td>
                            </tr>
                     </table>
<p>                    </p>
</div>
<p>                    <!-- here is the end --><br />
{/exp:channel:entries}</p>

<p></body>

This generates a list of entries, and when English is the chosen language it populates the “publisher_fields” appropriately if there is a value set, or repeats the publisher_fields tag if not.
However when Arabic or French is chosen (the two other languages) the publisher_fields that have a value are reported with blanks rather than populated with a value.

See screen grabs of the alternative scenarios below.  The test page can be viewed at http://v7a.2gc.org/en/pages/pubtest

The first entry in the list (Chris Bragg) has translations available (published) in both English and Arabic, but not French.

Grateful for any guidance as to what am I doing wrong.

#1

BoldMinded (Brian)

Unless this is a bad copy/paste it looks like your quotes are in the wrong spot

dynamic="no publisher_fields="y""}
#2

Gavin Lawrie

Ahah! Well that helps for the English version. But publisher_field values reported in French / Arabic versions are still blank.

#3

BoldMinded (Brian)

That doesn’t make much sense, but I’ll try to replicate locally. I glanced over the code again and there isn’t anything limiting it to the default language.

#4

BoldMinded (Brian)

Gavin, I wasn’t able to replicate this, the fields seemed to be working fine for me.

#5

BoldMinded (Brian)

Comment has been marked private.

#6

BoldMinded (Brian)

Comment has been marked private.

#7

Gavin Lawrie

Comment has been marked private.

#8

Gavin Lawrie

Hi again - sorry to be such a pain with this.

Here is an example of a simple filter on a channel that previously was done using ‘status’ but I’d like to do using the publisher_field variables.

{exp:channel:entries channel="news" orderby="date" sort="desc" dynamic="no" status="{embed:status}"}

If I remove the ‘status=’ term I have been able to obtain the list I want by using an {if} within the channel loop <pre><code>{exp:channel:entries channel=”news” orderby=”date” sort=”desc” dynamic=”no” publisher_fields=”y”} {if has_translation} … do stuff … {/if} {/exp:channel:entries}</code></pre>

Is there a way I can use the publisher_field value in the channel filter itself? When I try <pre><code>{exp:channel:entries channel=”news” orderby=”date” sort=”desc” dynamic=”no” publisher_fields=”y” has_translation=”1”}</code></pre> it fails, but perhaps I’ve got the syntax wrong or something.

If not, no worries - I can live with the {if} solution I think.

#9

Gavin Lawrie

In passing, another weird thing perhaps you can advise upon.

The filter

{if has_translation}
... do stuff ...
{/if}

only appears to find entries for which at least two published language translations exist.

So, when the site is set to english, the {if} clause above only finds entries for which a published Arabic or French version exists: entries that appear only with a default language version, or for which only drafts in another language have been saved, will not be found by this search.

Any idea why this is so?

#10

Gavin Lawrie

To clarify the above question / example - when site language is set to English, the {if} clause will only find entries for which at least two published language translations exist…

#11

BoldMinded (Brian)

Using {if} is the only way to use those right now, they aren’t available as a parameter tag.

only appears to find entries for which at least two published language translations exist.

Correct, those two should be the default language, and any other language. Its looking to see if any translation has been created for a language other than the default. If an entry is created only in the default language, then it does not have a translation.

#12

Gavin Lawrie

OK - got it. Thanks. I got the search I wanted using this

{if has_translation OR (publisher:current_language_code=="en" AND !has_translation)}

which doesn’t strip entries in default language only from the listing when default language is chosen - without this you only get the default language version of entries that have been translated.

Login to reply