i have added a textstring field to my page to hold the document id and have successfully displayed this on the page using an xslt and a macro inserted in the RTE of the page. This works fine just displaying as text on a page however, I need to insert this url inside an <a href tag within the RTE
Obvisouly, when you insert a macro it wraps it in a div and span etc.
Is this something i can achieve within the RTE of my page content or do I need to take a different approach?
Thanks Rich, i had a look and found the spans in the xslt so have whipped them out... however i still get the div when i insert the macro in the RTE. when i click to edit the html this is what i see...
If you look where it says <td>id: - this is the point where i inserted the macro using the 'insert macro' button and the div below it is the result..... perhaps this is a side effect of using the insert macro button, is it possible to write the code to call the macro instead?
I havent included the XSLT but can do if you'd still like to see it.
<!-- ============================================================ If the current node property PhotoText is NOT empty then we display a span with the PhotoText property in. ============================================================ --> <xsl:if test="$currentPage/data [@alias ='CVID'] != ''"> <xsl:value-of select="$currentPage/data [@alias ='CVID']"/> </xsl:if>
I took a new approach and probably the more 'umbraco' way and was getting pretty close, but your code was spot on Tom. Its working right now which is the main thing and i might try the better engineered approach later!
Build a dynamic url to link to google docs
Hi guys,
I'm trying to build a couple of direct links to a google doc inside my site.... the links im trying to build look like this...
http://docs.google.com/MiscCommands?command=saveasdoc&exportformat=doc&docID=[MYVARIABLEDOCUMENTID]
i have added a textstring field to my page to hold the document id and have successfully displayed this on the page using an xslt and a macro inserted in the RTE of the page. This works fine just displaying as text on a page however, I need to insert this url inside an <a href tag within the RTE
Obvisouly, when you insert a macro it wraps it in a div and span etc.
Is this something i can achieve within the RTE of my page content or do I need to take a different approach?
Thanks in advance
Sam : )
Inserting a macro alone does not insert *any* extra code/text (divs or spans included)!
I suggest you post your XSLT here to give everyone a better idea of what the problem is.
Rich
Thanks Rich, i had a look and found the spans in the xslt so have whipped them out... however i still get the div when i insert the macro in the RTE. when i click to edit the html this is what i see...
<table border="0">
<tbody>
<tr>
<td><a href="" <img src="/media/1545/downloaddoc2copy.jpg" alt="DownloadCVdoc" width="251" height="259" rel="251,259" /></a></td>
<td><a href="http://docs.google.com/MiscCommands?command=saveasdoc&exportformat=pdf&docID=0AScEyQ9GC2UFZHY3NGYydF8xM2hydmRzZmN2&hl"> <img src="/media/1595/downloadpdf.jpg" alt="DownloadCVpdf" width="251" height="259" rel="251,259" /></a></td>
</tr>
<tr>
<td>id :
<div umb_macroalias="GoogleCVID" ismacro="true" onresizestart="return false;" umbversionid="4814f220-ab7b-471f-a14d-952c5fbf1fcc" umbpageid="1119" title="This is rendered content from macro" class="umbMacroHolder"><!-- startUmbMacro -->cvtest<!-- endUmbMacro --></div>
</td>
</tr>
</tbody>
</table>
If you look where it says <td>id: - this is the point where i inserted the macro using the 'insert macro' button and the div below it is the result..... perhaps this is a side effect of using the insert macro button, is it possible to write the code to call the macro instead?
I havent included the XSLT but can do if you'd still like to see it.
Sorry, missed the bit where you mentioned you're adding the macro via the RTE.
You could try going to your macro and deselecting "Render content in editor", then add the macro again.
However do you really need the macro to be adding via the RTE, or can you add it directly to the template?
Also if you post your xslt then i'm sure someone can help.
Rich
Okay, sounds like I'm approaching this from the wrong angle!
My basic aim is to have 2 download images, each link to a similar url with the same CVID as one of the parameters, the links would look like this...
url 1 : http://docs.google.com/MiscCommands?command=saveasdoc&exportformat=pdfamp;docID=[CVID]
url 2 : http://docs.google.com/MiscCommands?command=saveasdoc&exportformat=pdfamp;docID=[CVID]
As I said, i have the CVID as a field on my page, just need to get the CVID into the href tag!
Any ideas how it should be done?!
here's the xslt that returns the google doc id
********************************************************
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp " ">
]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
exclude-result-prefixes="msxml umbraco.library">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage" select="$currentPage/.."/>
<xsl:template match="/">
<!--
============================================================
If the current node property PhotoText is NOT empty then
we display a span with the PhotoText property in.
============================================================
-->
<xsl:if test="$currentPage/data [@alias ='CVID'] != ''">
<xsl:value-of select="$currentPage/data [@alias ='CVID']"/>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Off the top of my head, I believe that should work
Tom
I took a new approach and probably the more 'umbraco' way and was getting pretty close, but your code was spot on Tom. Its working right now which is the main thing and i might try the better engineered approach later!
Thanks you both for your help guys, thats great
: )
is working on a reply...