Hi
A weird little one here, because this really ought to be very simple but it is not working, as far as I can tell...
I have a clonable page "foreign-requirements.php" with these editables:
I wish to display the countries in a table - so for the code for displaying all cloned pages I have this:
This code works perfectly for generating a table of the pages, all of the features work well, except for the orderby. I currently (as a test) have pages with country_code US and CA and I cannot get the rows to display in alphabetical order - surely the 'orderby' ought to fetch the pages based on the two letter text field country_code. I have tried 'asc' and 'desc' and it makes no difference.
Please help!? Thank you
A weird little one here, because this really ought to be very simple but it is not working, as far as I can tell...
I have a clonable page "foreign-requirements.php" with these editables:
- Code: Select all
<cms:template title='Foreign Country Requirements' clonable='1' icon='globe' order='6'>
<cms:editable name='country_code' label='Two-Letter Country Code' desc='Please be sure to use the ISO 3166 Country Code' type="text" maxlength="2" searchable="0" required="1" validator='exact_len=2 | alpha' validator_msg='exact_len=The Country Code field must be exactly 2 letters | alpha=The Country Code must only use the letters A-Z' />
<cms:editable name='continent' label='Continent' type='dropdown' desc='Select one of these' opt_values='Please Select=- | Africa=africa | Asia=asia | Europe=europe | North America=north_america | South America=south_america | Oceania=oceania' required="1" validator_msg='required=You must select a Continent!' />
<cms:editable name='patent_doc' label='Upload the Patent Requirements pdf document here' desc='Leave blank if document does not exist' type="file" />
<cms:editable name='tm_doc' label='Upload the Trade Mark Requirements pdf document here' desc='Leave blank if document does not exist' type="file" />
<cms:editable name='design_doc' label='Upload the Design Requirements pdf document here' desc='Leave blank if document does not exist' type="file" />
<cms:config_form_view>
<cms:field 'k_page_title' label='Country Name' />
</cms:config_form_view>
</cms:template>
I wish to display the countries in a table - so for the code for displaying all cloned pages I have this:
- Code: Select all
<thead class="thead-dark">
<tr>
<th colspan="3" style="text-align:left; white-space: nowrap; border-right: 1px solid;" scope="colgroup">Country</th>
<th style="text-align:center; white-space: nowrap;" scope="col">Patents</th>
<th style="text-align:center; white-space: nowrap;" scope="col">Trade Marks</th>
<th style="text-align:center; white-space: nowrap;" scope="col">Designs</th>
</tr>
</thead>
<tbody>
<cms:pages orderby='country_code' order='asc' >
<tr>
<th class="country_code" style="text-align:center; white-space: nowrap;" scope="row"><a href="https://www.wipo.int/directory/en/details.jsp?country_code=<cms:show country_code />" data-toggle="tooltip" data-placement="right" title="See this country on WIPO"><cms:show country_code /></a></th>
<td class="country_flag" style="text-align:center; white-space: nowrap;"><img src="https://flagcdn.com/h20/<cms:show country_code />.png"></td>
<td class="country_name" style="text-align:left; white-space: nowrap; border-right: 1px solid;"><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></td>
<td class="patent_requirements" style="text-align:center; white-space: nowrap;"><cms:if patent_doc ><a href="<cms:show patent_doc />" target="_blank" data-toggle="tooltip" data-placement="right" title="See this factsheet"><i class="fas fa-check-circle"></i></a><cms:else /><i class="far fa-times-circle"></i></cms:if></td>
<td class="tm_requirements" style="text-align:center; white-space: nowrap;"><cms:if tm_doc ><a href="<cms:show tm_doc />" target="_blank" data-toggle="tooltip" data-placement="right" title="See this factsheet"><i class="fas fa-check-circle"></i></a><cms:else /><i class="far fa-times-circle"></i></cms:if></td>
<td class="design_requirements" style="text-align:center; white-space: nowrap;"><cms:if design_doc ><a href="<cms:show design_doc />" target="_blank" data-toggle="tooltip" data-placement="right" title="See this factsheet"><i class="fas fa-check-circle"></i></a><cms:else /><i class="far fa-times-circle"></i></cms:if></td>
</tr>
</cms:pages>
</tbody>
This code works perfectly for generating a table of the pages, all of the features work well, except for the orderby. I currently (as a test) have pages with country_code US and CA and I cannot get the rows to display in alphabetical order - surely the 'orderby' ought to fetch the pages based on the two letter text field country_code. I have tried 'asc' and 'desc' and it makes no difference.
Please help!? Thank you