jDownloads Support Forum

Older Versions => jDownloads 3.2 (Support ended) => General => Topic started by: dyfrig on 10.11.2018 13:00:57

Title: Text in layouts on multilingual site
Post by: dyfrig on 10.11.2018 13:00:57
I have created a files layout which looks like the attached image

The date and meeting columns are custom fields.

I did this with the following lines

Use before Layout
 

  <table class="cyfarfodydd">
  <tr><td>Date</td><td>Meeting</td><td>Click below to view document</td></tr>
Layout
  <tr><td>{custom_value_11}</td><td>{custom_value_2}</td><td>{file_title}&#160;{file_pic}</td></tr>
Use after Layout
  </table>

My problem is that this is a bilingual site, but the column headers are in one language only.  I tried to put language codes in the Use before Layout section, but they were not parsed. I also tried to use {custom_title_11} etc in column header but that also appeared literally on the page.  Can you suggest a way this could be achieved.


[gelöscht durch Administrator]
Title: Re: Text in layouts on multilingual site
Post by: dyfrig on 11.11.2018 15:44:41
 I have managed to achieve the desired effect as follows

Use before layout



<table class="cyfarfodydd">
  <tr>
    <td><span class="cygb">Dyddiad</span><span class="engb">Date</span></td>
    <td><span class="cygb">Cyfarfod</span><span class="engb">Meeting</span></td>
    <td><span class="cygb">Cliciwch isod i weld dogfen</span><span class="engb">Click below to view document</span></td>
  </tr>



Then in the CSS

  span.engb:lang(cy-GB) {display:none;}
  span.cygb:lang(en-GB) {display:none;}



If you can suggest an easier way then please do so otherwise please consider matter resolved.
Title: Re: Text in layouts on multilingual site
Post by: ColinM on 11.11.2018 18:03:19
Hi
I was about to reply when your solution appeared!!  Your solution is of turning off the display when the current language does not match is very neat for a pair of languages.  I am not experienced at multi languages so had to look up the relevant css!! 

In the next jD series (jd3.9) the special jD Custom fields willl no longer be supported and use will be made of the new Joomla Fields.  I suspect the initial version of jd3.9 will have liimited support for Joomla Fields.
My only other comment is that tables are sometimes trouble on small devices.  You basic solution should work fine with divs and using jd_clear as required.Colin