CMS Development

VYadav7
Membro | Parceiro Elite
Membro | Parceiro Elite

Page Redirection

resolver

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 Avaliação positiva
2 Solução aceitas
piersg
Solução
Conselheiro(a) de destaque

Page Redirection

resolver

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?

Exibir solução no post original

VYadav7
Solução
Membro | Parceiro Elite
Membro | Parceiro Elite

Page Redirection

resolver

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>

Exibir solução no post original

0 Avaliação positiva
3 Respostas 3
VYadav7
Solução
Membro | Parceiro Elite
Membro | Parceiro Elite

Page Redirection

resolver

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 Avaliação positiva
piersg
Solução
Conselheiro(a) de destaque

Page Redirection

resolver

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
Equipe de Produto da HubSpot
Equipe de Produto da HubSpot

Page Redirection

resolver

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

0 Avaliação positiva