CMS Development

JErkelens
Miembro

popular blog post rendering an invalid url

resolver

Hi
I'm trying to figure out why my Hubl code is resulting in a url error.
I have this code:

{% set pop_posts = blog_popular_posts('Named Blog', 5) %}
{% for pop_post in pop_posts %}
<a class="post-title d-block mb-3" href="{{ pop_post.absolute_url }}">{{ pop_post.name }}</a>
{% endfor %}

The expected output would be something like www.somesite.com/blog/some-article.
What I am getting is www.somesite.com/blog/blog/some-article.

 

I also tried, pop_post.slug. FYI


Can someone point me in the right direction as to why this isn't working?

0 Me gusta
1 Soluciones aceptada
Anton
Solución
Experto reconocido | Partner nivel Diamond
Experto reconocido | Partner nivel Diamond

popular blog post rendering an invalid url

resolver

Hi @JErkelens

I've tried your code with "Default" as blog and I'm getting the correct URL. 
Are you getting the .../blog/blog/... in the module preview or on the "live" page?

If it's in the live page - could you please check if you have something in the redirects? Maybe there is a /blog/ redirect set which collides. Also you can check your Blog settings(don't change anything - just check). maybe there's something wrong too.

 

If it's in the preview - could you please post the whole code here?

 

best, 

Anton

Anton Bujanowski Signature

Ver la solución en mensaje original publicado

2 Respuestas 2
Anton
Solución
Experto reconocido | Partner nivel Diamond
Experto reconocido | Partner nivel Diamond

popular blog post rendering an invalid url

resolver

Hi @JErkelens

I've tried your code with "Default" as blog and I'm getting the correct URL. 
Are you getting the .../blog/blog/... in the module preview or on the "live" page?

If it's in the live page - could you please check if you have something in the redirects? Maybe there is a /blog/ redirect set which collides. Also you can check your Blog settings(don't change anything - just check). maybe there's something wrong too.

 

If it's in the preview - could you please post the whole code here?

 

best, 

Anton

Anton Bujanowski Signature
sharonlicari
Administrador de la comunidad
Administrador de la comunidad

popular blog post rendering an invalid url

resolver

Hey @JErkelens 

 

Welcome to the Community and thank you for sharing this information. 

 

Hey @piersg @stefen @Anton could you please advise @JErkelens

 

Thanks

Sharon


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !




0 Me gusta