Question

Portal liquid template.

  • 19 May 2022
  • 1 reply
  • 69 views

Hi all.

I face with an problem implementing a custom theme for our portal home page.
we try to display a list of categories. each item need to link the category page with a list of articles.
out template look like this:

{% for category in portal.solution_categories %}
{% if category.folders_count > 0 %}
<div class="item">
<a href="{{category.url}}">
<img src="example.png" alt="{{category.name}}" />
<p>{{category.name}}</p>
</a>
</div>
{% endif %}
{% endfor %}

the the problem is with the URL generated from category.url.

the generated URL is incorect and point to not existing page which lead to 
redirect back to home page.

generated URL example: /support/solutions/72000072176

the original templete generate rigth URL: /support/solutions/folders/72000105646
original template example:
{{ category.name | link_to: category.url }} 
(which is just a wrapper for the name)

	{% for category in portal.solution_categories %}
{% if category.folders_count > 0 %}
<div class="cs-s">
<h3 class="heading">
{{ category.name | link_to: category.url }}
</h3>
<div class="cs-g-c">
{% for folder in category.folders %}
<section class="cs-g article-list">
<div class="list-lead">
{{ folder | link_to_folder_with_count }}
</div>
{{ folder | sub_folder_article_list:5 }}
</section>
{% else %}
{{ portal | filler_for_solutions }}
{% endfor %}
</div>
</div>
{% endif %}
{% endfor %}

how can i check whats the problem with the link generation?


templete creation was referenced from this doc and copyed from the original theme.
https://support.freshdesk.com/en/support/solutions/articles/65047-access-to-solutions

Thanks

Shimon.


1 reply

Badge +1

@Shimon Did you ever find a solution to this problem?

I’m actually trying to do this display but only for the category & folders that the current article is inside of. Do you know how I’d tweak this code to work for that?

Reply