Question: the best way to make a clickable image.

27 views
Skip to first unread message

Anton Aylward

unread,
Sep 14, 2015, 2:06:19 AM9/14/15
to Radiant CMS
On one page I have this:


<div style="float:right; background: #FAF0E6; border: outset 3px #33f; padding: 2px 5px 2px 0; margin: 0 0 0 10px; text-align: center;">
  
     <r:asset:image id="86" width="520px"></r:asset:image><br /><b>"label"</b>
     <r:asset:link id="86" text="Click here for full size" />
 
</div>

Honestly, it feels clunky.
I'd like a simple clickable image.

Surely there's a something structured like

<r:asset id="86" >
      <r:image width="520px">
     <r:link />
   </r:image>
</r:asset>

But I can't get that to work.
Am I on the wrong track?

Anton Aylward

unread,
Sep 14, 2015, 2:20:22 AM9/14/15
to Radiant CMS
The best so far is this

<div>
<r:asset:link id="48" >
   <r:asset:image id="48" height="157px"/>   
</r:asset:link >
</div>


But I'm still not happy.

Mohit Sindhwani

unread,
Sep 15, 2015, 2:17:37 PM9/15/15
to radia...@googlegroups.com
--

Do you program?  If yes, it could be quite easy to put this into a simple plugin... it has been terribly long since I wrote anything, but it wasn't too difficult in an older version of Radiant.

Specifically, what's the output HTML that you're looking to generate?

Best Regards,
Mohit.

Anton Aylward

unread,
Sep 16, 2015, 8:37:20 AM9/16/15
to Radiant CMS, te...@onghu.com
No I avoid "programming" in favour of higher level coding.
That's the whole point of using the powerful Radiant "<r:>" tools

Why not some kind of parametrized snippet?

The HTML output of the fragments I posted is quite adequate.
Its violating the DRY principle of pasting that fragment over and over that annoys me.

Anton Aylward

unread,
Sep 16, 2015, 1:55:22 PM9/16/15
to Radiant CMS, te...@onghu.com
Ok, so I installed
gem "radiant-parameterized_snippets-extension"

and this ought to work, but doesn’t.

<div>
<r:if_var name="image" matches="[0-9]*]" >
   <r:asset:link id=\"<r:var name="image" />\" >
    
</r:if_var>
<r:if_var name="image" matches="[A-Za-z][A-Za-z0-9_\-]*]" >
   <r:asset:link title=\"<r:var name="image" />\" >
    
</if_var> 
       <if_var name="size"   > size=\"<r:var name="size" />\" </r:if_var>
       <if_var name="height" > height=\"<r:var name="height" />\" </r:if_var>
       <if_var name="width">   width=\"<r:var name="width" />\" </r:if_var>
   </r:asset:link >
</div>

The error I get is

wrong end tag `asset:link' found for start tag `if_var' with stack [
]

I don't know which one that is.
My best guess is that there is a problem with the quote marks.

 

Benny Degezelle

unread,
Sep 17, 2015, 10:00:19 AM9/17/15
to Radiant CMS, te...@onghu.com
You seem to be mixing double and single tags;
A tag is either <r:tag>...</r:tag> or <r:tag />
So </r:asset:link > should be <r:asset:link />


Op woensdag 16 september 2015 19:55:22 UTC+2 schreef Anton Aylward:
Reply all
Reply to author
Forward
0 new messages