CMS Development

VYadav7
メンバー | Elite Partner
メンバー | Elite Partner

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 いいね!
2件の承認済みベストアンサー
piersg
解決策
キーアドバイザー

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?

元の投稿で解決策を見る

VYadav7
解決策
メンバー | Elite Partner
メンバー | Elite Partner

Page Redirection

解決

I have used this code and it works fine

<script>
hbspt.forms.create({
region: "na1",
portalId: "2466330",
formId: "{{ module.download_assets_form_id }}",
inlineMessage: 'This page is redirecting...',
onFormSubmit: function($form){
setTimeout( function() {
window.location = "{{ request.query_dict.redirect }}";
}, 250 );
}
});
</script>

元の投稿で解決策を見る

0 いいね!
3件の返信
VYadav7
解決策
メンバー | Elite Partner
メンバー | Elite Partner

Page Redirection

解決

I have used this code and it works fine

<script>
hbspt.forms.create({
region: "na1",
portalId: "2466330",
formId: "{{ module.download_assets_form_id }}",
inlineMessage: 'This page is redirecting...',
onFormSubmit: function($form){
setTimeout( function() {
window.location = "{{ request.query_dict.redirect }}";
}, 250 );
}
});
</script>

0 いいね!
piersg
解決策
キーアドバイザー

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
HubSpot製品開発チーム
HubSpot製品開発チーム

Page Redirection

解決

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

0 いいね!