Question

Photo of Herman Is

0

How to make uploaded file links clickable (not via "View Button")?

Hello,

Can anyone help please? I'm updating / customising the layout for RockCMS...

How to make uploaded file links clickable(not via "View Button")? Kindly refer to attached screenshot...

question1.png

Backend - I have a file upload mechanism

Public view... What we have now - To open the uploaded file, we have to click "View button". "Content Title" is not clickable

What we would like to have - To make "Content Title" clickable and hide "View button"...

Thank you

Ferdy

  • Photo of Michael Allen

    1

    You can get the URL for your file attribute by using {{ item | Attribute:'File','Url' }}

    Something like this should work to make your title appear as a link: <a href="{{ item | Attribute:'File','Url' }}">{{ item.Title }}</a>

  • Photo of Austin Barnett

    0

    What type of block are you using to display the list of files?

  • Photo of Herman Is

    0

    Hi Austin,

    I use "Content Channel View" - is this not ideal?

    Thank you

    Ferdy

    • Austin Barnett

      no, that should work fine. What is the Lava that you have in the Content Channel View block? Where it says Format

  • Photo of Herman Is

    0

    Hi Austin,

    In "Format" we have...

    <h3>Policies and Procedures</h3>

    {% assign itemCount = Items | Size %}

    {% if itemCount > 0 %}
        <ul>
            {% for item in Items %}
                <li>
                    { item.Title }}&nbsp;&nbsp;{{ item.File }}<br>
                </li>
            {% endfor %}
        <ul>
    {% else %}
        There are no content to show in this view.
    {% endif %}

    Thank you

    Ferdy

  • Photo of Herman Is

    0

    Hi Michael,

    It works well - thank you so much - you are awesome!!

    Appreciate it!

    Ferdy