CMS Development

VYadav7
Member

Page Redirection

this url is not redirecting to respective url please help me out

 <div class="container" id="tab3C">
<div class="portfoliolist" id="whitepapers_portfoliolist">
{% for row in hubdb_table_rows(5311014, "status=Published&orderBy=-hs_created_at") %}
{% set sentence_whitepapers_title = row.whitepapers_title %}
{% set sentence_all_offerings = row.all_offerings %}
{% set sentence_all_industry = row.all_industry %}
<div class="whitepapers-hide mix portfolio all-offerings all-industry {{sentence_all_offerings.name|lower|replace(' ', '-')|replace(' ', '')}} {{ sentence_all_industry.name|lower|replace(' ', '-')|replace('-&-', '-')}} {{ sentence_whitepapers_title|lower }}" data-filter-item data-filter-name="{{ sentence_whitepapers_title|lower }}">
<div class="portfolio-wrapper">
{% if row.whitepapers_image %}
<img src="{{ row.whitepapers_image.url }}" alt="{{ row.whitepapers_title }}">
{% else %}
<img src="{{ get_asset_url('../images/resources-image.png') }}" alt="Image" />
{% endif %}
<div class="label">
<div class="label-text">
<div class="text-title match">{{ row.whitepapers_title|truncatehtml(80, '...' , false) }}</div>
<div class="text-description">{{ row.whitepapers_description|truncatehtml(90, '...' , false) }}</div>
<div class="view-link">
{% if row.is_it_gated.name== 'Yes' %}
<a href="{{ domain }}/download-whitepapers/?redirect={{ domain }}/whitepapers/{{ row.hs_path }}" class="text-link gettedform" target="_blank">Download</a>
{% else %}
<a href="{{ domain }}/whitepapers/{{ row.hs_path }}" class="text-link" target="_blank">Download</a>
{% endif %}
</div>
</div>
</div>
</div>
</div>
{% endfor %}
<div class="load-more-button" style="display: none;">
<a href="javascript&colon;void(0)" class="whitepaper-load-more button">Load More</a>
</div>
</div>
</div>

0 Upvotes
2 Replies 2
piersg
Key Advisor

Page Redirection

Have you set {{ domain }} somewhere in your code that you haven't copy pasted here? If not, it's not a valid HubL variable, you need {{ request.domain }} and you need to add the protocol to it, e.g.

href="https://{{ request.domain }}/download-whitepapers?redirect={{ request.domain }}/whitepapers/{{ row.hs_path }}"

 

Are you reading the "?redirect" url parameter with JS and doing something with it based on some event e.g. form submission?

dennisedson
Community Manager
Community Manager

Page Redirection

@piersg , what are you thoughts on this redirect mayhem? 😎

Thanks,

Dennis




HubSpot Community Developer ShowMake sure to subscribe to our YouTube channel
where you can find the HubSpot Community Developer Show
0 Upvotes