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: No translation of file url when using relationship-field

Status Resolved
Add-on / Version Publisher 3.1.2
Severity
EE Version 5.3

Verve -Webdesign und Grafik

Jan 28, 2020

Hi
Using this code in the template of an DE/EN website

{exp:channel:entries 
	channel="organisation" 
	disable="category_fields|member_data|pagination|trackbacks" 
	dynamic="no"
	orderby="date"
	dynamic_parameters="entry_id"
	sort="asc"
	}
		<h2 class="mt4">{title}</h2><h3>{cf_org_untertitel}</h3><dl class="row">
					{cf_org_gl}
					  <dt class="col-sm-6">{cf_org_gl:name}</dt>
					  <dd class="col-sm-6">{cf_org_gl:funktion}</dd>
				  {/cf_org_gl}
				</dl><h3>{cf_org_untertitel2}</h3><dl class="row">
					{cf_org_vr}
					  <dt class="col-sm-6">{cf_org_vr:name}</dt>
					  <dd class="col-sm-6">{cf_org_vr:funktion}</dd>
				  {/cf_org_vr}
				</dl>
<p>		{!-- ===================================================================================<br />
		PDF Docs zeigen, wenn vorhanden : aus Relationshsip<br />
		===================================================================================== --}<br />
		{cf_org_dokument}<br /></p><div class="mb-2">
<p>					<a href="{cf_org_dokument:cf_downloads_pdf_dokument}" target="_blank"><i class="fa fa-file-pdf-o"></i> {cf_org_dokument:title}</a>
					{!-- Hat es eine Beschreibung zum Dok? --}
					{if "{cf_org_dokument:cf_downloads_beschreibung}" != ""}
						<br>
						{cf_org_dokument:cf_downloads_beschreibung}
					{/if}
				</p>
</div>
<p>		{/cf_org_dokument}<br />
		{if count != total_results}<br /></p><hr>
<p>		{/if}<br />
{/exp:channel:entries}

The url of the file will not be translated and always will stay in the default lang DE
The title tag is translated as you can see.

 

#1

BoldMinded (Brian)

File URL values are paths on the file system, that isn’t something Publisher can translate.

Also, when sharing template code, its best to remove everything that is not relevant to the issue. E.g. extra html tags or other custom field tags. Tear it down to the minimum code to illustrate the issue, it’s easier to understand for someone who has not familiar with the site.

#2

Verve -Webdesign und Grafik

There is a channel called ‘downloads’ with entries in DE and EN Every entry contains a different title in DE and one in EN. Also containing a pdf in DE called filename-de.pdf and another in EN named filename-en.pdf

Now, as you can see in the following snippet, in a channel called ‘organisation’ I use a relationshipfield to to get these entries from the channel ‘downloads’

{exp:channel:entries channel=”organisation” disable=”category_fields|member_data|pagination|trackbacks” dynamic=”no” orderby=”date” dynamic_parameters=”entry_id” sort=”asc” }

{cf_org_dokument} {cf_org_dokument:title} <a href=”{cf_org_dokument:cf_downloads_pdf_dokument}”> {/cf_org_dokument}

{/exp:channel:entries}

The title will be translated but in DE and EN the file is twice the same (first one of default lang in DE)

Why doesn’t this work?

#3

BoldMinded (Brian)

Can you do me a favor and scroll to “The solution: Simplify” in this article I wrote https://u.expressionengine.com/article/debugging-in-expressionengine - This sounds like a very similar issue. Break down your template a little more, similar to what I did in the article, and create an additional entries tag displaying the entry that contains the file field, and see if the file field prints the correct value of the PDF in both languages. I want to determine if this is a Relationship issue or a File field issue so I know where to start looking.

Also, you provided CP login, but you didn’t tell me what entry id you were working with and how I can view the result on the front-end. Please create a debug template with just the template code from comment #2 in it, and the entries tags similar to what is mentioned in the article to simplify the bug.

#4

Verve -Webdesign und Grafik

Comment has been marked private.

#5

BoldMinded (Brian)

I’m unable to replicate this in my local environment. I even setup a new custom field “test_document” and in your environment I’m seeing the same issue happen. I did the same thing locally and it works fine. At this point you’ll need to setup new EE environment with Publisher installed and try to replicate the issue there. If you can’t replicate it in a new environment then the next step is to backup your database, and remove other 3rd party add-ons one by one until it hopefully starts working again.

#6

BoldMinded (Brian)

I’m closing this out b/c I can’t replicate it and no updates have been provided for over a month.

#7

Verve -Webdesign und Grafik

Comment has been marked private.

#8

BoldMinded (Brian)

Comment has been marked private.

Login to reply