Hi there. I’m new to hubl and the design manager. I’ve created a module and I’m trying to link to a page using the (Page) field, but it’s not working. It should be really simple but I don’t know where I’m going wrong. Can someone help? He is my code:
{% set pageURL = page_by_id(item.recentpost_link) %}
<section class="home-posts">
<div class="container recent-posts">
<h1 class="underline">{{ module.title_intro.title }}</h1>
<p class="posts-intro">{{ module.title_intro.introduction }}</p>
<div class="recent-posts__cntr">
{% for item in module.info_card %}
<div class="card">
<div class="card__image__holder">
<a href="{{ pageURL }}">
<div class="card__image" style="background-image:url('{{ item.image.src }}');"></div>
</a>
</div>
<div class="card__text">
<h3><a href="{{ pageURL }}">{{ item.title }}</a></h3>
<p>{{ item.descriptive_text }}</p>
</div>
</div>
{% endfor %}
</div>
</div>
</section>
in the page itself I can select a page successfully, but when I publish it and look at the code there is no link.
<div class="card">
<div class="card__image__holder">
<a href="">
<div class="card__image" style="background-image:url('https://cdn2.hubspot.net/hubfs/4552700/Piston.jpg?t=1540212077293');"></div>
</a>
</div>
<div class="card__text">
<h3><a href="">This is the title of post 2</a></h3>
<p>This is the default text here. Replace it with something interesting!</p>
</div>
</div>
Any ideas? Thanks in advance!