Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2011-08-18 03:30:40
- WebmistressM
- Member
- Registered: 2011-08-12
- Posts: 61
Article Image Thumbnail Hyperlink -- Why Not To Itself?
Wondering how one miight use the article image as a thumbnail link.
I know this code below IS NOT correct as it just links to the article, (like say, from article listing view vs a single article view)
<txp:permlink><txp:article_image thumbnail=“1” /><txp:permlink>
Offline
Re: Article Image Thumbnail Hyperlink -- Why Not To Itself?
You want to link to the image or to the article associated with the image? Your question is unclear.
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
#3 2011-08-18 05:53:16
- WebmistressM
- Member
- Registered: 2011-08-12
- Posts: 61
Re: Article Image Thumbnail Hyperlink -- Why Not To Itself?
I want to link to the article image’s “large” version from a thumbnail.
Offline
Re: Article Image Thumbnail Hyperlink -- Why Not To Itself?
how about?
<a href="<txp:images><txp:image_url /></txp:images>"><txp:article_image thumbnail="1" /></a>
TXP Builders – finely-crafted code, design and txp
Offline
#5 2011-08-18 15:12:10
- WebmistressM
- Member
- Registered: 2011-08-12
- Posts: 61
Re: Article Image Thumbnail Hyperlink -- Why Not To Itself?
jakob wrote:
how about?
<a href="<txp:images><txp:image_url /></txp:images>"><txp:article_image thumbnail="1" /></a>
That seems to have worked. Earlier, I had tried to use the txp:images tag but it was producing strange results. I wasnt sure I could put that long bit of txp:images code inside the ahref’s value. Thanks so much for giving me a better clue on how to do this in the future.
Incidentally, my other admin is not as code savvy so I know I could of probably installed hak_tinymce (if it had been working) to make this easier in the future.
Offline
Re: Article Image Thumbnail Hyperlink -- Why Not To Itself?
Wherever possible I try and avoid any site editors from having to insert or even think about code like that. All of the above I put into a page template or form and design the page template so that it respond to whatever is entered in the article_image field (or custom_field, or category and so on). You need to use lots of txp:if… conditionals tags but you end up with a more robust site…
I wasnt sure I could put that long bit of txp:images code inside the a href’s value.
You can use lots of txp:tags in an html tag attribute such as the href in the example above. If you want to use the output of a txp:tag inside an attribute of another txp:tag, you have to place it in single quotes (like in the variable tag in the other thread). You can also use a whole series of tags in that situation (provided you nest them properly) but sometimes it is more readable (= easier to follow when you revisit it at a later date) to put the long details in a variable first, and then insert the variable as the tag in tag, particularly if you need to insert that code more than once.
TXP Builders – finely-crafted code, design and txp
Offline
Re: Article Image Thumbnail Hyperlink -- Why Not To Itself?
If you absolutly HAVE to put code in an article or have site editors do so them smd_macros may help.
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline