Re: Is there a way to get just the file name extension of an Attribute placeholder using render tag

99 views
Skip to first unread message

Jian Huang

unread,
Aug 7, 2012, 2:02:14 PM8/7/12
to reddot-c...@googlegroups.com
Ravi!

Solution:

<%!! Escape:Text(<%att_med_pdf_filename%>.Substring(Escape:Text(<%att_med_pdf_filename%>).LastIndexOf(.)) !!%>

On Monday, August 6, 2012 5:10:27 PM UTC-7, Ravi Garg wrote:
Currently I'm using PreExecute code with ASP function to get the file extension from an Attribute(Media) placeholder. Pls see the code below
<%=GetFileExtension("<%att_med_pdf_filename%>")%>

I would like to get the same result using render tag, Is that possible with something like the code below?
Context:CurrentPage.Elements.GetElement(att_med_pdf_filename).Value

Thanks,
Ravi



Ravi Garg

unread,
Aug 8, 2012, 7:04:32 AM8/8/12
to reddot-c...@googlegroups.com
Hi Jian,

Not sure whats going wrong but that did not work. I tried the following code & none of the placeholders (Media or Attribute) worked. They both return nothing.

med_pdf - is the media placeholder
att_pdf - is the attribute placeholder to get the file name out of med_pdf.

 <!-- <%med_pdf%> -->
 <%att_pdf%><br />
ext- <%!! Escape:Text(<%med_pdf%>.Substring(Escape:Text(<%med_pdf%>).LastIndexOf(.)) !!%>
ext- <%!! Escape:Text(<%att_pdf%>.Substring(Escape:Text(<%att_pdf%>).LastIndexOf(.)) !!%>

Thanks,
Ravi 

Jian Huang

unread,
Aug 8, 2012, 2:04:51 PM8/8/12
to reddot-c...@googlegroups.com
Ooops, I accidentally deleted a )

 <%!! Escape:Text(<%med_pdf%>).Substring(Escape:Text(<%med_pdf%>).LastIndexOf(.)) !!%>

Ravi Garg

unread,
Aug 8, 2012, 7:04:00 PM8/8/12
to reddot-c...@googlegroups.com
Jian - That worked! Thanks a lot!

--
You received this message because you are subscribed to the Google Groups "RedDot CMS Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/reddot-cms-users/-/MsDDC0mN7FEJ.

To post to this group, send email to reddot-c...@googlegroups.com.
To unsubscribe from this group, send email to reddot-cms-use...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/reddot-cms-users?hl=en.



--
Ravi Garg
ravig...@gmail.com
+61 427 966 001

Reply all
Reply to author
Forward
0 new messages