Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-02-27 05:30:22

sochicomputerRU
Member
From: Россия
Registered: 2013-01-18
Posts: 61
Website

data-popup - how to get article image href

Hello, I have a gallery feature with code like this

<a href=“pic.jpg” class=“thumb” data-popup title=“some title”>

Key feature here is data-popup, which makes the image popup in a popup thingy, without data-popup image opens on a new page. The way I see it is that I need to get a URL of an article image and assign it to href, same for title. So how to do that?

Offline

#2 2016-02-27 06:55:59

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,172
Website GitHub Mastodon Twitter

Re: data-popup - how to get article image href

Here’s a method

<txp:images id='<txp:custom_field name="article_image" />'><txp:image_url /></txp:images>

and implementing it in your code

<txp:article>
<a href="<txp:images id='<txp:custom_field name="article_image" />'><txp:image_url /></txp:images>" class="thumb" data-popup title="<txp:article_title />">
</txp:article>

Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB