Author Topic: Text in layouts on multilingual site  (Read 147 times)

0 Members and 1 Guest are viewing this topic.

Offline dyfrig

  • Newbie
  • *
  • Posts: 2
Text in layouts on multilingual site
« 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>
Use after Layout

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.
« Last Edit: 10.11.2018 13:11:14 by dyfrig »

Offline dyfrig

  • Newbie
  • *
  • Posts: 2
Re: Text in layouts on multilingual site
« Reply #1 on: 11.11.2018 15:44:41 »
 I have managed to achieve the desired effect as follows

Use before layout

<table class="cyfarfodydd">
    <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>

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.

Offline ColinM

  • Moderator
  • *
  • Posts: 3.704
Re: Text in layouts on multilingual site
« Reply #2 on: 11.11.2018 18:03:19 »
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