0
Welcome Guest! Login
0 items Join Now

SOLVED Can you link the image in Content Cubes?

  • SOLVED Can you link the image in Content Cubes?

    Posted 4 years 8 months ago
    • Hi there,

      I am using a Content Cubes particle. Is there a way to link the image to the same location as the text link?

      I've had a look at contentcubes.html.twig and tried a few things around the line <img src="{{ url(item.image)|e }}" alt="{{ item.title|e }}" class="cube-image" />
      but cannot get it to work.

      Thanks for any help.
    • Damir's Avatar
    • Damir
    • Preeminent Rocketeer
    • Posts: 22450
    • Thanks: 2679
    • Web Developer

    Re: SOLVED Can you link the image in Content Cubes?

    Posted 4 years 8 months ago
  • Re: SOLVED Can you link the image in Content Cubes?

    Posted 4 years 8 months ago
    • Thanks
    • Damir's Avatar
    • Damir
    • Preeminent Rocketeer
    • Posts: 22450
    • Thanks: 2679
    • Web Developer

    Re: SOLVED Can you link the image in Content Cubes?

    Posted 4 years 8 months ago
    • I added this scss code:

      .g-contentcubes .cube-items-wrapper .cube-image-wrapper a.item-link {
      position: absolute;
      width: 100%;
      height: 100%;
      z-index: 9999;
      }

      and i modified the /particles/contentcubes.html.twig
      {% if item.link %}
          <a target="{{ item.buttontarget|default('_self')|e }}" class="item-link {{ item.buttonclass|e }}" href="{{ item.link|e }}"></a>
      {% endif %}

      This image is hidden for guests.
      Please log in or register to see it.


      I woudl suggets to copy this file to this location so it dont get overrriten on the next update of the theme:
      /custom/particles/contentcubes.html.twig
    • The following users have thanked you: Pure Glow Media

    • Available for CUSTOM WORK with Joomla, WordPress and Grav Templates and Gantry Framework!
  • Re: SOLVED Can you link the image in Content Cubes?

    Posted 4 years 8 months ago
    • Thanks very much Damir, that works great.
    • Damir's Avatar
    • Damir
    • Preeminent Rocketeer
    • Posts: 22450
    • Thanks: 2679
    • Web Developer

    Re: SOLVED Can you link the image in Content Cubes?

    Posted 4 years 8 months ago

Time to create page: 0.048 seconds