CMS Development

Raghavendra
Participant | Platinum Partner
Participant | Platinum Partner

if check box is checked in hubdb table that row data should display first

Raghavendra_0-1680257317501.png

if check box is checked in hubdb table that row data should display first, remaing data should display next. 

 

 

<div id="applynow" class="GrowingTeamOuterWrapper" style="background-color:{{ module.style.background_color.color }};padding: {{ module.style.padding_top }}px 0px {{ module.style.padding_bottom }}px;">
<div class="page-center">
<div class="GrowingTeamHeading">
<h2 style="color:{{ module.style.heading_color.color }};">{{ module.heading }}</h2>
<p style="color:{{ module.style.content_color.color }};">{{ module.content }}</p>
</div>
{% set query_param = "if(featured['checked']{ &orderBy=new_date })" %}
{% set table_headline = hubdb_table_column(module.hubdbtable_field, "region_v2").options %}
<div class="FilterColumn">
<select>
<option value="all">Filter by region</option>
{% for varName in table_headline %}
{% set region = varName.name %}
<option value="{{ region }}">{{ region }}</option>
{% endfor %}
</select>
<div class="pagination-container"></div>
</div>
{% set table_toget_col = hubdb_table_rows(module.hubdbtable_field, "&orderBy=new_date") %}
<div class="GrowingTeamInnerWrapper">
{% for row_toget_col in table_toget_col %}
{% if (row_toget_col['close_date'] >= unixtimestamp(local_dt))%}
<div class="GrowingTeamCol {% for row_multi in row_toget_col.region_v2 %} {{ row_multi.name|replace(' ', '-')|replace('/', '-')|replace('---', '-') }} {% endfor %}">
<div class="LabelCol">
<p>{% for row_multi in row_toget_col.region_v2 %} {{ row_multi.name }}{% if not loop.last %}, {% endif %} {% endfor %}</p>
</div>
<div class="HeadingWrapper">
<h2>{{ row_toget_col.job_title }}</h2>
</div>
<div class="DetailsWrapper">
<ul>
<li><img src="https://fs.hubspotusercontent00.net/hubfs/5217051/IQGeo-2021/Careers-Page/Icon%20feather-map-pin.svg"> {% for row_loc in row_toget_col.location %} {{ row_loc.name }} {% endfor %}</li>
<li><img src="https://fs.hubspotusercontent00.net/hubfs/5217051/IQGeo-2021/Careers-Page/Icon%20metro-calendar.svg"> Apply by: {{ row_toget_col.close_date|datetimeformat('%B %d %Y') }}</li>
</ul>
</div>
<div class="DescriptionWrapper">
<p>{{ row_toget_col.short_description }}</p>
</div>
<div class="BtnWrapper">
<a href="{{ row_toget_col.job_description_link }}">Find out more</a>
</div>
</div>
{% endif %}
{% endfor %}
</div>
<div class="pagination-container"></div>
</div>
</div>

 

0 Upvotes
2 Replies 2
ankitparmar09
Top Contributor

if check box is checked in hubdb table that row data should display first

if check box is checked in hubdb table that row data should display first

 

Hello @Raghavendra 

 

Thanks for the reaching out. I have solved your code. You can use that code.

 

<div id="applynow" class="GrowingTeamOuterWrapper" style="background-color:{{ module.style.background_color.color }};padding: {{ module.style.padding_top }}px 0px {{ module.style.padding_bottom }}px;">
<div class="page-center">
<div class="GrowingTeamHeading">
<h2 style="color:{{ module.style.heading_color.color }};">{{ module.heading }}</h2>
<p style="color:{{ module.style.content_color.color }};">{{ module.content }}</p>
</div>
{% set query_param = "&orderBy=date" %}
{% set table_headline = hubdb_table_column(module.hubdbtable_field, "region_v2").options %}
<div class="FilterColumn">
<select>
<option value="all">Filter by region</option>
{% for varName in table_headline %}
{% set region = varName.name %}
<option value="{{ region }}">{{ region }}</option>
{% endfor %}
</select>
<div class="pagination-container"></div>
</div>
{% set table_toget_col = hubdb_table_rows(module.hubdbtable_field, queryparam) %}
<div class="GrowingTeamInnerWrapper">
{% for row_toget_col in table_toget_col %}

{# Checkbox condiion #}
if(row_toget_col.featured) {
{% if (row_toget_col['close_date'] >= unixtimestamp(local_dt))%}
<div class="GrowingTeamCol {% for row_multi in row_toget_col.region_v2 %} {{ row_multi.name|replace(' ', '-')|replace('/', '-')|replace('---', '-') }} {% endfor %}">
<div class="LabelCol">
<p>{% for row_multi in row_toget_col.region_v2 %} {{ row_multi.name }}{% if not loop.last %}, {% endif %} {% endfor %}</p>
</div>
<div class="HeadingWrapper">
<h2>{{ row_toget_col.job_title }}</h2>
</div>
<div class="DetailsWrapper">
<ul>
<li><img src="https://fs.hubspotusercontent00.net/hubfs/5217051/IQGeo-2021/Careers-Page/Icon%20feather-map-pin.svg"> {% for row_loc in row_toget_col.location %} {{ row_loc.name }} {% endfor %}</li>
<li><img src="https://fs.hubspotusercontent00.net/hubfs/5217051/IQGeo-2021/Careers-Page/Icon%20metro-calendar.svg"> Apply by: {{ row_toget_col.close_date|datetimeformat('%B %d %Y') }}</li>
</ul>
</div>
<div class="DescriptionWrapper">
<p>{{ row_toget_col.short_description }}</p>
</div>
<div class="BtnWrapper">
<a href="{{ row_toget_col.job_description_link }}">Find out more</a>
</div>
</div>
{% endif %}
{% else %}
{% if (row_toget_col['close_date'] >= unixtimestamp(local_dt))%}
<div class="GrowingTeamCol {% for row_multi in row_toget_col.region_v2 %} {{ row_multi.name|replace(' ', '-')|replace('/', '-')|replace('---', '-') }} {% endfor %}">
<div class="LabelCol">
<p>{% for row_multi in row_toget_col.region_v2 %} {{ row_multi.name }}{% if not loop.last %}, {% endif %} {% endfor %}</p>
</div>
<div class="HeadingWrapper">
<h2>{{ row_toget_col.job_title }}</h2>
</div>
<div class="DetailsWrapper">
<ul>
<li><img src="https://fs.hubspotusercontent00.net/hubfs/5217051/IQGeo-2021/Careers-Page/Icon%20feather-map-pin.svg"> {% for row_loc in row_toget_col.location %} {{ row_loc.name }} {% endfor %}</li>
<li><img src="https://fs.hubspotusercontent00.net/hubfs/5217051/IQGeo-2021/Careers-Page/Icon%20metro-calendar.svg"> Apply by: {{ row_toget_col.close_date|datetimeformat('%B %d %Y') }}</li>
</ul>
</div>
<div class="DescriptionWrapper">
<p>{{ row_toget_col.short_description }}</p>
</div>
<div class="BtnWrapper">
<a href="{{ row_toget_col.job_description_link }}">Find out more</a>
</div>
</div>
{% endif %}
{# Close date condition #}
{% endif %}
{# End: Checkbox condition #}
{% endfor %}
</div>
<div class="pagination-container"></div>
</div>
</div>

 

0 Upvotes
Raghavendra
Participant | Platinum Partner
Participant | Platinum Partner

if check box is checked in hubdb table that row data should display first

it is not working, as expected, still it is sorting based on date not on checked field from hubdb

0 Upvotes